/*
   CSS styling examples for the Vaadin app.

   Visit https://vaadin.com/docs/styling/application-theme/ for more information.
*/

/* ============================================================
   Neon Yellow Theme — Black background with bright yellow accents
   Overrides Lumo CSS variables so every Vaadin component inherits
   the black + neon look automatically.
   ============================================================ */
:root {
  /* Base — pure black */
  --lumo-base-color: #000000;
  --lumo-body-text-color: #e5e5e5;
  --lumo-contrast-color: #ffffff;
  --lumo-contrast-10pct: #1a1a1a;
  --lumo-contrast-5pct: #0a0a0a;

  /* Neon yellow accents */
  --lumo-primary-color: #ffea00;
  --lumo-primary-contrast-color: #000000;
  --lumo-secondary-color: #ffff00;
  --lumo-error-color: #ff00ff;
  --lumo-success-color: #ffea00;
  --lumo-warning-color: #ffea00;

  /* Borders / dividers — subtle so neon pops */
  --lumo-border-color: #1a1a1a;
  --lumo-border-radius-m: 0.4rem;
}

/* Neon utility classes — apply to any element for extra glow */
.neon-glow {
  box-shadow: 0 0 8px #ffea00, 0 0 16px #ffea00;
}

.neon-text {
  color: #ffea00;
  text-shadow: 0 0 4px #ffea00;
}

.neon-border {
  border: 1px solid #ffea00;
  box-shadow: 0 0 6px #ffea00;
}

.neon-button {
  background: #ffea00;
  color: #000;
  font-weight: 700;
  box-shadow: 0 0 10px #ffea00;
}

.neon-button:hover {
  filter: brightness(1.2);
}

.neon-card {
  background: #0a0a0a;
  border: 1px solid #ffea00;
  box-shadow: 0 0 12px #ffea00;
}

/* ============================================================
   Material Design Elevation — neon-tinted shadows
   Material uses layered elevation (z-depth) to show hierarchy.
   These shadows use neon yellow instead of standard gray/black
   so raised surfaces glow against the black background.
   ============================================================ */
.elevation-1 {
  box-shadow: 0 2px 4px -1px rgba(255, 234, 0, 0.35),
              0 4px 5px  0  rgba(255, 234, 0, 0.20),
              0 1px 10px  0  rgba(255, 234, 0, 0.12);
}

.elevation-2 {
  box-shadow: 0 3px 6px -2px rgba(255, 234, 0, 0.40),
              0 6px 10px 0  rgba(255, 234, 0, 0.25),
              0 1px 18px 0  rgba(255, 234, 0, 0.15);
}

.elevation-3 {
  box-shadow: 0 5px 10px -3px rgba(255, 234, 0, 0.45),
              0 8px 15px 0  rgba(255, 234, 0, 0.30),
              0 1px 22px 0  rgba(255, 234, 0, 0.18);
}

.elevation-4 {
  box-shadow: 0 7px 14px -4px rgba(255, 234, 0, 0.50),
              0 10px 20px 0 rgba(255, 234, 0, 0.35),
              0 1px 28px 0  rgba(255, 234, 0, 0.22);
}

.elevation-5 {
  box-shadow: 0 10px 20px -5px rgba(255, 234, 0, 0.55),
              0 14px 28px 0 rgba(255, 234, 0, 0.40),
              0 1px 36px 0  rgba(255, 234, 0, 0.25);
}

/* Material raised surface helper — combine elevation + neon card look */
.material-raised {
  background: #0a0a0a;
  border: 1px solid #ffea00;
  box-shadow: 0 4px 8px -2px rgba(255, 234, 0, 0.40),
              0 6px 12px  0  rgba(255, 234, 0, 0.25);
  border-radius: var(--lumo-border-radius-m);
}

/* Example: CSS class name to center align the content . */
.centered-content {
  margin: 0 auto;
  max-width: 250px;
}

body {
  box-sizing: border-box;
  padding-bottom: 10pt;
}

.brand-title {
  gap: 2px;
}

.brand-heading {
  align-items: center;
  gap: 12px;
}

.brand-heading h2 {
  margin: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
}

.dashboard-header {
  min-width: 0;
}

.header-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.instrument-tabs-header {
  min-width: 0;
}

.instrument-tabs-header vaadin-tabs {
  min-width: 0;
  overflow-x: auto;
}

.instrument-tabs-header vaadin-button {
  flex: 0 0 auto;
}

.dialog-selector-row,
.dialog-field-row,
.dialog-execution-row,
.dialog-strategy-field-row,
.admin-selector-row,
.admin-execution-row,
.admin-strategy-field-row,
.responsive-dialog-content,
.status-row {
  min-width: 0;
}


.trading-chart {
  flex: 0 0 auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.market-workspace {
  align-items: stretch;
}

.market-workspace .trading-chart {
  flex: 1 1 0;
  min-width: 0;
}

.account-panel {
  flex: 0 0 220px;
  min-height: 480px;
  box-sizing: border-box;
  padding: 16px;
  border-radius: var(--lumo-border-radius-m);
  background: var(--lumo-contrast-5pct);
}

.account-panel-title {
  margin: 0 0 8px;
}

.account-panel-status,
.account-section-title {
  display: block;
  color: var(--lumo-secondary-text-color);
  font-size: var(--lumo-font-size-s);
}

.account-section-title {
  margin-top: 24px;
  margin-bottom: 8px;
  font-weight: 600;
}

.account-balances {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
}

.account-wallet {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.account-wallet-title {
  color: var(--lumo-secondary-text-color);
  font-size: var(--lumo-font-size-s);
  font-weight: 600;
}

.account-balance-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--lumo-contrast-10pct);
}

.account-balance-asset {
  font-weight: 600;
}

