/* ============================================
   PlaySwissWin - Main Stylesheet
   Premium Swiss Style - Dark Theme
   ============================================ */

/* Import Bulma CSS Framework */
@import url('https://cdn.jsdelivr.net/npm/bulma@0.9.4/css/bulma.min.css');

/* Import Google Fonts (Inter + Outfit for headers) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Outfit:wght@500;700;800&display=swap');

/* ============================================
   CSS Variables - Color System
   ============================================ */
:root {
  /* Background Colors - Solid, No Gradients */
  --bg-primary: #121212;
  /* Main Background */
  --bg-secondary: #1E1E1E;
  /* Card/Section Background */
  --bg-tertiary: #2C2C2C;
  /* Inputs/Secondary Elements */
  --bg-darker: #050505;
  /* Footer/Header/Deep Contrast */
  --overlay-dark: rgba(0, 0, 0, 0.7);

  /* Accent Colors - Swiss Red */
  --accent-primary: #DA291C;
  /* Official Swiss Red */
  --accent-hover: #F03525;
  --accent-muted: #8E1B12;

  /* Text Colors */
  --text-primary: #FFFFFF;
  --text-secondary: #E0E0E0;
  --text-muted: #B0B0B0;

  /* Border & Divider */
  --border-color: #333333;
  --divider-color: #444444;

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 5rem;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-smooth: 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

/* ============================================
   Base Styles
   ============================================ */
html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-primary);
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

/* Force White Text for Headings */
h1,
h2,
h3,
h4,
h5,
h6,
.title {
  font-family: 'Outfit', sans-serif;
  color: var(--text-primary) !important;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: var(--spacing-sm);
}

p,
.subtitle {
  color: var(--text-secondary) !important;
  margin-bottom: var(--spacing-sm);
}

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

/* ============================================
   Navigation
   ============================================ */
.navbar {
  background-color: var(--bg-darker);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
}

.navbar-item {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
}

.navbar-item:hover,
.navbar-item:focus {
  background-color: transparent !important;
  color: var(--accent-primary) !important;
}

.navbar-burger {
  color: var(--text-primary);
}

/* Mobile Menu Fix */
@media screen and (max-width: 1023px) {
  .navbar-menu {
    background-color: var(--bg-secondary);
    padding: 1rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
  }

  .navbar-item {
    color: var(--text-primary);
  }

  .navbar-item:hover {
    background-color: var(--bg-tertiary) !important;
  }
}

/* ============================================
   Hero Section - Premium & Balanced
   ============================================ */
.hero {
  background-color: var(--bg-primary);
  position: relative;
  min-height: 80vh;
  /* Taller on desktop */
  display: flex;
  align-items: center;
}

.hero.has-background {
  background-image: url('../images/hero-bg.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Stronger Overlay for Readability */
.hero.has-background::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(0deg, rgba(18, 18, 18, 1) 0%, rgba(18, 18, 18, 0.7) 100%);
  z-index: 1;
}

.hero-body {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 4rem 1.5rem;
}

.hero-content-wrapper {
  max-width: 900px;
  margin: 0 auto;
}

.hero .title {
  color: var(--text-primary) !important;
  font-size: 4rem;
  /* Desktop Scale */
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

.hero .subtitle {
  color: var(--text-secondary) !important;
  font-size: 1.35rem;
  font-weight: 400;
  margin-bottom: 2.5rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  opacity: 1;
}

/* ============================================
   Buttons
   ============================================ */
.button {
  height: 3.5rem;
  padding: 0 2.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.02em;
  transition: all var(--transition-fast);
  border: none;
}

.button.is-primary {
  background-color: var(--accent-primary);
  color: white !important;
  box-shadow: 0 4px 15px rgba(218, 41, 28, 0.4);
}

.button.is-primary:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(218, 41, 28, 0.5);
  color: white !important;
}

.button.is-outlined {
  background: transparent;
  border: 2px solid var(--text-secondary);
  color: var(--text-secondary) !important;
}

.button.is-outlined:hover {
  border-color: var(--text-primary);
  color: var(--text-primary) !important;
  background: rgba(255, 255, 255, 0.05);
}

/* ============================================
   Game Cards System (CSS Grid)
   ============================================ */
.games-grid {
  display: grid;
  width: 100%;
  gap: 1.5rem;
  /* Default Mobile: 1 column slightly wide, or 2 if space permits */
  grid-template-columns: repeat(2, 1fr);
}

/* Tablet (Portrait/Small Landscape) */
@media (min-width: 600px) {
  .games-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

/* Tablet Landscape / Small Desktop */
@media (min-width: 900px) {
  .games-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }
}

/* Standard Desktop */
@media (min-width: 1200px) {
  .games-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
  }
}

/* 4K / Large Screens */
@media (min-width: 1600px) {
  .games-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 2.5rem;
  }
}

