/* Modern CSS Reset & Variable Definitions */
:root {
  --bg-primary: #060919;
  --bg-card: rgba(13, 20, 45, 0.55);
  --border-color: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(255, 255, 255, 0.15);
  
  /* Text Colors */
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  
  /* Accent Colors */
  --gold: #e2b047;
  --gold-glow: rgba(226, 176, 71, 0.25);
  --blue: #38bdf8;
  --blue-glow: rgba(56, 189, 248, 0.25);
  --green: #10b981;
  --green-glow: rgba(16, 185, 129, 0.2);
  --red: #f43f5e;
  --red-glow: rgba(244, 63, 94, 0.2);
  
  /* Layout */
  --header-height: 140px;
  --border-radius: 16px;
  --transition-speed: 0.3s;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.5;
}

/* Glowing Background Blobs */
.glow-bg {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.45;
}

.glow-gold {
  top: -10%;
  left: 20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--gold-glow) 0%, transparent 70%);
}

.glow-blue {
  bottom: 10%;
  right: 15%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--blue-glow) 0%, transparent 70%);
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(13, 20, 45, 0.3);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Glassmorphism Card Style */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
  transition: border-color var(--transition-speed), box-shadow var(--transition-speed), transform var(--transition-speed);
}

.glass-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
}

/* Layout Wrapper */
.app-container {
  max-width: 1680px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 100vh;
}

/* ==========================================================================
   HEADER SECTION
   ========================================================================== */
.main-header {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.logo-glow {
  position: absolute;
  top: -10px;
  left: -10px;
  width: 50px;
  height: 50px;
  background: radial-gradient(circle, var(--gold) 0%, transparent 70%);
  opacity: 0.3;
  filter: blur(5px);
  pointer-events: none;
}

.logo-symbol {
  font-size: 28px;
  background: linear-gradient(135deg, var(--gold), #ffdb70);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 8px var(--gold-glow));
}

.logo-text h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #ffffff 30%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text p {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.live-status-area {
  display: flex;
  align-items: center;
  gap: 15px;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 16px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--green);
  animation: pulse 2s infinite;
}

#txt-live-feed {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--green);
}

.time-display {
  display: flex;
  gap: 10px;
  font-family: 'monospace';
  font-size: 13px;
  color: var(--text-muted);
}

.time-sep {
  color: rgba(255, 255, 255, 0.15);
}

/* Header Buttons */
.header-controls {
  display: flex;
  gap: 10px;
}

.control-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background var(--transition-speed), border-color var(--transition-speed);
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.ticker-tape-wrapper {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 12px;
  overflow: hidden;
}

/* ==========================================================================
   DASHBOARD GRID LAYOUT
   ========================================================================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 24% 50% 24%;
  gap: 20px;
}

@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: 32% 66%;
  }
  .col-right {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 100%;
  }
  .col-left, .col-center, .col-right {
    grid-column: span 1;
  }
}

.grid-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ==========================================================================
   CARDS COMMON DESIGN
   ========================================================================== */
.dashboard-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: max-content;
}

.card-header {
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: 0.3px;
}

.header-with-desc {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.header-desc {
  font-size: 11px;
  color: var(--text-muted);
}

.header-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  letter-spacing: 0.5px;
}

.warning-badge {
  background: var(--red-glow);
  color: var(--red);
  border-color: rgba(244, 63, 94, 0.3);
}

.info-badge {
  background: var(--blue-glow);
  color: var(--blue);
  border-color: rgba(56, 189, 248, 0.3);
}

.card-content {
  padding: 15px;
}

/* ==========================================================================
   LEFT COLUMN: MARKET QUOTES & CALENDAR
   ========================================================================== */
.market-quotes-container, .calendar-container {
  padding: 8px !important;
}

/* ==========================================================================
   CENTER COLUMN: CHART & SESSIONS
   ========================================================================== */
.chart-card {
  height: 580px; /* fixed large size for central chart */
}

.chart-header {
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  flex-wrap: wrap;
  gap: 15px;
}

.symbol-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.symbol-badge {
  font-size: 20px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.symbol-info h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 700;
}

