/* LottoPH SaaS Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --purple-900: #4c1d95;
  --purple-700: #6b21a8;
  --purple-600: #7c3aed;
  --purple-500: #8b5cf6;
  --purple-400: #a78bfa;
  --purple-100: #ede9fe;
  --slate-950: #0f172a;
  --slate-900: #1e293b;
  --slate-700: #334155;
  --slate-500: #64748b;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --green: #16a34a;
  --green-bg: #dcfce7;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --amber-bg: #fef3c7;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 50px rgba(76, 29, 149, 0.15);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--slate-50);
  color: var(--slate-900);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--purple-600); text-decoration: none; }
a:hover { color: var(--purple-700); }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--theme-nav-bg, rgba(255,255,255,0.9));
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--slate-200);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem;
}
.logo {
  display: flex; align-items: center; gap: .6rem;
  font-weight: 800; font-size: 1.25rem; color: var(--slate-900);
}
.logo-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--purple-700), var(--purple-500));
  display: grid; place-items: center; color: white; font-size: 1.1rem;
}
.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a { color: var(--slate-700); font-weight: 500; font-size: .95rem; }
.nav-links a:hover { color: var(--purple-700); }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--purple-900) 0%, var(--purple-700) 45%, var(--purple-500) 100%);
  color: white; padding: 5rem 1.5rem 6rem;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 20% 50%, rgba(255,255,255,.08) 0%, transparent 50%),
              radial-gradient(circle at 80% 20%, rgba(255,255,255,.06) 0%, transparent 40%);
}
.hero-inner { max-width: 1200px; margin: 0 auto; position: relative; text-align: center; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 800; line-height: 1.15; margin-bottom: 1rem; }
.hero p { font-size: 1.15rem; opacity: .92; max-width: 620px; margin: 0 auto 2rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .75rem 1.5rem; border-radius: 10px; font-weight: 600; font-size: .95rem;
  border: none; cursor: pointer; transition: all .2s;
}
.btn-primary {
  background: white; color: var(--purple-700);
  box-shadow: var(--shadow-lg);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 24px 60px rgba(0,0,0,.2); }
.btn-secondary {
  background: rgba(255,255,255,.15); color: white;
  border: 1px solid rgba(255,255,255,.3);
}
.btn-secondary:hover { background: rgba(255,255,255,.25); }
.btn-purple { background: var(--theme-btn-gradient, linear-gradient(135deg, var(--purple-700), var(--purple-500))); color: white; }
.btn-purple:hover { opacity: .92; transform: translateY(-1px); }
.btn-outline { background: white; color: var(--purple-700); border: 2px solid var(--purple-200, #ddd6fe); }
.btn-sm { padding: .5rem 1rem; font-size: .875rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* Layout */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 4rem 0; }
.section-title { font-size: 1.75rem; font-weight: 700; text-align: center; margin-bottom: .5rem; }
.section-sub { text-align: center; color: var(--slate-500); margin-bottom: 2.5rem; }

