/* 
   MODERN CSS DESIGN SYSTEM
   Provides premium typography, colors, and layout foundations.
*/

:root {
  /* Typography */
  --font-primary: 'Inter', system-ui, -apple-system, sans-serif;

  /* Color Palette - Curated for High-Conversion Web Apps */
  --bg-body: #F4F7F6;
  --bg-card: #FFFFFF;
  --text-main: #1A1A1A;
  --text-muted: #666666;

  /* Brand Accents (Spanish Flag Palette) */
  --color-brand: #AA151B;
  /* Spanish Red */
  --color-brand-hover: #8A1115;
  --color-accent: #F1BF00;
  /* Spanish Yellow */
  --color-success: #10B981;
  --color-warning: #F59E0B;

  /* Geometry & Shadows */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.1);
  --shadow-button: 0 4px 14px 0 rgba(170, 21, 27, 0.39);

  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-smooth: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================CSS RESET================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

ul {
  list-style: none;
}

/* ==================LAYOUT/UTILITIES================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.empty-grid-template {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  padding: 40px 0;
}

/* ================== CASINO GRID (Cards) ================== */
.casino-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
  padding: 40px 0;
  margin: 0;
}

.casino-card {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
  border: 1px solid rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.casino-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(0, 0, 0, 0.08);
}

.card-badge {
  position: absolute;
  top: 16px;
  right: -32px;
  background: var(--color-warning);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 32px;
  transform: rotate(45deg);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.card-logo {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: #f8f9fa;
  border: 1px solid #eaeaea;
}

.card-title h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
  line-height: 1.2;
}

.card-rating {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

.card-body {
  flex-grow: 1;
  margin-bottom: 24px;
}

.card-features {
  list-style: none;
  padding: 0;
  margin: 0;
}

.card-features li {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card-bonus {
  text-align: center;
}

.bonus-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.bonus-amount {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--color-brand);
}

.card-btn {
  display: block;
  text-align: center;
  background: var(--color-brand);
  color: #fff;
  padding: 14px 24px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 1rem;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-button);
}

.card-btn:hover {
  background: var(--color-brand-hover);
  transform: translateY(-2px);
  color: #fff;
}

.card-btn-secondary {
  background: #2563EB;
  box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.39);
}

.card-btn-secondary:hover {
  background: #1D4ED8;
}

/* Responsive */
@media (max-width: 768px) {
  .casino-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px 0;
  }
}

/* ================== LAYOUT & SEMANTICS ================== */
.site-header {
  background: #111111;
  color: #fff;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}

/* Logo: bright on dark background */
.logo-img {
  max-height: 44px;
  width: auto;
  filter: brightness(0) invert(1) drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4));
}

/* Main Nav */
.main-nav>ul {
  display: flex;
  gap: 4px;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav>ul>li {
  position: relative;
}

.main-nav>ul>li>a {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 8px 14px;
  border-radius: 6px;
  display: block;
  transition: var(--transition-fast);
}

.main-nav>ul>li>a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* Dropdown arrow indicator */
.main-nav .has-dropdown>a::after {
  content: ' ▾';
  font-size: 0.75rem;
  opacity: 0.7;
}

/* Dropdown menu */
.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: #1f1f1f;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  min-width: 220px;
  padding: 8px 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 200;
}

.main-nav li:hover .dropdown-menu {
  display: block;
}

.dropdown-menu li a {
  display: block;
  padding: 10px 18px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  transition: var(--transition-fast);
}

.dropdown-menu li a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-accent);
  padding-left: 22px;
}

.site-main {
  min-height: 60vh;
  padding: 40px 20px;
}

.hero-section {
  text-align: center;
  padding: 40px 0 20px;
}

.hero-section h1 {
  font-size: 2.5rem;
  letter-spacing: -1px;
  margin-bottom: 12px;
}

.hero-section p {
  font-size: 1.25rem;
  color: var(--text-muted);
}

.page-content {
  background: var(--bg-card);
  padding: 40px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  max-width: 800px;
  margin: 0 auto;
}

.page-content h1,
.page-content h2,
.page-content h3 {
  margin-top: 24px;
  margin-bottom: 12px;
}