.symbol-full-name {
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: 4px;
}

.asset-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--transition-speed), color var(--transition-speed);
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.chart-container-wrapper {
  flex-grow: 1;
  padding: 0;
  height: calc(100% - 60px);
  position: relative;
}

#tradingview-chart-container {
  width: 100%;
  height: 100%;
}

/* FOREX SESSIONS WIDGET */
.sessions-timeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-bottom: 15px;
}

@media (max-width: 768px) {
  .sessions-timeline {
    grid-template-columns: 100%;
  }
}

.session-block {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 12px 14px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform var(--transition-speed), background var(--transition-speed);
}

.session-block:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.04);
}

.session-block.active {
  background: rgba(56, 189, 248, 0.06);
  border-color: rgba(56, 189, 248, 0.2);
}

.session-block.overlap-active {
  background: rgba(226, 176, 71, 0.06);
  border-color: rgba(226, 176, 71, 0.35);
  box-shadow: 0 0 15px rgba(226, 176, 71, 0.08);
}

.session-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.session-name {
  font-size: 13px;
  font-weight: 600;
}

.session-time {
  font-size: 10px;
  color: var(--text-muted);
}

.session-progress-bg {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  overflow: hidden;
}

.session-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--text-muted);
  border-radius: 20px;
}

.session-block.active .session-progress-bar {
  background: var(--blue);
  box-shadow: 0 0 8px var(--blue);
}

.session-block.overlap-active .session-progress-bar {
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

.session-status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.session-status .status-dot {
  width: 6px;
  height: 6px;
  background-color: var(--text-muted);
  border-radius: 50%;
}

.session-block.active .status-dot {
  background-color: var(--blue);
  box-shadow: 0 0 6px var(--blue);
}

.session-block.overlap-active .status-dot {
  background-color: var(--gold);
  box-shadow: 0 0 6px var(--gold);
  animation: pulse-gold 1.5s infinite;
}

.status-lbl {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.session-block.active .status-lbl {
  color: var(--blue);
}

.session-block.overlap-active .status-lbl {
  color: var(--gold);
  font-weight: 600;
}

/* OVERLAP ALERT CARD */
.overlap-alert {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 15px 18px;
  border-radius: 12px;
  transition: background var(--transition-speed);
}

.overlap-alert.active-warning {
  background: rgba(226, 176, 71, 0.08);
  border-color: rgba(226, 176, 71, 0.3);
  box-shadow: 0 4px 20px rgba(226, 176, 71, 0.05);
}

.alert-icon {
  font-size: 22px;
}

.alert-text h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.overlap-alert.active-warning h4 {
  color: var(--gold);
}

.alert-text p {
  font-size: 11px;
  color: var(--text-muted);
}

.overlap-alert.active-warning p {
  color: var(--text-main);
  opacity: 0.9;
}

/* ==========================================================================
   RIGHT COLUMN: GAUGE & CORRELATIONS
   ========================================================================== */
.gauge-card {
  height: 480px; /* fixed size matching widget dimensions */
}

.gauge-wrapper {
  flex-grow: 1;
  padding: 8px !important;
  height: calc(100% - 60px);
}

.loading-placeholder {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  color: var(--text-muted);
  font-size: 14px;
}

/* CORRELATION ANALYSIS LIST */
.correlation-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.correlation-item {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.correlation-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.corr-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.corr-symbol {
  font-size: 13px;
  font-weight: 600;
}

.corr-ratio {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

.corr-ratio.negative {
  background: var(--red-glow);
  color: var(--red);
}

.corr-ratio.positive {
  background: var(--green-glow);
  color: var(--green);
}

.corr-text {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.main-footer {
  padding: 15px 20px;
  text-align: center;
  margin-top: 10px;
}

.main-footer p {
  font-size: 11px;
  color: var(--text-muted);
}

/* ==========================================================================
   KEYFRAME ANIMATIONS
   ========================================================================== */
@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

@keyframes pulse-gold {
  0% {
    box-shadow: 0 0 0 0 rgba(226, 176, 71, 0.7);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(226, 176, 71, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(226, 176, 71, 0);
  }
}
