/* ==========================================================================
   DAFAWIN — LIGHT THEME & APPLE CLEAN DESIGN SYSTEM
   Independent Sports News, Live Scores, Match Analytics & Editorial Blog Portal
   Colors: Dafawin Crimson (#C8102E), Sports Blue (#1A448E), Apple Pure White & Slate
   ========================================================================== */

:root {
  /* Brand Core Colors */
  --color-primary: #C8102E;         /* Dafawin Crimson */
  --color-primary-hover: #A50C24;
  --color-primary-light: #FEE2E2;
  --color-primary-glow: rgba(200, 16, 46, 0.18);

  --color-secondary: #1A448E;       /* Sports Royal Blue */
  --color-secondary-hover: #12316B;
  --color-secondary-light: #EFF6FF;

  --color-gold: #D97706;            /* Amber Gold */
  --color-gold-light: #FEF3C7;
  --color-green: #10B981;           /* Live / Active Indicator */
  --color-green-light: #D1FAE5;

  /* Light Theme Surfaces (Apple Clean Standard) */
  --bg-body: #F8FAFC;               /* Clean Light Canvas */
  --bg-surface: #FFFFFF;            /* Pure White Card */
  --bg-surface-subtle: #F1F5F9;     /* Apple Light Grey Accent */
  --bg-surface-alt: #E2E8F0;        /* Card Divider / Pill */
  --bg-glass: rgba(255, 255, 255, 0.95);

  /* Borders */
  --border-subtle: #E2E8F0;
  --border-medium: #CBD5E1;
  --border-primary: rgba(200, 16, 46, 0.25);
  --border-blue: rgba(26, 68, 142, 0.25);

  /* Typography Colors */
  --text-main: #0F172A;             /* Slate 900 (High contrast dark) */
  --text-body: #334155;             /* Slate 700 */
  --text-muted: #64748B;            /* Slate 500 */
  --text-light: #94A3B8;            /* Slate 400 */

  /* Font Stack */
  --font-heading: 'Montserrat', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;

  /* Layout & Geometry */
  --max-width: 1320px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Apple Soft Shadows */
  --shadow-xs: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 25px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 20px 40px -6px rgba(15, 23, 42, 0.12), 0 8px 16px -4px rgba(15, 23, 42, 0.04);
  --shadow-hover: 0 16px 36px -4px rgba(200, 16, 46, 0.12), 0 6px 12px -2px rgba(15, 23, 42, 0.05);

  /* Transitions */
  --trans-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --trans-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Base Reset & Typography Standards
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  color-scheme: light;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background-color: var(--bg-body);
  color: var(--text-body);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  position: relative;
}

/* Explicit High Contrast Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-main);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 900; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); font-weight: 800; }
h4 { font-size: 1.1rem; font-weight: 700; }

p {
  color: var(--text-body);
  margin-bottom: 1rem;
}

p:last-child {
  margin-bottom: 0;
}

img, svg {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--trans-fast), opacity var(--trans-fast);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: none;
  background: none;
  outline: none;
}

button {
  cursor: pointer;
}

/* Layout Container */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

.section-padding {
  padding-top: 60px;
  padding-bottom: 60px;
}

/* Utility Colors & Text */
.crimson { color: var(--color-primary) !important; }
.blue { color: var(--color-secondary) !important; }
.text-main { color: var(--text-main) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-center { text-align: center; }

/* Responsive Text Visibility Helpers */
.hide-mobile {
  display: inline;
}
.show-mobile {
  display: none;
}

/* ==========================================================================
   STICKY HEADER WRAPPER (TOP SCROLLING TICKER + NAVBAR TOGETHER)
   ========================================================================== */

.sticky-header-container {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  max-width: 100vw;
  background: var(--bg-surface);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
}

/* Right-to-Left Smooth Scrolling Ticker Bar */
.top-ticker-bar {
  background: #0F172A;
  color: #F8FAFC;
  font-size: 0.78rem;
  height: 36px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  width: 100%;
  max-width: 100vw;
}

.ticker-wrapper {
  display: flex;
  overflow: hidden;
  user-select: none;
  width: 100%;
  max-width: 100%;
}

.ticker-track {
  display: flex;
  align-items: center;
  white-space: nowrap;
  animation: marquee-scroll 65s linear infinite;
  gap: 36px;
  padding-left: 100%;
}

.top-ticker-bar:hover .ticker-track {
  animation-play-state: paused;
}

@keyframes marquee-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #F8FAFC;
  font-weight: 600;
}

.ticker-badge-alert {
  background: #DC2626;
  color: #FFFFFF;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ticker-badge-live {
  background: #0284C7;
  color: #FFFFFF;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ticker-divider {
  color: #475569;
  font-size: 0.75rem;
}