.page-content p,
.page-content ul {
  margin-bottom: 16px;
  color: #333;
}

/* ================== FOOTER ================== */
.site-footer {
  background: #111111;
  color: #888;
  padding: 60px 0 30px;
  margin-top: 60px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand .logo-img {
  max-height: 40px;
  margin-bottom: 16px;
  display: block;
}

.footer-brand p {
  font-size: 0.85rem;
  line-height: 1.7;
  color: #666;
}

.footer-col h4 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #fff;
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  color: #666;
  font-size: 0.9rem;
  transition: var(--transition-fast);
}

.footer-col a:hover {
  color: var(--color-accent);
  padding-left: 4px;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-bottom p {
  font-size: 0.8rem;
  color: #444;
  margin: 0;
}

.footer-bottom .copyright {
  font-size: 0.8rem;
  color: #555;
}

@media (max-width: 900px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 580px) {
  .footer-inner {
    grid-template-columns: 1fr;
  }
}

/* ================== REVIEW PAGE TEMPLATE ================== */
.review-hero {
  background: var(--bg-card);
  padding: 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 40px;
  margin-bottom: 40px;
}

.review-hero-logo {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-md);
  object-fit: contain;
  background: #f8f9fa;
  border: 1px solid #eaeaea;
  padding: 10px;
}

.review-hero-content {
  flex-grow: 1;
}

.review-hero-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

.review-hero-rating {
  font-size: 1.1rem;
  color: var(--color-warning);
  font-weight: 600;
  margin-bottom: 16px;
  display: inline-block;
}

.review-hero-bonus {
  background: #fef2f2;
  border-left: 4px solid var(--color-brand);
  padding: 16px 20px;
  border-radius: 4px 8px 8px 4px;
  margin-bottom: 24px;
}

.review-hero-bonus h4 {
  font-size: 0.9rem;
  text-transform: uppercase;
  color: var(--color-brand);
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.review-hero-bonus p {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111;
  margin: 0;
}

.review-layout-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
}

.pros-cons-box {
  display: flex;
  gap: 20px;
  margin-bottom: 40px;
}

.pros-box,
.cons-box {
  flex: 1;
  background: var(--bg-card);
  padding: 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.pros-box h3 {
  color: var(--color-success);
  border-bottom: 2px solid var(--color-success);
  padding-bottom: 8px;
  margin-bottom: 16px;
}

.cons-box h3 {
  color: var(--color-brand);
  border-bottom: 2px solid var(--color-brand);
  padding-bottom: 8px;
  margin-bottom: 16px;
}

.pros-list,
.cons-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pros-list li {
  margin-bottom: 12px;
  position: relative;
  padding-left: 24px;
}

.cons-list li {
  margin-bottom: 12px;
  position: relative;
  padding-left: 24px;
}

.pros-list li::before {
  content: "✓";
  color: var(--color-success);
  position: absolute;
  left: 0;
  font-weight: bold;
}

.cons-list li::before {
  content: "✕";
  color: var(--color-brand);
  position: absolute;
  left: 0;
  font-weight: bold;
}

.details-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 40px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.details-table th,
.details-table td {
  padding: 16px;
  border-bottom: 1px solid #eaeaea;
  text-align: left;
}

.details-table th {
  background: #f8f9fa;
  font-weight: 600;
  color: var(--text-main);
  width: 30%;
}

.details-table tr:last-child td,
.details-table tr:last-child th {
  border-bottom: none;
}

.sidebar-widget {
  background: var(--bg-card);
  padding: 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 30px;
  position: sticky;
  top: 100px;
}

.sidebar-widget h3 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  border-bottom: 1px solid #eaeaea;
  padding-bottom: 12px;
}

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

  .pros-cons-box {
    flex-direction: column;
  }

  .review-hero {
    flex-direction: column;
    text-align: center;
  }

  .review-hero-bonus {
    text-align: left;
  }
}

/* ================== CATEGORY / LISTING PAGES ================== */
.category-hero {
  text-align: center;
  padding: 60px 20px 40px;
  max-width: 760px;
  margin: 0 auto 40px;
}

