﻿/* ─────────────────────────────────────────────────────────────────────────────
   Zay Paing (2D Tech) - Glassmorphism Theme Engine (Dark + Light)
   ───────────────────────────────────────────────────────────────────────────── */

/* ─── DARK THEME (Default) ──────────────────────────────────────────────────── */
:root, [data-theme="dark"] {
  --bg-body: #06091a;
  --bg-body-gradient: radial-gradient(ellipse at 50% 0%, #0f172a 0%, #06091a 60%);
  --bg-surface: rgba(255, 255, 255, 0.04);
  --bg-surface-elevated: rgba(255, 255, 255, 0.07);
  --bg-input: rgba(255, 255, 255, 0.06);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #f59e0b;
  --divider-line: rgba(255, 255, 255, 0.06);
  --glass-blur: blur(24px);
  --glass-border: 1px solid rgba(255, 255, 255, 0.1);

  --header-bg: rgba(6, 9, 26, 0.85);
  --header-text: #ffffff;
  --nav-bg: rgba(15, 23, 42, 0.6);
  --nav-tab-bg: rgba(255, 255, 255, 0.04);
  --nav-tab-active-bg: rgba(245, 158, 11, 0.15);
  --nav-tab-active-text: #f59e0b;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-dim: #64748b;

  --card-bg: rgba(255, 255, 255, 0.04);
  --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --card-border: 1px solid rgba(255, 255, 255, 0.08);

  --gold-accent: #f59e0b;
  --gold-glow: rgba(245, 158, 11, 0.35);
  --chip-bg: rgba(255, 255, 255, 0.06);
  --chip-active-bg: linear-gradient(135deg, #f59e0b, #d97706);
  --chip-active-text: #000000;

  --matrix-cell-bg: rgba(255, 255, 255, 0.04);
  --matrix-cell-text: #94a3b8;
  --matrix-cell-border: rgba(255, 255, 255, 0.06);
  --matrix-hit-bg: rgba(245, 158, 11, 0.15);
  --matrix-hit-text: #fbbf24;
  --matrix-hit-border: rgba(245, 158, 11, 0.6);

  --footer-bg: rgba(6, 9, 26, 0.9);

  --hero-bg: linear-gradient(145deg, rgba(15, 23, 42, 0.8), rgba(6, 9, 26, 0.9));
  --hero-border: 1px solid rgba(245, 158, 11, 0.25);
  --hero-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 60px rgba(245, 158, 11, 0.08);
}

/* ─── LIGHT / WHITE THEME ──────────────────────────────────────────────────── */
[data-theme="light"] {
  --bg-body: #f0f2f5;
  --bg-body-gradient: radial-gradient(ellipse at 50% 0%, #e8ecf1 0%, #f0f2f5 60%);
  --bg-surface: rgba(255, 255, 255, 0.7);
  --bg-surface-elevated: rgba(255, 255, 255, 0.85);
  --bg-input: rgba(0, 0, 0, 0.03);
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-focus: #d97706;
  --divider-line: rgba(0, 0, 0, 0.06);
  --glass-blur: blur(24px);
  --glass-border: 1px solid rgba(255, 255, 255, 0.6);

  --header-bg: rgba(13, 35, 66, 0.92);
  --header-text: #ffffff;
  --nav-bg: rgba(255, 255, 255, 0.6);
  --nav-tab-bg: rgba(0, 0, 0, 0.04);
  --nav-tab-active-bg: #0f172a;
  --nav-tab-active-text: #f59e0b;

  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-dim: #94a3b8;

  --card-bg: rgba(255, 255, 255, 0.65);
  --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  --card-border: 1px solid rgba(255, 255, 255, 0.6);

  --gold-accent: #d97706;
  --gold-glow: rgba(217, 119, 6, 0.2);
  --chip-bg: rgba(0, 0, 0, 0.04);
  --chip-active-bg: linear-gradient(135deg, #0f172a, #1e293b);
  --chip-active-text: #ffffff;

  --matrix-cell-bg: rgba(0, 0, 0, 0.03);
  --matrix-cell-text: #475569;
  --matrix-cell-border: rgba(0, 0, 0, 0.07);
  --matrix-hit-bg: #fef3c7;
  --matrix-hit-text: #b45309;
  --matrix-hit-border: #f59e0b;

  --footer-bg: rgba(13, 35, 66, 0.92);

  --hero-bg: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  --hero-border: 1.5px solid #e2e8f0;
  --hero-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.08), 0 2px 10px rgba(0, 0, 0, 0.04);
}

/* ─── Global Reset ──────────────────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Noto Sans Myanmar', 'Pyidaungsu', 'Padauk', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-body);
  background-image: var(--bg-body-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.35s ease, color 0.35s ease;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(245, 158, 11, 0.03) 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(59, 130, 246, 0.02) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ─── Top Header ────────────────────────────────────────────────────────────── */
.app-header {
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  color: var(--header-text);
  padding: 14px 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(255, 255, 255, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.header-inner {
  max-width: 540px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-icon {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  font-weight: 900;
  font-size: 14px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  position: relative;
  letter-spacing: -0.5px;
}

.brand-logo-icon::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), transparent);
  z-index: -1;
  filter: blur(8px);
}

.brand-headings { display: flex; flex-direction: column; gap: 1px; }

.brand-myanmar {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.2px;
  line-height: 1.2;
}

.brand-tag { color: #fbbf24; font-size: 13px; }

.brand-english {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.header-actions { display: flex; align-items: center; gap: 8px; }

/* Theme Toggle Button */
.theme-toggle-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  width: 38px;
  height: 38px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #ffffff;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.25);
  transform: rotate(20deg) scale(1.05);
  box-shadow: 0 2px 12px rgba(255, 255, 255, 0.1);
}

.theme-toggle-btn:active { transform: rotate(20deg) scale(0.95); }

.lang-toggle-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  height: 36px;
  padding: 0 12px;
  border-radius: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 800;
  color: #ffffff;
  transition: all 0.25s ease;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.lang-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.lang-toggle-btn:active {
  transform: translateY(0);
}

.lang-icon { font-size: 13px; }
.lang-text { letter-spacing: 0.5px; }


.header-live-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 14px;
  border-radius: 24px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  transition: all 0.3s ease;
}

.live-dot.connected {
  background: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.7), 0 0 20px rgba(16, 185, 129, 0.3);
  animation: dot-pulse 2s ease-in-out infinite;
}

.live-dot.disconnected {
  background: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

@keyframes dot-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.live-text { letter-spacing: 0.5px; }

/* ─── Navigation Switcher Tabs ───────────────────────────────────────────────── */
.nav-tabs-wrapper {
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 14px;
  position: sticky;
  top: 68px;
  z-index: 99;
}

.nav-tabs-container {
  max-width: 540px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  background: var(--nav-tab-bg);
  padding: 4px;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
}

.nav-tab {
  background: transparent;
  border: none;
  padding: 10px 4px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  position: relative;
}

.nav-tab .tab-icon { font-size: 13px; transition: transform 0.3s ease; }

.nav-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.nav-tab:hover .tab-icon { transform: scale(1.15); }

.nav-tab.active {
  background: var(--nav-tab-active-bg);
  color: var(--nav-tab-active-text);
  box-shadow: 0 2px 12px rgba(245, 158, 11, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.nav-tab.active .tab-icon { transform: scale(1.1); }

/* ─── Main Content ───────────────────────────────────────────────────────────── */
.main-wrapper {
  flex: 1;
  max-width: 540px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 16px 48px;
  position: relative;
  z-index: 1;
}

.tab-content { display: none; }

.tab-content.active {
  display: block;
  animation: fadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Market Status & Clock Bar ─────────────────────────────────────────────── */
.status-clock-card {
  background: var(--bg-surface);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-radius: 14px;
  padding: 12px 16px;
  border: var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 12px;
  box-shadow: var(--card-shadow);
  transition: all 0.3s ease;
}

.status-clock-card:hover { border-color: rgba(255, 255, 255, 0.15); }

.market-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.2px;
}

.market-pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
  animation: market-pulse 2.5s ease-in-out infinite;
}

@keyframes market-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(16, 185, 129, 0.5); }
  50% { box-shadow: 0 0 16px rgba(16, 185, 129, 0.8); }
}

.market-pulse-dot.closed {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
  animation: none;
}

.market-pulse-dot.break {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}


.bkk-clock-box {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-subtle);
  border-radius: 20px;
  padding: 5px 12px;
  font-weight: 700;
  color: #0284c7;
  font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
  font-size: 14px;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

[data-theme="dark"] .bkk-clock-box {
  color: #38bdf8;
  background: rgba(255, 255, 255, 0.06);
}

.bkk-clock-box:hover {
  border-color: var(--gold-accent);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.bkk-clock-box:active {
  transform: translateY(0);
}

.clock-flag {
  font-size: 12px;
  color: var(--text-primary);
  font-family: var(--font-base);
  font-weight: 800;
}

/* ─── Live Hero 2D Box ──────────────────────────────────────────────────────── */
.live-hero-box {
  background: var(--hero-bg);
  -webkit-backdrop-filter: blur(30px);
  backdrop-filter: blur(30px);
  color: #ffffff;
  border-radius: 22px;
  padding: 28px 24px;
  box-shadow: var(--hero-shadow);
  border: var(--hero-border);
  margin-bottom: 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.live-hero-box::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.5), transparent);
}

.live-hero-box::after {
  content: '';
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 80px;
  background: radial-gradient(ellipse, rgba(245, 158, 11, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.live-badge-glow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  padding: 5px 14px;
  border-radius: 24px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.pulse-ring {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fbbf24;
  animation: ring-pulse 1.5s ease-in-out infinite;
  box-shadow: 0 0 6px rgba(251, 191, 36, 0.6);
}

@keyframes ring-pulse {
  0%   { transform: scale(0.85); opacity: 0.6; }
  50%  { transform: scale(1.4); opacity: 1; }
  100% { transform: scale(0.85); opacity: 0.6; }
}

.hero-updated-time { font-size: 12px; color: #94a3b8; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }

.hero-number-container {
  margin: 12px 0 24px;
  position: relative;
  z-index: 2;
}

.hero-2d-digit {
  font-size: 108px;
  font-weight: 900;
  line-height: 1;
  color: #ffffff;
  letter-spacing: -4px;
  text-shadow: 0 0 40px rgba(245, 158, 11, 0.5), 0 0 80px rgba(245, 158, 11, 0.2), 0 6px 20px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.3s, text-shadow 0.3s;
  font-variant-numeric: tabular-nums;
}


/* ─── Live Number Blinking Animation ───────────────────────────────────────── */
@keyframes live-number-blink {
  0%, 100% {
    opacity: 1;
    text-shadow: 0 0 50px rgba(245, 158, 11, 0.9), 0 0 90px rgba(245, 158, 11, 0.4), 0 6px 20px rgba(0, 0, 0, 0.6);
  }
  50% {
    opacity: 0.25;
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
  }
}

.hero-2d-digit.live-blinking {
  animation: live-number-blink 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

[data-theme="light"] .hero-2d-digit.live-blinking {
  animation: live-number-blink-light 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes live-number-blink-light {
  0%, 100% {
    opacity: 1;
    color: #d97706;
    text-shadow: 0 4px 25px rgba(217, 119, 6, 0.5);
  }
  50% {
    opacity: 0.25;
    color: #f59e0b;
    text-shadow: 0 2px 5px rgba(217, 119, 6, 0.1);
  }
}

.hero-2d-digit.pop {
  transform: scale(1.15);
  color: #fbbf24;
  text-shadow: 0 0 60px rgba(245, 158, 11, 0.8), 0 0 100px rgba(245, 158, 11, 0.4), 0 6px 20px rgba(0, 0, 0, 0.5);
}

.hero-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  position: relative;
  z-index: 2;
}

.metric-box {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: all 0.25s ease;
}

.metric-box:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.metric-title {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.metric-val {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}

/* ─── Light Mode Overrides for Live Hero Box ──────────────────────────────── */
[data-theme="light"] .live-hero-box {
  background: var(--hero-bg);
  color: var(--text-primary);
  border: var(--hero-border);
  box-shadow: var(--hero-shadow);
}

[data-theme="light"] .live-hero-box::before {
  background: linear-gradient(90deg, transparent, rgba(217, 119, 6, 0.35), transparent);
}

[data-theme="light"] .live-hero-box::after {
  display: none;
}

[data-theme="light"] .live-badge-glow {
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #b45309;
}

[data-theme="light"] .hero-updated-time {
  color: #64748b;
}

[data-theme="light"] .hero-2d-digit {
  color: #d97706;
  text-shadow: 0 4px 20px rgba(217, 119, 6, 0.25), 0 1px 3px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .hero-2d-digit.pop {
  color: #f59e0b;
  text-shadow: 0 4px 28px rgba(245, 158, 11, 0.45), 0 1px 3px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .metric-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .metric-box:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

[data-theme="light"] .metric-title {
  color: #64748b;
}

[data-theme="light"] .metric-val {
  color: #0f172a;
}


/* ─── Sessions Card ─────────────────────────────────────────────────────────── */
.card-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 0 2px;
}

.card-date-heading {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.refresh-pill-btn {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--chip-bg);
  border: 1px solid var(--border-subtle);
  padding: 6px 14px;
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.refresh-pill-btn:hover {
  background: var(--bg-surface-elevated);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.refresh-pill-btn:active { transform: translateY(0) scale(0.97); }

.thaistock-results-card {
  background: var(--card-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-radius: 20px;
  padding: 8px 24px;
  box-shadow: var(--card-shadow);
  border: var(--card-border);
  transition: background-color 0.35s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.thaistock-results-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.session-item-block {
  padding: 16px 0;
  text-align: center;
  border-radius: 12px;
  transition: background 0.2s ease;
}

.session-item-block:hover { background: rgba(255, 255, 255, 0.02); }

.session-label-time {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}

.session-values-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  text-align: center;
}

.session-col { display: flex; flex-direction: column; gap: 3px; }

.val-label {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.val-number {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.val-number.twod-amber {
  font-size: 24px;
  font-weight: 900;
  color: var(--gold-accent);
  text-shadow: 0 0 20px var(--gold-glow);
}

.card-divider-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--divider-line), transparent);
  margin: 0;
}

/* ─── Custom Filter & Dropdown Box (History Tab) ─────────────────────────────── */
.custom-filter-box {
  background: var(--card-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: var(--card-border);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
}

.custom-filter-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.filter-box-header { margin-bottom: 14px; }

.filter-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.quick-chips-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.quick-chips-row::-webkit-scrollbar { display: none; }

.chip-btn {
  background: var(--chip-bg);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 24px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.chip-btn:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.chip-btn.active {
  background: var(--chip-active-bg);
  color: var(--chip-active-text);
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.25);
}

/* Custom Dropdown Trigger */
.custom-select-wrapper { position: relative; }

.custom-select-trigger {
  background: var(--bg-input);
  border: 1.5px solid var(--border-subtle);
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.25s ease;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.custom-select-trigger:hover {
  border-color: var(--gold-accent);
  background: var(--bg-surface-elevated);
}

.select-icon { font-size: 16px; margin-right: 10px; }

.select-label {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.select-arrow {
  font-size: 10px;
  color: var(--text-secondary);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-select-wrapper.open .select-arrow { transform: rotate(180deg); }

/* Dropdown Menu */
.custom-select-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-surface-elevated);
  -webkit-backdrop-filter: blur(30px);
  backdrop-filter: blur(30px);
  border: var(--glass-border);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  z-index: 80;
  display: none;
  overflow: hidden;
}

.custom-select-wrapper.open .custom-select-dropdown {
  display: block;
  animation: dropdownIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.dropdown-search-box {
  padding: 12px;
  background: rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  gap: 8px;
}

.custom-date-field {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  font-size: 13px;
  font-family: inherit;
  background: var(--bg-input);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s ease;
}

.custom-date-field:focus { border-color: var(--gold-accent); }

.custom-apply-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  border: none;
  font-weight: 800;
  font-size: 12px;
  padding: 9px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.custom-apply-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
}

.custom-apply-btn:active { transform: translateY(0) scale(0.97); }

.dropdown-list {
  max-height: 220px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.dropdown-item {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  transition: all 0.15s ease;
}

.dropdown-item:hover {
  background: rgba(245, 158, 11, 0.08);
  color: var(--gold-accent);
  padding-left: 20px;
}

.loading-state-card {
  background: var(--card-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-radius: 18px;
  padding: 36px 24px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  font-weight: 500;
}
/* ─── 2D Number Table (00 to 99 Grid) ────────────────────────────────────────── */
.matrix-card {
  background: var(--card-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-radius: 22px;
  padding: 24px;
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
}

.matrix-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.matrix-header { margin-bottom: 16px; }

.matrix-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.matrix-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 500;
}

.matrix-search-row {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.matrix-input {
  flex: 1;
  padding: 11px 14px;
  border: 1.5px solid var(--border-subtle);
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg-input);
  color: var(--text-primary);
  outline: none;
  transition: all 0.25s ease;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.matrix-input:focus {
  border-color: var(--gold-accent);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.matrix-input::placeholder { color: var(--text-dim); }

.matrix-clear-btn {
  background: var(--chip-bg);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
  padding: 11px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.matrix-clear-btn:hover {
  background: var(--bg-surface-elevated);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.matrix-clear-btn:active { transform: translateY(0) scale(0.97); }

.number-grid-container {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
}

.grid-num-cell {
  aspect-ratio: 1;
  background: var(--matrix-cell-bg);
  border: 1px solid var(--matrix-cell-border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--matrix-cell-text);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: default;
  font-variant-numeric: tabular-nums;
}

.grid-num-cell:hover {
  background: var(--bg-surface-elevated);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.grid-num-cell.hit {
  background: var(--matrix-hit-bg);
  border-color: var(--matrix-hit-border);
  color: var(--matrix-hit-text);
  font-weight: 900;
  box-shadow: 0 2px 12px var(--gold-glow);
  animation: hitPulse 0.5s ease-out;
}

@keyframes hitPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.grid-num-cell.highlight {
  background: var(--gold-accent);
  color: #000;
  transform: scale(1.18);
  z-index: 5;
  box-shadow: 0 4px 16px var(--gold-glow);
  font-weight: 900;
}

/* ─── Footer ─────────────────────────────────────────────────────────────────── */
.app-footer {
  margin-top: auto;
  background: var(--footer-bg);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  color: #fff;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 28px 16px;
  text-align: center;
  position: relative;
}

.app-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.2), transparent);
}

.footer-inner {
  max-width: 540px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-ref {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
}

.footer-copy {
  font-size: 12px;
  color: #64748b;
}

.footer-copy strong {
  color: #f59e0b;
  font-weight: 700;
}


/* ─────────────────────────────────────────────────────────────────────────────
   Comprehensive Responsive Styles (Mobile, Tablet & Desktop)
   ───────────────────────────────────────────────────────────────────────────── */

/* Safe area insets for iOS notches and dynamic islands */
.app-header {
  padding-top: max(12px, env(safe-area-inset-top));
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

.app-footer {
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

/* ─── Tablet & Desktop (min-width: 768px) ─────────────────────────────────── */
@media (min-width: 768px) {
  .header-inner,
  .nav-tabs-container,
  .main-wrapper,
  .footer-inner {
    max-width: 620px;
  }

  .brand-logo-icon {
    width: 44px;
    height: 44px;
    font-size: 17px;
  }

  .brand-myanmar {
    font-size: 18px;
  }

  .brand-english {
    font-size: 12px;
  }

  .nav-tab {
    padding: 10px 8px;
    font-size: 13px;
    gap: 6px;
  }

  .nav-tab .tab-icon {
    font-size: 15px;
  }

  .live-hero-box {
    padding: 32px 28px;
  }

  .hero-2d-digit {
    font-size: 116px;
  }

  .metric-val {
    font-size: 20px;
  }

  .thaistock-results-card {
    padding: 28px 26px;
  }

  .session-label-time {
    font-size: 18px;
  }

  .val-number {
    font-size: 18px;
  }

  .val-number.twod-amber {
    font-size: 22px;
  }

  .number-grid-container {
    gap: 8px;
  }

  .grid-num-cell {
    font-size: 14px;
  }
}

/* ─── Standard Mobile (max-width: 600px) ───────────────────────────────────── */
@media (max-width: 600px) {
  .main-wrapper {
    padding: 12px 10px 32px;
  }

  .hero-2d-digit {
    font-size: clamp(72px, 20vw, 96px);
  }

  .metric-val {
    font-size: 16px;
  }
}

/* ─── Compact Mobile Screens (max-width: 400px) ────────────────────────────── */
@media (max-width: 400px) {
  .app-header {
    padding: 10px 10px;
  }

  .header-inner {
    gap: 6px;
  }

  .header-brand {
    gap: 7px;
  }

  .brand-logo-icon {
    width: 32px;
    height: 32px;
    font-size: 13px;
    border-radius: 8px;
  }

  .brand-myanmar {
    font-size: 14px;
  }

  .brand-tag {
    font-size: 11px;
  }

  .brand-english {
    font-size: 10px;
  }

  .header-actions {
    gap: 5px;
  }

  .lang-toggle-btn {
    height: 32px;
    padding: 0 8px;
    font-size: 11px;
  }

  .theme-toggle-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .header-live-pill {
    padding: 4px 8px;
    font-size: 10px;
  }

  .live-text {
    display: none; /* Show glowing dot on very narrow screens */
  }

  .nav-tabs-wrapper {
    padding: 6px 8px;
  }

  .nav-tabs-container {
    gap: 3px;
    padding: 3px;
    border-radius: 10px;
  }

  .nav-tab {
    padding: 7px 2px;
    font-size: 10.5px;
    gap: 3px;
  }

  .nav-tab .tab-icon {
    font-size: 11px;
  }

  .live-hero-box {
    padding: 18px 14px;
    border-radius: 16px;
  }

  .hero-2d-digit {
    font-size: clamp(62px, 18vw, 80px);
  }

  .metric-box {
    padding: 8px 6px;
  }

  .metric-title {
    font-size: 9px;
  }

  .metric-val {
    font-size: 14px;
  }

  .thaistock-results-card {
    padding: 16px 12px;
    border-radius: 16px;
  }

  .session-label-time {
    font-size: 14px;
    margin-bottom: 6px;
  }

  .val-label {
    font-size: 11px;
  }

  .val-number {
    font-size: 14px;
  }

  .val-number.twod-amber {
    font-size: 17px;
  }

  .number-grid-container {
    gap: 3px;
  }

  .grid-num-cell {
    font-size: 11px;
    border-radius: 6px;
  }
}

/* ─── Ultra Small Screens (max-width: 330px) ───────────────────────────────── */
@media (max-width: 330px) {
  .nav-tab {
    font-size: 9.5px;
  }
  .brand-english {
    display: none;
  }
}


/* ─── Modern Burmese Sans-serif Typography ─────────────────────────────────── */
[lang="my"], [data-lang="my"] {
  font-family: 'Inter', 'Noto Sans Myanmar', 'Pyidaungsu', -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 0.15px;
}

[lang="my"] h1, [lang="my"] h2, [lang="my"] h3,
[data-lang="my"] h1, [data-lang="my"] h2, [data-lang="my"] h3,
.brand-myanmar {
  font-family: 'Inter', 'Noto Sans Myanmar', 'Pyidaungsu', sans-serif;
  font-weight: 700;
  line-height: 1.35;
}


/* ─── Graphical Country Flag Icons ────────────────────────────────────────── */
.country-flag-icon {
  width: 20px;
  height: 14px;
  border-radius: 2px;
  display: inline-block;
  vertical-align: middle;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  margin-right: 2px;
}

.clock-flag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.flag-code {
  font-weight: 800;
  letter-spacing: 0.5px;
}