/* Card Component */
.game-card {
  position: relative;
  background-color: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), border-color var(--transition-smooth);
  display: flex;
  flex-direction: column;
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  border-color: var(--accent-muted);
}

.game-card-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  /* Consistent aspect ratio */
  overflow: hidden;
  background-color: var(--bg-tertiary);
  /* Placeholder color */
}

.game-card-image-wrapper img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-smooth), filter var(--transition-smooth);
}

/* Default State: No overlay, clear image */
.game-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-smooth);
  backdrop-filter: blur(2px);
}

.play-btn {
  transform: translateY(10px);
  opacity: 0;
  transition: all var(--transition-smooth);
  pointer-events: none;
  /* Let clicks pass through if needed, but 'a' inside handles it */
  font-size: 0.9rem;
  padding: 0 1.5rem;
  height: 2.75rem;
}

/* Hover State */
.game-card:hover .game-card-overlay,
.game-card-image-wrapper:hover .game-card-overlay,
.game-card:active .game-card-overlay {
  opacity: 1;
}

.game-card:hover img,
.game-card-image-wrapper:hover img,
.game-card:active img {
  transform: scale(1.08);
  filter: brightness(0.7);
}

.game-card:hover .play-btn,
.game-card-image-wrapper:hover .play-btn,
.game-card:active .play-btn {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.game-card-footer {
  padding: 1rem;
  text-align: center;
  background-color: var(--bg-secondary);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-card-title {
  color: var(--text-primary) !important;
  font-family: 'Outfit', sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

/* ============================================
   Sections & Utilities
   ============================================ */
.section {
  padding: var(--spacing-xl) 1.5rem;
}

.section.is-dark {
  background-color: var(--bg-primary);
}

.section.is-darker {
  background-color: var(--bg-secondary);
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 3.5rem;
  display: inline-block;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-primary) !important;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background-color: var(--accent-primary);
  margin: 1rem auto 0;
  border-radius: 2px;
}

/* Feature Icons */
.feature-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--accent-primary) !important;
  display: block;
  line-height: 1;
}

.feature-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

/* Quotes */
.quote-card {
  background: var(--bg-tertiary);
  padding: 2rem;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--accent-primary);
  height: 100%;
}

/* Content Pages */
.page-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
}

.page-container {
  max-width: 900px;
  margin: 0 auto;
}

.page-meta {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.page-actions {
  margin-top: 2.5rem;
  text-align: center;
}

.page-lead {
  text-align: center;
  margin-bottom: 1.75rem;
}

/* Comparison */
.comparison-columns {
  gap: 1.5rem;
}

.comparison-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
}

.comparison-heading {
  margin: 0 0 0.5rem 0;
}

.comparison-subtitle {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.comparison-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.9rem;
}

.comparison-item {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.85rem;
}

.comparison-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
}

.comparison-icon svg {
  width: 18px;
  height: 18px;
}

.comparison-icon.is-positive svg {
  stroke: #23d160;
}

.comparison-icon.is-negative svg {
  stroke: var(--accent-primary);
}

.comparison-text {
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Footer */
.footer {
  padding: 5rem 1.5rem;
  background-color: var(--bg-darker);
  border-top: 1px solid var(--border-color);
}

/* ============================================
   Modals (Dark Theme Fix)
   ============================================ */
.modal-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

.modal-card-head {
  background-color: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
}

.modal-card-foot {
  background-color: var(--bg-tertiary);
  border-top: 1px solid var(--border-color);
}

.modal-card-body {
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
}

.modal-card-title {
  color: var(--text-primary) !important;
}

/* ============================================
   Internal Game Pages
   ============================================ */
.game-container {
  background: black;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.game-iframe {
  width: 100%;
  height: 600px;
  border: none;
}

.game-controls {
  padding: 1rem;
  background: var(--bg-tertiary);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

/* ============================================
   Mobile Adjustments
   ============================================ */
@media screen and (max-width: 768px) {
  .hero {
    min-height: 70vh;
  }

  .hero .title {
    font-size: 2.5rem;
  }

  .hero .subtitle {
    font-size: 1.125rem;
  }

  .games-grid {
    grid-template-columns: repeat(1, 1fr);
    /* 1 Card per row on narrow mobile */
    gap: 1.25rem;
  }

  /* On larger phones, maybe 2 per row */
  @media (min-width: 480px) {
    .games-grid {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  /* Make sure buttons are tap-friendly */
  .button {
    height: 3.5rem;
  }

  .section {
    padding: 3rem 1.25rem;
  }

  .section-title {
    font-size: 2rem;
    margin-bottom: 2.5rem;
  }

  .comparison-card {
    padding: 1.75rem;
  }

  .page-card {
    padding: 1.75rem;
  }

  .comparison-item {
    grid-template-columns: auto 1fr;
    gap: 0.75rem;
  }

  .game-iframe {
    height: 350px;
  }
}