/* Lotto balls */
.lotto-balls {
  display: flex; flex-wrap: wrap; gap: .55rem;
  justify-content: center; align-items: center;
  margin: .85rem 0;
}
.lotto-ball {
  --ball-hue: 270;
  width: 2.85rem; height: 2.85rem; border-radius: 50%; flex-shrink: 0;
  background:
    radial-gradient(circle at 32% 28%, #fff 0%, hsl(var(--ball-hue) 75% 62%) 38%, hsl(var(--ball-hue) 70% 42%) 100%);
  box-shadow:
    0 4px 14px hsla(var(--ball-hue), 60%, 30%, .35),
    inset 0 -4px 8px rgba(0,0,0,.18),
    inset 0 2px 4px rgba(255,255,255,.45);
  display: grid; place-items: center;
  font-weight: 800; font-size: .95rem; color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.4);
  animation: ballPop .45s ease backwards;
}
.lotto-ball span { line-height: 1; }
.lotto-balls-sm .lotto-ball { width: 2.1rem; height: 2.1rem; font-size: .72rem; }
.lotto-balls-lg .lotto-ball { width: 3.4rem; height: 3.4rem; font-size: 1.15rem; }
.lotto-ball:nth-child(2) { animation-delay: .05s; }
.lotto-ball:nth-child(3) { animation-delay: .1s; }
.lotto-ball:nth-child(4) { animation-delay: .15s; }
.lotto-ball:nth-child(5) { animation-delay: .2s; }
.lotto-ball:nth-child(6) { animation-delay: .25s; }
@keyframes ballPop {
  from { transform: scale(.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.result-card { text-align: center; position: relative; overflow: hidden; }
.result-card-compact { padding: 1.1rem .75rem; }
.result-card-badge {
  display: inline-block; margin-bottom: .5rem;
  padding: .2rem .65rem; border-radius: 999px; font-size: .72rem; font-weight: 700;
  background: var(--theme-feature-icon-bg, var(--purple-100));
  color: var(--theme-primary-700, var(--purple-700));
  text-transform: uppercase; letter-spacing: .04em;
}
.result-card h3 { font-size: 1rem; margin-bottom: .25rem; }
.result-card-meta { font-size: .82rem; color: var(--slate-500); margin-top: .5rem; line-height: 1.45; }
.hero-lotto-deco { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.hero-lotto-deco .lotto-ball {
  position: absolute; opacity: .88;
  animation: heroFloat 6s ease-in-out infinite;
}
.hero-lotto-deco .lotto-ball:nth-child(1) { top: 12%; left: 8%; width: 3.5rem; height: 3.5rem; }
.hero-lotto-deco .lotto-ball:nth-child(2) { top: 20%; right: 10%; width: 2.8rem; height: 2.8rem; animation-delay: 1s; --ball-hue: 45; }
.hero-lotto-deco .lotto-ball:nth-child(3) { bottom: 18%; left: 15%; width: 2.4rem; height: 2.4rem; animation-delay: 2s; --ball-hue: 340; }
.hero-lotto-deco .lotto-ball:nth-child(4) { bottom: 22%; right: 12%; width: 3rem; height: 3rem; animation-delay: .5s; --ball-hue: 200; }
.hero-lotto-deco .lotto-ball:nth-child(5) { top: 45%; left: 4%; width: 2rem; height: 2rem; animation-delay: 1.5s; --ball-hue: 120; }
.hero-lotto-deco .lotto-ball:nth-child(6) { top: 38%; right: 5%; width: 2.2rem; height: 2.2rem; animation-delay: 2.5s; --ball-hue: 280; }
@keyframes heroFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(6deg); }
}
.results-empty-icon { font-size: 2.5rem; margin-bottom: .75rem; line-height: 1; }

/* Cards */
.card {
  background: var(--theme-card-bg, white); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow);
  border: 1px solid var(--theme-card-border, var(--slate-200));
}
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.card h3 { font-size: 1rem; color: var(--theme-card-title, var(--purple-700)); margin-bottom: .5rem; font-weight: 600; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem; background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(4px);
}
.modal-card {
  width: 100%; max-width: 420px; margin: 0;
  max-height: 90vh; overflow-y: auto;
  position: relative;
}
.modal-card.bet-form-modal { max-width: 480px; }
.modal-close {
  position: absolute; top: .65rem; right: .75rem;
  width: 2rem; height: 2rem; border: 0; background: transparent;
  font-size: 1.5rem; line-height: 1; color: var(--slate-500); cursor: pointer;
  border-radius: 8px;
}
.modal-close:hover { color: var(--slate-900); background: rgba(15, 23, 42, .06); }
.bet-confirm-list {
  margin: 0; padding: 0;
  display: grid; grid-template-columns: auto 1fr; gap: .55rem 1rem;
  font-size: .9rem;
}
.bet-confirm-list dt { margin: 0; color: var(--slate-500); font-weight: 500; }
.bet-confirm-list dd { margin: 0; font-weight: 600; color: var(--slate-900); word-break: break-word; }
.bet-success-icon {
  width: 56px; height: 56px; margin: 0 auto 1rem;
  border-radius: 50%; display: grid; place-items: center;
  background: #dcfce7; color: #16a34a; font-size: 1.75rem; font-weight: 700;
}

.stat-card { text-align: center; }
.stat-value { font-size: 2rem; font-weight: 800; color: var(--theme-card-title, var(--purple-700)); }
.stat-label { font-size: .85rem; color: var(--slate-500); margin-top: .25rem; }

/* Feature cards */
.feature-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--theme-feature-icon-bg, var(--purple-100));
  color: var(--theme-primary-600, var(--purple-700));
  display: grid; place-items: center; font-size: 1.4rem; margin-bottom: 1rem;
  position: relative; z-index: 1;
}
.feature-icon img { display: block; width: 24px; height: 24px; }
.card-themed { position: relative; overflow: hidden; }
.card-themed > * { position: relative; z-index: 1; }

/* Dashboard layout */
.dashboard { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--theme-sidebar-bg, var(--slate-950)); color: white; padding: 1.5rem;
  display: flex; flex-direction: column;
}
.sidebar .logo { color: white; margin-bottom: 2rem; }
.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: .25rem; }
.sidebar-nav a, .sidebar-nav button {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1rem; border-radius: 8px; color: #94a3b8;
  background: none; border: none; font: inherit; cursor: pointer; text-align: left; width: 100%;
}
.sidebar-nav a:hover, .sidebar-nav a.active, .sidebar-nav button:hover {
  background: rgba(139, 92, 246, .15); color: white;
}
.main { padding: 2rem; overflow-y: auto; }
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 1.75rem; font-weight: 700; }
.page-header p { color: var(--slate-500); margin-top: .25rem; }

