/* =============================================
   DESIGN SYSTEM — Global Variables & Base Styles
   Online Gambling Information Website
   ============================================= */

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
  /* Colors — White/light default */
  --color-primary: #F7F8FA;
  --color-secondary: #F5A623;
  --color-accent: #00CC6A;
  --color-bg: #FFFFFF;
  --color-card: #F2F4F7;
  --color-text: #1A202C;
  --color-text-secondary: #4A5568;
  --color-success: #38A169;
  --color-warning: #DD6B20;
  --color-danger: #E53E3E;

  /* Overlay colors (adapt to bg) */
  --overlay-subtle: rgba(0, 0, 0, 0.04);
  --overlay-light: rgba(0, 0, 0, 0.06);
  --overlay-medium: rgba(0, 0, 0, 0.08);
  --overlay-border: rgba(0, 0, 0, 0.08);
  --overlay-border-light: rgba(0, 0, 0, 0.05);

  /* Dark mode overrides (toggled via .dark-mode) */
  --color-bg-dark: #0D1B2A;
  --color-card-dark: #1A2B3C;
  --color-text-dark: #FFFFFF;
  --color-text-secondary-dark: #A0AEC0;

  /* Typography */
  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-accent: 'Rajdhani', sans-serif;
  --font-size-base: 16px;
  --line-height-body: 1.7;
  --h1-size: 48px;
  --h2-size: 36px;
  --h3-size: 24px;
  --h4-size: 20px;

  /* Layout */
  --max-width: 1200px;
  --sidebar-width: 320px;
  --gap: 24px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 20px rgba(245, 166, 35, 0.3);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 300ms ease;
  --transition-slow: 500ms ease;

  /* Z-index scale */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-navbar: 300;
  --z-modal: 400;
  --z-toast: 500;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: var(--line-height-body);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color var(--transition-base), color var(--transition-base);
}

/* Dark mode (toggle) */
body.dark-mode {
  --color-bg: var(--color-bg-dark);
  --color-card: var(--color-card-dark);
  --color-text: var(--color-text-dark);
  --color-text-secondary: var(--color-text-secondary-dark);
  --color-primary: #0A1628;
  --overlay-subtle: rgba(255, 255, 255, 0.04);
  --overlay-light: rgba(255, 255, 255, 0.06);
  --overlay-medium: rgba(255, 255, 255, 0.08);
  --overlay-border: rgba(255, 255, 255, 0.06);
  --overlay-border-light: rgba(255, 255, 255, 0.04);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --color-success: #48BB78;
  --color-warning: #F6AD55;
  --color-danger: #FC8181;
  --color-accent: #00FF88;
}

/* Dark mode — component overrides that can't use tokens */
body.dark-mode .navbar {
  background: rgba(10, 22, 40, 0.95);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

body.dark-mode .nav-link:hover,
body.dark-mode .nav-link.active {
  background: rgba(255, 255, 255, 0.06);
}

body.dark-mode .site-footer {
  background: var(--color-primary);
  border-top-color: rgba(255, 255, 255, 0.06);
}

body.dark-mode .hero {
  background: linear-gradient(135deg, #0A1628 0%, #0D1B2A 50%, #0F2035 100%);
}

body.dark-mode .hero-text .trust-row {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .notification-bar {
  background: linear-gradient(90deg, var(--color-secondary), #D4880E);
  color: #0A1628;
}

body.dark-mode .cookie-banner {
  background: var(--color-card);
  border-top-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .search-overlay {
  background: rgba(10, 22, 40, 0.95);
}

body.dark-mode .mobile-menu {
  background: var(--color-bg);
}

body.dark-mode .nav-dropdown {
  background: var(--color-card);
  border-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .nav-search-btn,
body.dark-mode .theme-toggle {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .btn-ghost {
  border-color: rgba(255, 255, 255, 0.12);
}

body.dark-mode .btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.04);
}

body.dark-mode .btn-outline {
  border-color: var(--color-secondary);
}

/* --- Skip to Content (Accessibility) --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-secondary);
  color: var(--color-primary);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  z-index: 9999;
  text-decoration: none;
}

.skip-link:focus {
  top: 8px;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text);
}

h1 { font-size: var(--h1-size); margin-bottom: 16px; }
h2 { font-size: var(--h2-size); margin-bottom: 14px; }
h3 { font-size: var(--h3-size); margin-bottom: 12px; }
h4 { font-size: var(--h4-size); margin-bottom: 10px; }

@media (max-width: 768px) {
  h1 { font-size: 32px; }
  h2 { font-size: 26px; }
  h3 { font-size: 20px; }
  h4 { font-size: 18px; }
}

p {
  margin-bottom: 16px;
  color: var(--color-text-secondary);
}

a {
  color: var(--color-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent);
}

strong { color: var(--color-text); }

/* Numbers & Stats */
.stat-number {
  font-family: var(--font-accent);
  font-weight: 700;
  color: var(--color-secondary);
}

/* --- Layout Utilities --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.section {
  padding: 80px 0;
}

@media (max-width: 768px) {
  .section { padding: 48px 0; }
}

.grid {
  display: grid;
  gap: var(--gap);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 992px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.flex-col { flex-direction: column; }
.gap-sm { gap: 12px; }
.gap-md { gap: 24px; }
.gap-lg { gap: 48px; }

/* Content + Sidebar Layout */
.content-layout {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: 40px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gap);
}

@media (max-width: 1024px) {
  .content-layout {
    grid-template-columns: 1fr;
  }
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-secondary), #D4880E);
  color: #0A1628;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(245, 166, 35, 0.5);
  color: #0A1628;
}

.btn-outline {
  background: transparent;
  color: var(--color-text);
  border: 2px solid var(--color-secondary);
}

.btn-outline:hover {
  background: var(--color-secondary);
  color: #0A1628;
}

.btn-accent {
  background: linear-gradient(135deg, var(--color-accent), #00cc6a);
  color: #0A1628;
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

/* Ghost button — low-priority CTAs (View All, See More) */
.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-ghost:hover {
  color: var(--color-text);
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.04);
}

.btn-sm { padding: 10px 20px; font-size: 14px; }
.btn-lg { padding: 18px 36px; font-size: 18px; }

/* --- Cards --- */
.card {
  background: var(--color-card);
  border-radius: var(--radius);
  padding: var(--gap);
  border: 1px solid var(--overlay-border);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
}

.badge-gold {
  background: rgba(245, 166, 35, 0.15);
  color: var(--color-secondary);
  border: 1px solid rgba(245, 166, 35, 0.3);
}

.badge-green {
  background: rgba(72, 187, 120, 0.15);
  color: var(--color-success);
  border: 1px solid rgba(72, 187, 120, 0.3);
}

.badge-red {
  background: rgba(252, 129, 129, 0.15);
  color: var(--color-danger);
  border: 1px solid rgba(252, 129, 129, 0.3);
}

/* --- Star Rating --- */
.star-rating {
  display: inline-flex;
  gap: 2px;
  color: var(--color-secondary);
  font-size: 18px;
}

.star-rating .star-empty {
  color: rgba(245, 166, 35, 0.25);
}

.star-rating .star-half {
  position: relative;
}

/* --- Forms --- */
.form-input {
  width: 100%;
  padding: 14px 18px;
  background: var(--color-card);
  border: 1px solid var(--overlay-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  transition: border-color var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.15);
}

.form-input::placeholder {
  color: var(--color-text-secondary);
}

/* --- Dividers --- */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  margin: 32px 0;
}

/* --- Reading Progress Bar --- */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--color-secondary), var(--color-accent));
  z-index: calc(var(--z-navbar) + 1);
  transition: width 50ms linear;
}