.account-balance-amounts {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  color: var(--lumo-secondary-text-color);
  font-size: var(--lumo-font-size-xs);
  text-align: right;
}

@media (max-width: 800px) {
  .market-workspace {
    flex-direction: column;
  }

  .account-panel {
    flex-basis: auto;
    width: 100% !important;
    min-height: auto;
  }
}

.chart-with-timeframe {
  position: relative;
  flex: 1 1 auto;
  min-height: 480px;
  height: auto;
  padding-bottom: 60px;
  box-sizing: border-box;
  background: var(--lumo-contrast-5pct);
  display: flex;
  flex-direction: column;
}

.chart-canvas {
  flex: 1 1 auto;
  height: auto;
  min-height: 420px;
}

.chart-timeframe-selector {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 2;
}

.chart-live-toggle {
  position: absolute;
  left: 205px;
  bottom: 12px;
  z-index: 2;
  padding: 8px 12px;
  border-radius: var(--lumo-border-radius-m);
  background: var(--lumo-contrast-10pct);
}

.chart-close-button {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
}

.live-sizing-line,
.live-sizing-validation {
  display: block;
  padding: 3px 0;
}

.live-sizing-validation {
  color: var(--lumo-success-text-color);
  font-weight: 600;
}

.live-sizing-invalid {
  color: var(--lumo-error-text-color);
}

.candle-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.top-instruments-section {
  display: flex;
  align-items: center;
  overflow: hidden;
  box-sizing: border-box;
  min-height: 44px;
  margin-top: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--lumo-contrast-10pct);
  border-bottom: 1px solid var(--lumo-contrast-10pct);
  white-space: nowrap;
}

.top-instruments-marquee-content {
  display: inline-block;
  min-width: 100%;
  padding-left: 100%;
  color: var(--lumo-secondary-text-color);
  font-size: var(--lumo-font-size-s);
  font-weight: 600;
  animation: top-instruments-scroll 45s linear infinite;
}

@keyframes top-instruments-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-100%);
  }
}

.dashboard-footer {
  box-sizing: border-box;
  min-height: 76px;
  margin-top: 8px;
  padding: 20px 16px 48px;
  border-top: 1px solid var(--lumo-contrast-10pct);
  color: var(--lumo-secondary-text-color);
  font-size: var(--lumo-font-size-s);
}

.thinking-feed-title {
  display: block;
  margin-bottom: 8px;
  color: var(--lumo-body-text-color);
  font-weight: 600;
}

.thinking-feed-viewport {
  height: 6.25rem;
  overflow: hidden;
  white-space: pre-line;
}

.thinking-feed-lines {
  display: flex;
  height: 100%;
  flex-direction: column;
  justify-content: flex-end;
  line-height: 1.25rem;
}

.thinking-feed-line {
  flex: 0 0 1.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-page {
  overflow-y: auto;
}

@media (max-width: 600px) {
  .dashboard-page,
  .admin-page {
    box-sizing: border-box;
    padding: var(--lumo-space-s) !important;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: stretch !important;
    gap: var(--lumo-space-s);
  }

  .brand-heading {
    gap: 8px;
  }

  .brand-heading h2 {
    font-size: var(--lumo-font-size-xl);
  }

  .header-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: var(--lumo-space-xs);
  }

  .header-actions vaadin-button {
    min-width: 0;
    width: 100%;
  }

  .instrument-tabs-header {
    gap: var(--lumo-space-xs);
  }

  .instrument-tabs-header vaadin-tabs {
    flex: 1 1 auto;
  }

  .market-workspace {
    flex: 0 0 auto !important;
    gap: var(--lumo-space-s);
  }

  .market-workspace .trading-chart {
    flex: 0 0 360px;
    height: 360px;
    min-height: 360px;
  }

  .account-panel {
    padding: 12px;
  }

  .account-balances {
    max-height: 260px;
  }

  .chart-with-timeframe {
    flex: 0 0 360px;
    height: 360px;
    min-height: 0;
    padding-bottom: 104px;
  }

  .chart-canvas {
    flex: 1 1 auto;
    height: 100%;
    min-height: 0;
  }

  .chart-timeframe-selector {
    left: 8px;
    bottom: 52px;
    width: calc(100% - 16px) !important;
  }

  .chart-live-toggle {
    left: 8px;
    bottom: 8px;
  }

  .chart-close-button {
    right: 8px;
    bottom: 8px;
  }

  .status-row {
    flex-wrap: wrap;
    gap: var(--lumo-space-xs);
  }

  .top-instruments-section {
    min-height: 40px;
  }

  .dashboard-footer {
    padding: 16px 8px 32px;
  }

  .responsive-dialog {
    max-width: calc(100vw - 16px);
  }

  .responsive-dialog-content,
  .dialog-selector-row,
  .dialog-field-row,
  .dialog-execution-row,
  .dialog-strategy-field-row,
  .admin-selector-row,
  .admin-execution-row,
  .admin-strategy-field-row {
    width: 100%;
  }

  .dialog-selector-row,
  .dialog-field-row,
  .dialog-execution-row,
  .dialog-strategy-field-row,
  .admin-selector-row,
  .admin-execution-row,
  .admin-strategy-field-row {
    flex-direction: column;
    align-items: stretch;
    gap: var(--lumo-space-s);
  }

  .dialog-selector-row > *,
  .dialog-field-row > *,
  .dialog-execution-row > *,
  .dialog-strategy-field-row > *,
  .admin-selector-row > *,
  .admin-execution-row > *,
  .admin-strategy-field-row > * {
    box-sizing: border-box;
    width: 100% !important;
    min-width: 0;
  }

  .admin-page > vaadin-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .top-instruments-marquee-content {
    padding-left: 0;
    animation: none;
  }
}