.category-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
  margin-bottom: 16px;
}

.category-hero .hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0;
}

.category-hero .last-updated {
  margin-top: 12px;
  font-size: 0.85rem;
  color: #9CA3AF;
}

/* Filter / Sort Bar */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.filter-tag {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  background: #f3f4f6;
  color: var(--text-main);
  transition: var(--transition-fast);
}

.filter-tag:hover,
.filter-tag.active {
  background: var(--color-brand);
  color: #fff;
  border-color: var(--color-brand);
}

/* Casino Ranking Number */
.casino-card {
  position: relative;
}

.rank-badge {
  position: absolute;
  top: -12px;
  left: -12px;
  width: 30px;
  height: 30px;
  background: var(--color-brand);
  color: #fff;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 1;
}

.rank-badge.gold {
  background: #F59E0B;
}

.rank-badge.silver {
  background: #9CA3AF;
}

.rank-badge.bronze {
  background: #B45309;
}

/* Editorial SEO Text Section */
.editorial-section {
  background: var(--bg-card);
  padding: 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-top: 50px;
}

.editorial-section h2 {
  font-size: 1.5rem;
  margin-bottom: 16px;
  color: var(--text-main);
}

.editorial-section h3 {
  font-size: 1.2rem;
  margin: 28px 0 12px;
  color: var(--text-main);
}

.editorial-section p {
  color: #4B5563;
  line-height: 1.8;
  margin-bottom: 16px;
}

/* FAQ Accordion */
.faq-section {
  margin-top: 50px;
}

.faq-section h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 24px;
}

.faq-item {
  border: 1px solid #E5E7EB;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  text-align: left;
  background: var(--bg-card);
  border: none;
  padding: 18px 24px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-main);
  transition: var(--transition-fast);
}

.faq-question:hover {
  background: #fafafa;
}

.faq-icon {
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--color-brand);
  transition: transform 0.3s;
}

.faq-answer {
  display: none;
  padding: 0 24px 18px;
  color: #4B5563;
  line-height: 1.7;
  background: var(--bg-card);
}

.faq-item.open .faq-answer {
  display: block;
}

.faq-item.open .faq-icon {
  transform: rotate(45deg);
}
/* ================== BURGER / MOBILE NAV ================== */
.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 8px;
  border-radius: 6px;
  transition: var(--transition-fast);
}

.burger:hover {
  background: rgba(255,255,255,0.08);
}

.burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.2s;
}

.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 900px) {
  .burger {
    display: flex;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: #111111;
    border-top: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    padding: 12px 0 20px;
    z-index: 99;
  }

  .main-nav.open {
    display: block;
  }

  .main-nav > ul {
    flex-direction: column;
    gap: 0;
  }

  .main-nav > ul > li > a {
    padding: 12px 20px;
    border-radius: 0;
  }

  .dropdown-menu {
    display: none;
    position: static;
    background: rgba(255,255,255,0.04);
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 4px 0;
  }

  .main-nav li.open .dropdown-menu {
    display: block;
  }

  /* On mobile tap the parent link to expand dropdown */
  .main-nav .has-dropdown > a::after {
    float: right;
  }

  .dropdown-menu li a {
    padding: 10px 20px 10px 36px;
  }
}

/* ================== HEADER MOBILE OVERFLOW FIX ================== */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

.site-header {
  width: 100%;
  max-width: 100vw;
  overflow: visible; /* needed for dropdown */
}

.header-inner {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.logo {
  flex-shrink: 0;
  min-width: 0;
}

.logo-img {
  max-height: 36px;
  max-width: 120px;
  width: auto;
  object-fit: contain;
}

@media (max-width: 900px) {
  .site-header {
    overflow: hidden; /* prevent nav from causing horizontal scroll */
  }

  .header-inner {
    padding: 0 16px;
  }

  .main-nav {
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-y: auto;
    max-height: calc(100vh - 64px);
  }

  .main-nav > ul > li > a {
    padding: 13px 20px;
    font-size: 1rem;
  }

  .logo-img {
    max-height: 32px;
    max-width: 100px;
  }
}
