@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-main: #060709;
  --bg-card: rgba(13, 16, 22, 0.75);
  --bg-sidebar: rgba(10, 12, 16, 0.85);
  --border-color: rgba(255, 255, 255, 0.06);
  --border-glow: rgba(0, 230, 118, 0.15);
  
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  /* Accent colors matching chart styles */
  --c-bull: #00e676;
  --c-bear: #ff1744;
  --c-yellow: #ffeb3b;
  --c-white: #ffffff;
  --c-blue: #0080ff;
  --c-cyan: #00c8ff;
  --c-orange: #ff8000;
  
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  display: flex;
}

/* Glassmorphism utility */
.glass {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dashboard Layout */
.sidebar {
  width: 320px;
  height: 100vh;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--border-color);
  background: var(--bg-sidebar);
  backdrop-filter: blur(20px);
  z-index: 10;
  flex-shrink: 0;
}

.main-content {
  flex-grow: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  gap: 10px;
  overflow: hidden;
  box-sizing: border-box;
}

/* Sidebar Styling */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--c-bull) 0%, var(--c-blue) 100%);
  border-radius: 8px;
  box-shadow: 0 0 16px rgba(0, 230, 118, 0.4);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  color: #000;
}

.brand-text h1 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #ffffff, #9ca3af);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text span {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Stats / Cards */
.stats-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex-grow: 1;
  overflow-y: auto;
  padding-right: 4px;
}

/* Custom Scrollbar for stats panel */
.stats-panel::-webkit-scrollbar {
  width: 4px;
}
.stats-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.metric-card {
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
}

.metric-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.metric-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
}

.status-bull {
  background: rgba(0, 230, 118, 0.1);
  color: var(--c-bull);
  border: 1px solid rgba(0, 230, 118, 0.2);
}

.status-bear {
  background: rgba(255, 23, 68, 0.1);
  color: var(--c-bear);
  border: 1px solid rgba(255, 23, 68, 0.2);
}

.status-neutral {
  background: rgba(107, 114, 128, 0.1);
  color: var(--text-secondary);
  border: 1px solid rgba(107, 114, 128, 0.2);
}

/* Chart Card Containers */
.chart-card {
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  height: 100%;
}

.chart-header {
  padding: 8px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(10, 13, 18, 0.4);
  font-size: 12px;
  font-weight: 600;
  user-select: none;
}

.chart-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.chart-body {
  flex-grow: 1;
  position: relative;
  width: 100%;
  height: 100%;
}

/* Sizing indicators */
#pane-ohlc { flex: 2.8; }
#pane-kalshi { flex: 1.0; }
#pane-macd2 { flex: 1.3; }
#pane-macd { flex: 1.4; }
#pane-vol { flex: 1.3; }
#pane-zone { flex: 1.3; }

/* Loading and toast notifications */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(6, 7, 9, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: opacity 0.5s ease;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(0, 230, 118, 0.1);
  border-radius: 50%;
  border-top-color: var(--c-bull);
  animation: spin 1s ease-in-out infinite;
  margin-bottom: 24px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.loading-subtext {
  font-size: 12px;
  color: var(--text-muted);
}

.footer {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 16px;
}

.footer-row {
  display: flex;
  justify-content: space-between;
}

/* Micro-animations */
button.btn-refresh {
  background: linear-gradient(135deg, rgba(0, 230, 118, 0.15) 0%, rgba(0, 200, 255, 0.15) 100%);
  border: 1px solid rgba(0, 230, 118, 0.3);
  color: var(--c-bull);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  font-family: var(--font-sans);
  margin-top: 16px;
}

button.btn-refresh:hover {
  background: linear-gradient(135deg, rgba(0, 230, 118, 0.25) 0%, rgba(0, 200, 255, 0.25) 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 230, 118, 0.15);
}

button.btn-refresh:active {
  transform: translateY(1px);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  body {
    flex-direction: column;
    height: auto;
    overflow-y: auto;
  }
  
  .sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 16px;
  }
  
  .stats-panel {
    overflow-y: visible;
  }
  
  .main-content {
    height: auto;
    overflow: visible;
    padding: 12px;
  }
  
  .chart-card {
    flex: none !important;
    height: 250px;
  }
  
  #pane-ohlc {
    height: 350px;
  }
  
  #pane-kalshi {
    height: 150px;
  }
  
  .chart-legend {
    display: none; /* Hide legends on small screens to save space, crosshair tooltips will still show */
  }
}