/* Forms */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: .4rem; color: var(--slate-700); }
.form-control {
  width: 100%; padding: .75rem 1rem; border: 1px solid var(--slate-200);
  border-radius: 10px; font: inherit; transition: border .2s;
}
.form-control:focus { outline: none; border-color: var(--purple-500); box-shadow: 0 0 0 3px rgba(139,92,246,.15); }
.auth-card { max-width: 420px; margin: 3rem auto; }

/* Table */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--slate-200); background: white; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { background: var(--slate-100); padding: .875rem 1rem; text-align: left; font-weight: 600; color: var(--slate-700); }
td { padding: .875rem 1rem; border-top: 1px solid var(--slate-200); }
tr:hover td { background: var(--slate-50); }

/* Badges */
.badge {
  display: inline-block; padding: .25rem .65rem; border-radius: 999px;
  font-size: .75rem; font-weight: 600;
}
.badge-success { background: var(--green-bg); color: var(--green); }
.badge-danger { background: var(--red-bg); color: var(--red); }
.badge-warning { background: var(--amber-bg); color: #b45309; }
.badge-purple { background: var(--purple-100); color: var(--purple-700); }

.numbers { font-size: 1.2rem; font-weight: 700; letter-spacing: .05em; font-variant-numeric: tabular-nums; }
.meta { font-size: .85rem; color: var(--slate-500); }

/* GCash deposit payment info — fixed global colors (same on every theme) */
.wallet-pay-box {
  margin: 1rem 0;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  background: #ffffff;
  border: 2px solid #6366f1;
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}
.wallet-pay-label {
  margin: 0 0 .5rem;
  font-size: .85rem;
  font-weight: 600;
  color: #475569;
}
.wallet-pay-number {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: .06em;
  font-variant-numeric: tabular-nums;
  color: #4338ca;
}
.wallet-pay-name {
  margin: .35rem 0 0;
  font-size: .95rem;
  font-weight: 600;
  color: #0f172a;
}
.wallet-pay-hint {
  margin: .75rem 0 0;
  font-size: .8rem;
  line-height: 1.45;
  color: #64748b;
}

.wallet-banner {
  background: var(--theme-wallet-gradient, linear-gradient(135deg, var(--purple-700), var(--purple-500)));
  color: white; border-radius: var(--radius); padding: 1.5rem 2rem;
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem;
}
.wallet-banner .amount { font-size: 2rem; font-weight: 800; }

.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999;
  background: var(--slate-900); color: white; padding: 1rem 1.25rem;
  border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.35);
  display: none; max-width: min(400px, calc(100vw - 2rem));
  border-left: 4px solid var(--purple-500);
  transform: translateY(1rem); opacity: 0;
  transition: transform .35s ease, opacity .35s ease;
  pointer-events: none;
}
.toast.toast-visible { transform: translateY(0); opacity: 1; }
.toast.toast-error { border-left-color: #ef4444; background: linear-gradient(135deg, #450a0a 0%, #1e293b 100%); }
.toast.toast-warning { border-left-color: #f59e0b; background: linear-gradient(135deg, #451a03 0%, #1e293b 100%); }
.toast.toast-success { border-left-color: #22c55e; }
.toast-title { display: block; font-weight: 700; font-size: .95rem; margin-bottom: .35rem; }
.toast-msg { display: block; font-size: .875rem; line-height: 1.45; opacity: .95; }
@keyframes slideIn { from { transform: translateY(1rem); opacity: 0; } }

.footer {
  background: var(--slate-950); color: #94a3b8; padding: 3rem 1.5rem;
  text-align: center; font-size: .9rem;
}

@media (max-width: 768px) {
  .dashboard { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .hero { padding: 3rem 1rem 4rem; }
}

/* Theme: Midnight Gold (dark) overrides */
body.theme-midnight-gold {
  color: var(--theme-body-text);
}
body.theme-midnight-gold .nav { border-bottom-color: #44403c; }
body.theme-midnight-gold .nav-links a { color: #d6d3d1; }
body.theme-midnight-gold .logo { color: #fafaf9; }
body.theme-midnight-gold .card { border-color: var(--theme-card-border); color: #fafaf9; }
body.theme-midnight-gold .card h3 { color: var(--theme-card-title); }
body.theme-midnight-gold .section-title { color: #fafaf9; }
body.theme-midnight-gold .section-alt { background: var(--theme-section-alt-bg) !important; }
body.theme-midnight-gold .section-sub,
body.theme-midnight-gold .meta,
body.theme-midnight-gold .page-header p { color: #a8a29e; }
body.theme-midnight-gold .form-control {
  background: #1c1917; border-color: #44403c; color: #fafaf9;
}
body.theme-midnight-gold .table-wrap { background: var(--theme-card-bg); border-color: #44403c; }
body.theme-midnight-gold th { background: #1c1917; color: #d6d3d1; }
body.theme-midnight-gold td { border-color: #44403c; color: #fafaf9; }
body.theme-midnight-gold tr:hover td { background: #1c1917; }
body.theme-midnight-gold .btn-outline { background: transparent; color: var(--theme-primary-400); border-color: var(--theme-primary-500); }
body.theme-midnight-gold .btn-primary { color: #1c1917; }
body.theme-midnight-gold .feature-icon { background: var(--theme-feature-icon-bg); }

/* Theme: Emerald Pulse */
body.theme-emerald-pulse .card h3 { color: var(--theme-card-title); }
body.theme-emerald-pulse .section-alt { background: var(--theme-section-alt-bg) !important; }

/* Theme: Sunset Royale */
body.theme-sunset-royale .card h3 { color: var(--theme-card-title); }
body.theme-sunset-royale .section-alt { background: var(--theme-section-alt-bg) !important; }

/* Theme: Ocean Neon (dark) */
body.theme-ocean-neon { color: var(--theme-body-text); }
body.theme-ocean-neon .nav { border-bottom-color: #1e3a5f; }
body.theme-ocean-neon .nav-links a { color: #94a3b8; }
body.theme-ocean-neon .logo { color: #f0f9ff; }
body.theme-ocean-neon .card { border-color: var(--theme-card-border); color: #e0f2fe; }
body.theme-ocean-neon .card h3 { color: var(--theme-card-title); }
body.theme-ocean-neon .section-title { color: #f0f9ff; }
body.theme-ocean-neon .section-alt { background: var(--theme-section-alt-bg) !important; }
body.theme-ocean-neon .section-sub,
body.theme-ocean-neon .meta,
body.theme-ocean-neon .page-header p,
body.theme-ocean-neon .result-card-meta { color: #7dd3fc; }
body.theme-ocean-neon .form-control {
  background: #0c1929; border-color: #1e3a5f; color: #f0f9ff;
}
body.theme-ocean-neon .table-wrap { background: var(--theme-card-bg); border-color: #1e3a5f; }
body.theme-ocean-neon th { background: #0c1929; color: #7dd3fc; }
body.theme-ocean-neon td { border-color: #1e3a5f; color: #e0f2fe; }
body.theme-ocean-neon tr:hover td { background: #0c1929; }
body.theme-ocean-neon .btn-outline { color: var(--theme-primary-400); border-color: var(--theme-primary-500); }
body.theme-ocean-neon .btn-primary { color: #0c1929; }
body.theme-ocean-neon .feature-icon { background: var(--theme-feature-icon-bg); }
body.theme-ocean-neon .sidebar-nav a:hover,
body.theme-ocean-neon .sidebar-nav a.active {
  background: rgba(34, 211, 238, .12); color: #22d3ee;
}

body.theme-midnight-gold .sidebar-nav a:hover,
body.theme-midnight-gold .sidebar-nav a.active {
  background: rgba(251, 191, 36, .12); color: #fbbf24;
}

/* Admin theme picker */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.theme-option {
  border: 2px solid var(--slate-200); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; transition: all .2s; background: var(--theme-card-bg, white);
}
.theme-option:hover { border-color: var(--purple-500); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.theme-option.active { border-color: var(--purple-500); box-shadow: 0 0 0 3px rgba(139,92,246,.25); }
.theme-option-preview { width: 100%; height: 120px; object-fit: cover; display: block; }
.theme-option-body { padding: 1rem; }
.theme-option-body h4 { font-size: 1rem; margin-bottom: .25rem; color: var(--purple-700); }
.theme-option-body p { font-size: .85rem; color: var(--slate-500); }
.theme-option-badge {
  display: inline-block; margin-top: .75rem; padding: .25rem .75rem;
  background: var(--green-bg); color: var(--green); border-radius: 999px; font-size: .75rem; font-weight: 600;
}

.number-chip-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.number-chip {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 2.75rem; padding: .4rem .55rem; border-radius: 10px;
  background: linear-gradient(145deg, var(--purple-100, #ede9fe), #fff);
  border: 1px solid var(--theme-card-border, #e2e8f0);
  font-weight: 700; font-size: .95rem; color: var(--purple-700, #6d28d9);
}
.number-chip small { font-weight: 500; font-size: .65rem; color: #64748b; margin-top: .1rem; }
