/* GuessMasters — Complete Stylesheet v2 */
/* Product of Tech Eagles | Under Mahakumbrix Innovation */

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

/* ── Dark Theme (Default) ── */
:root {
  --brand-dark: #0a0f1e;
  --brand-navy: #0d1b3e;
  --brand-gold: #f59e0b;
  --brand-gold-light: #fcd34d;
  --brand-green: #10b981;
  --brand-red: #ef4444;
  --brand-blue: #3b82f6;
  --surface: #111827;
  --surface-2: #1f2937;
  --surface-3: #374151;
  --border: rgba(255,255,255,0.08);
  --border-gold: rgba(245,158,11,0.3);
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --font-head: 'Space Grotesk', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --btn-shadow: 0 4px 14px rgba(245,158,11,0.35);
  --btn-shadow-hover: 0 6px 20px rgba(245,158,11,0.5);
}

/* ── Light Theme ── */
[data-theme="light"] {
  --brand-dark: #f0f4ff;
  --brand-navy: #e8edf8;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --surface-3: #e2e8f0;
  --border: rgba(0,0,0,0.09);
  --border-gold: rgba(245,158,11,0.4);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
  --btn-shadow: 0 4px 14px rgba(245,158,11,0.25);
  --btn-shadow-hover: 0 6px 20px rgba(245,158,11,0.4);
}
[data-theme="light"] body { background: #f0f4ff; }
[data-theme="light"] .navbar { background: rgba(255,255,255,0.92); border-bottom-color: rgba(0,0,0,0.08); }
[data-theme="light"] .sidebar { background: #ffffff; border-right-color: rgba(0,0,0,0.08); }
[data-theme="light"] .form-control { background: #f8fafc; color: #0f172a; border-color: #e2e8f0; }
[data-theme="light"] .form-control:focus { border-color: var(--brand-gold); background: #fff; }
[data-theme="light"] .ticker-wrap { background: #e8edf8; }
[data-theme="light"] .upgrade-banner { background: linear-gradient(135deg, rgba(245,158,11,0.08), rgba(217,119,6,0.04)); }
[data-theme="light"] .modal { background: #ffffff; }
[data-theme="light"] .dropdown-menu { background: #ffffff; }
[data-theme="light"] table th { background: #f8fafc; }
[data-theme="light"] .insight-box { background: #fffbeb; }
[data-theme="light"] .stat-card { background: #ffffff; }
[data-theme="light"] .sidebar-link:hover, [data-theme="light"] .sidebar-link.active { background: rgba(245,158,11,0.08); }

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

body {
  font-family: var(--font-body);
  background: var(--brand-dark);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

/* ── Typography ── */
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; }
h1 { font-size: clamp(1.8rem, 5vw, 3.5rem); line-height: 1.1; }
h2 { font-size: clamp(1.4rem, 3vw, 2.2rem); }
h3 { font-size: 1.2rem; }

/* ── Navbar ── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,15,30,0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  transition: background 0.3s;
}
.navbar-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.navbar-logo {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--brand-gold), #d97706);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 700; font-size: 18px; color: #000;
  box-shadow: 0 2px 10px rgba(245,158,11,0.3);
}
.navbar-name { font-family: var(--font-head); font-weight: 700; font-size: 1.1rem; color: var(--text-primary); }
.navbar-tagline { font-size: 0.68rem; color: var(--text-muted); line-height: 1; }
.navbar-nav { display: flex; align-items: center; gap: 0.75rem; }

/* ── BEAUTIFUL BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 0.6rem 1.3rem;
  border-radius: 10px;
  font-family: var(--font-body); font-size: 0.9rem; font-weight: 600;
  cursor: pointer; text-decoration: none; border: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative; overflow: hidden;
  white-space: nowrap;
}
.btn::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(255,255,255,0);
  transition: background 0.2s;
  border-radius: inherit;
}
.btn:hover::after { background: rgba(255,255,255,0.08); }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000; font-weight: 700;
  box-shadow: var(--btn-shadow);
  border: 1px solid transparent;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  box-shadow: var(--btn-shadow-hover);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent; color: var(--text-primary);
  border: 1.5px solid var(--border);
  backdrop-filter: blur(4px);
}
.btn-outline:hover {
  border-color: var(--brand-gold); color: var(--brand-gold);
  background: rgba(245,158,11,0.06);
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff; box-shadow: 0 4px 14px rgba(239,68,68,0.3);
}
.btn-danger:hover {
  background: linear-gradient(135deg, #f87171, #ef4444);
  box-shadow: 0 6px 20px rgba(239,68,68,0.4);
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff; box-shadow: 0 4px 14px rgba(16,185,129,0.3);
}
.btn-success:hover {
  background: linear-gradient(135deg, #34d399, #10b981);
  box-shadow: 0 6px 20px rgba(16,185,129,0.4);
  transform: translateY(-1px);
}

.btn-purple {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #fff; box-shadow: 0 4px 14px rgba(124,58,237,0.3);
}
.btn-purple:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(124,58,237,0.4); }

.btn-google {
  background: #fff; color: #333; font-weight: 600;
  border: 1.5px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.btn-google:hover {
  background: #f9fafb; transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.btn-sm { padding: 0.42rem 0.9rem; font-size: 0.82rem; border-radius: 8px; }
.btn-lg { padding: 0.85rem 2rem; font-size: 1rem; border-radius: 12px; }
.btn-xl { padding: 1rem 2.5rem; font-size: 1.05rem; border-radius: 14px; }
.btn-block { width: 100%; justify-content: center; }

/* ── Theme Toggle ── */
.theme-toggle {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 20px; padding: 5px 14px;
  cursor: pointer; font-size: 0.82rem;
  color: var(--text-secondary);
  transition: all 0.2s; font-family: var(--font-body);
  display: flex; align-items: center; gap: 6px;
}
.theme-toggle:hover { border-color: var(--brand-gold); color: var(--brand-gold); background: rgba(245,158,11,0.06); }

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.card-gold { border-color: var(--border-gold); }
.card-hover { cursor: pointer; }
.card-hover:hover { border-color: var(--brand-gold); transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,0.2); }

/* ── Badge ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 0.72rem; font-weight: 600;
}
.badge-pro { background: rgba(245,158,11,0.15); color: var(--brand-gold); border: 1px solid var(--border-gold); }
.badge-free { background: var(--surface-3); color: var(--text-secondary); }
.badge-green { background: rgba(16,185,129,0.15); color: var(--brand-green); border: 1px solid rgba(16,185,129,0.3); }
.badge-red { background: rgba(239,68,68,0.15); color: var(--brand-red); border: 1px solid rgba(239,68,68,0.3); }
.badge-purple { background: rgba(124,58,237,0.15); color: #a78bfa; border: 1px solid rgba(124,58,237,0.3); }

/* ── Forms ── */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 0.84rem; color: var(--text-secondary); margin-bottom: 6px; font-weight: 500; }
.form-control {
  width: 100%; padding: 0.68rem 1rem;
  background: var(--surface-2); border: 1.5px solid var(--border);
  border-radius: 10px; color: var(--text-primary);
  font-family: var(--font-body); font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus { outline: none; border-color: var(--brand-gold); box-shadow: 0 0 0 3px rgba(245,158,11,0.12); }
.form-control::placeholder { color: var(--text-muted); }
select.form-control option { background: var(--surface-2); color: var(--text-primary); }

/* ── Stock Search Dropdown ── */
.stock-search-wrap { position: relative; }
.stock-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 500;
  background: var(--surface);
  border: 1.5px solid var(--border-gold);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
  max-height: 220px; overflow-y: auto;
  display: none;
}
.stock-dropdown.open { display: block; }
.stock-dropdown-item {
  padding: 10px 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.88rem; border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.stock-dropdown-item:last-child { border-bottom: none; }
.stock-dropdown-item:hover { background: rgba(245,158,11,0.08); }
.stock-dropdown-item .sym { font-weight: 700; color: var(--text-primary); }
.stock-dropdown-item .name { color: var(--text-muted); font-size: 0.8rem; }
.stock-dropdown-item .exch { font-size: 0.72rem; background: var(--surface-3); padding: 2px 7px; border-radius: 10px; color: var(--text-secondary); }
.stock-dropdown-empty { padding: 1rem; text-align: center; color: var(--text-muted); font-size: 0.85rem; }
.stock-search-loading { padding: 1rem; text-align: center; color: var(--brand-gold); font-size: 0.85rem; }

/* ── Table ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th {
  text-align: left; padding: 0.75rem 1rem;
  color: var(--text-muted); font-weight: 600; font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
td { padding: 0.85rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(255,255,255,0.02); }

/* ── Stats Grid ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  transition: border-color 0.2s;
}
.stat-card:hover { border-color: var(--border-gold); }
.stat-label { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.06em; }
.stat-value { font-size: 1.6rem; font-weight: 700; font-family: var(--font-head); }
.stat-value.positive { color: var(--brand-green); }
.stat-value.negative { color: var(--brand-red); }
.stat-change { font-size: 0.78rem; margin-top: 3px; color: var(--text-muted); }

/* ── Alert ── */
.alert { padding: 0.85rem 1.1rem; border-radius: 10px; font-size: 0.88rem; margin-bottom: 1rem; display: flex; align-items: flex-start; gap: 8px; }
.alert-success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.25); color: #34d399; }
.alert-error   { background: rgba(239,68,68,0.1);  border: 1px solid rgba(239,68,68,0.25);  color: #f87171; }
.alert-warning { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.25); color: var(--brand-gold); }
.alert-info    { background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.25); color: #60a5fa; }

/* ── Layout ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.page-header { padding: 2rem 0 1.5rem; }
.page-header h1 { font-size: 1.8rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.5rem; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.65); backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.active { display: flex; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 2rem;
  width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto;
  animation: slideUp 0.25s ease;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.modal-close {
  background: var(--surface-2); border: none; color: var(--text-muted);
  cursor: pointer; font-size: 1.2rem; width: 32px; height: 32px;
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.modal-close:hover { background: var(--surface-3); color: var(--text-primary); }

/* ── AI Insight Box ── */
.insight-box {
  background: var(--surface);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg); padding: 1.5rem;
  position: relative;
}
.insight-box::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--brand-gold), transparent); border-radius: 20px 20px 0 0; }
.insight-box h4 { color: var(--brand-gold); margin-bottom: 0.75rem; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; }
.insight-content { color: var(--text-secondary); line-height: 1.9; font-size: 0.9rem; white-space: pre-wrap; }
.insight-content strong, .insight-content b { color: var(--text-primary); }

/* ── Sidebar Layout ── */
.app-layout { display: flex; min-height: calc(100vh - 64px); }
.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
  position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto;
  transition: background 0.3s;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 3px; }
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 0.65rem 0.9rem; border-radius: 10px;
  text-decoration: none; color: var(--text-secondary);
  font-size: 0.88rem; font-weight: 500;
  transition: all 0.15s;
}
.sidebar-link:hover, .sidebar-link.active {
  background: rgba(245,158,11,0.1); color: var(--brand-gold);
}
.sidebar-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.main-content { flex: 1; padding: 2rem; overflow-x: hidden; min-width: 0; }

/* ── Upgrade Banner ── */
.upgrade-banner {
  background: linear-gradient(135deg, rgba(245,158,11,0.12), rgba(217,119,6,0.06));
  border: 1px solid var(--border-gold);
  border-radius: var(--radius); padding: 1rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin-bottom: 1.5rem; flex-wrap: wrap;
}
.upgrade-banner p { color: var(--text-secondary); font-size: 0.85rem; }
.upgrade-banner strong { color: var(--brand-gold); }

/* ── Footer ── */
footer {
  background: var(--brand-navy);
  border-top: 1px solid var(--border);
  padding: 2rem; text-align: center;
}
footer .footer-brand { font-family: var(--font-head); font-size: 1.2rem; font-weight: 700; margin-bottom: 6px; }
footer .footer-sub { font-size: 0.75rem; color: var(--text-muted); }

/* ── Loading Spinner ── */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast Notification ── */
.gm-toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999;
  padding: 0.85rem 1.25rem; border-radius: 12px;
  font-size: 0.88rem; font-weight: 500;
  max-width: 320px; animation: toastIn 0.3s ease;
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}
@keyframes toastIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:none; } }
.gm-toast.success { background: #065f46; color: #6ee7b7; border: 1px solid #059669; }
.gm-toast.error   { background: #7f1d1d; color: #fca5a5; border: 1px solid #b91c1c; }
.gm-toast.info    { background: #1e3a5f; color: #93c5fd; border: 1px solid #2563eb; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .navbar { padding: 0 1rem; }
  .main-content { padding: 1rem; }
  .modal { padding: 1.5rem; border-radius: 16px; }
  .btn-lg { padding: 0.75rem 1.5rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .navbar-tagline { display: none; }
}

/* ── Utility ── */
.text-gold    { color: var(--brand-gold); }
.text-green   { color: var(--brand-green); }
.text-red     { color: var(--brand-red); }
.text-muted   { color: var(--text-muted); }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.mt-1 { margin-top: 0.5rem; }  .mt-2 { margin-top: 1rem; }    .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; } .gap-2 { gap: 1rem; } .flex-wrap { flex-wrap: wrap; }
.hidden { display: none !important; }
.w-full { width: 100%; }
.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* ── Dropdown Menu ── */
.dropdown-menu {
  position: absolute; right: 0; top: 48px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; min-width: 200px; z-index: 200;
  padding: 6px; box-shadow: 0 8px 30px rgba(0,0,0,0.25);
  display: none;
}
.dropdown-menu.active { display: block; animation: slideUp 0.2s ease; }
.dropdown-menu-header { padding: 8px 12px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.dropdown-menu-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 8px;
  text-decoration: none; color: var(--text-secondary);
  font-size: 0.875rem; transition: all 0.15s; cursor: pointer;
}
.dropdown-menu-item:hover { background: var(--surface-2); color: var(--text-primary); }
.dropdown-menu-item.danger { color: var(--brand-red); }
.dropdown-menu-item.danger:hover { background: rgba(239,68,68,0.1); }