/* Main Navigation Bar */
.site-navbar {
  height: 72px;
  display: flex;
  align-items: center;
  background: var(--bg-surface);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.brand-logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo-img {
  height: 48px;
  width: auto;
  display: block;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-item-link {
  padding: 8px 14px;
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-body);
  border-radius: var(--radius-md);
  transition: all var(--trans-fast);
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-item-link:hover {
  color: var(--color-primary);
  background: var(--bg-surface-subtle);
}

.nav-item-link.active {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  align-items: center;
  justify-content: center;
  color: var(--text-main);
}

/* ==========================================================================
   Buttons (Apple Light Standard)
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 800;
  border-radius: var(--radius-md);
  transition: all var(--trans-smooth);
  white-space: nowrap;
  letter-spacing: 0.2px;
  cursor: pointer;
}

.btn-primary {
  background: var(--color-primary);
  color: #FFFFFF !important;
  box-shadow: 0 4px 12px var(--color-primary-glow);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  box-shadow: 0 6px 18px rgba(200, 16, 46, 0.3);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--color-secondary);
  color: #FFFFFF !important;
}

.btn-secondary:hover {
  background: var(--color-secondary-hover);
  transform: translateY(-1px);
}

.btn-outline {
  background: #FFFFFF;
  color: var(--text-main) !important;
  border: 1px solid var(--border-medium);
}

.btn-outline:hover {
  background: var(--bg-surface-subtle);
  border-color: var(--text-main);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 12px 28px;
  font-size: 0.95rem;
  border-radius: var(--radius-lg);
}

/* Cards */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--trans-smooth);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-medium);
}

/* Clean SVG Icon Badges */
.badge-clean {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 0.74rem;
  font-weight: 800;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-live-red {
  background: #FEE2E2;
  color: #DC2626;
  border: 1px solid #FECACA;
}

.badge-tag-blue {
  background: #E0F2FE;
  color: #0284C7;
  border: 1px solid #BAE6FD;
}

.live-pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #10B981;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-green 1.8s infinite;
}

.live-pulse-dot.red {
  background-color: #EF4444;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  animation: pulse-red 1.8s infinite;
}

@keyframes pulse-green {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes pulse-red {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* ==========================================================================
   Mobile Drawer
   ========================================================================== */

.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.mobile-nav-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: -340px;
  width: min(320px, 86vw);
  height: 100vh;
  height: 100dvh;
  background: #FFFFFF;
  z-index: 2000;
  padding: 20px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 30px rgba(15, 23, 42, 0.18);
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-drawer.open {
  right: 0;
}

.mobile-drawer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 16px;
}

.mobile-drawer-close {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--trans-fast);
}

.mobile-drawer-close:active {
  transform: scale(0.94);
  background: var(--border-subtle);
}

.mobile-drawer-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.mobile-drawer-links .nav-item-link {
  font-size: 0.96rem;
  font-weight: 700;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-body);
  transition: all var(--trans-fast);
}

.mobile-drawer-links .nav-item-link:hover,
.mobile-drawer-links .nav-item-link:active {
  color: var(--color-primary);
  background: var(--bg-surface-subtle);
}

.mobile-drawer-links .nav-item-link.active {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

/* ==========================================================================
   Responsive Adaptations & Button Mobile Compacting
   ========================================================================== */

@media (max-width: 1024px) {
  .nav-menu {
    display: none;
  }
  .mobile-nav-toggle {
    display: flex;
  }
}

@media (max-width: 768px) {
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }
  .section-padding {
    padding-top: 42px;
    padding-bottom: 42px;
  }
}

@media (max-width: 640px) {
  .hide-mobile {
    display: none !important;
  }
  .show-mobile {
    display: inline !important;
  }
  .top-ticker-bar {
    height: 32px;
    font-size: 0.72rem;
  }
  .ticker-track {
    gap: 24px;
  }
  .site-navbar {
    height: 60px;
  }
  .brand-logo-img {
    height: 34px;
  }
  .navbar-actions .btn-sm {
    padding: 6px 12px;
    font-size: 0.76rem;
  }
  .mobile-nav-toggle {
    width: 38px;
    height: 38px;
  }
  .section-padding {
    padding-top: 36px;
    padding-bottom: 36px;
  }
  .btn-lg {
    padding: 11px 20px;
    font-size: 0.88rem;
  }
  .btn {
    padding: 9px 16px;
    font-size: 0.84rem;
  }
}

@media (max-width: 380px) {
  .site-navbar {
    height: 56px;
  }
  .brand-logo-img {
    height: 30px;
  }
  .navbar-actions {
    gap: 6px;
  }
  .navbar-actions .btn-sm {
    padding: 5px 10px;
    font-size: 0.72rem;
  }
}