/* --- Back to Top --- */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  background: var(--color-secondary);
  color: #0A1628;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--transition-base);
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

/* --- Notification Bar --- */
.notification-bar {
  background: linear-gradient(90deg, var(--color-secondary), #D4880E);
  color: #0A1628;
  text-align: center;
  padding: 10px var(--gap);
  font-size: 14px;
  font-weight: 600;
  position: relative;
  z-index: calc(var(--z-navbar) + 1);
}

.notification-bar a {
  color: #0A1628;
  text-decoration: underline;
}

.notification-bar .dismiss-btn {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #0A1628;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.notification-bar.hidden {
  display: none;
}

/* --- Animations --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.animate-in {
  animation: fadeInUp 0.6s ease forwards;
  opacity: 0;
}

.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }

/* --- Scroll Animations (triggered by JS) --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* --- Cookie Banner --- */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-card);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 20px var(--gap);
  z-index: var(--z-modal);
  transform: translateY(100%);
  transition: transform var(--transition-base);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
}

.cookie-banner.visible {
  transform: translateY(0);
}

.cookie-banner .cookie-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

@media (max-width: 768px) {
  .cookie-banner .cookie-content {
    flex-direction: column;
    text-align: center;
  }
}

.cookie-banner p {
  margin: 0;
  font-size: 14px;
}

.cookie-buttons {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

/* --- Age Verification Modal --- */
.age-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gap);
}

.age-modal-overlay.hidden {
  display: none;
}

.age-modal {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  padding: 48px;
  text-align: center;
  max-width: 480px;
  width: 100%;
  border: 1px solid rgba(245, 166, 35, 0.2);
}

.age-modal h2 {
  margin-bottom: 16px;
}

.age-modal p {
  margin-bottom: 32px;
}

.age-modal .age-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.age-modal .age-denied {
  display: none;
  color: var(--color-danger);
  margin-top: 20px;
  font-weight: 600;
}

/* --- Social Share Bar --- */
.social-share {
  position: fixed;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: var(--z-sticky);
}

@media (max-width: 1280px) {
  .social-share {
    position: fixed;
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    transform: none;
    flex-direction: row;
    justify-content: center;
    background: var(--color-card);
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    gap: 12px;
  }
}

.social-share a {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-card);
  color: var(--color-text-secondary);
  font-size: 18px;
  transition: all var(--transition-fast);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.social-share a:hover {
  background: var(--color-secondary);
  color: #0A1628;
  transform: scale(1.1);
}

/* --- Mobile Small (375px) --- */
@media (max-width: 375px) {
  :root {
    --gap: 16px;
    --h1-size: 28px;
    --h2-size: 22px;
    --h3-size: 18px;
    --h4-size: 16px;
  }

  .container { padding: 0 12px; }

  .btn { padding: 12px 20px; font-size: 14px; }
  .btn-lg { padding: 14px 24px; font-size: 16px; }

  .card { padding: 16px; }

  .section { padding: 32px 0; }
}

/* --- Utility Classes --- */
.text-center { text-align: center; }
.text-gold { color: var(--color-secondary); }
.text-green { color: var(--color-accent); }
.text-muted { color: var(--color-text-secondary); }
.text-sm { font-size: 14px; }
.text-lg { font-size: 20px; }
.text-xl { font-size: 24px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 48px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 48px; }
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
