/* ===== CSS Variables & Theme ===== */
:root {
  /* Light theme (default) */
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f7;
  --bg-card: #ffffff;
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-muted: #86868b;
  --accent: #FFBD59;
  --accent-hover: #e6a94d;
  --border: #d2d2d7;
  --shadow: rgba(0, 0, 0, 0.1);
  --overlay: rgba(0, 0, 0, 0.5);
  --header-bg: rgba(255, 255, 255, 0.8);
}

html.dark {
  --bg-primary: #0a0a0f;
  --bg-secondary: #141420;
  --bg-card: #1a1a2e;
  --text-primary: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-muted: #6e6e73;
  --accent: #FFBD59;
  --accent-hover: #ffcb7a;
  --border: #2d2d3a;
  --shadow: rgba(0, 0, 0, 0.3);
  --overlay: rgba(0, 0, 0, 0.7);
  --header-bg: rgba(10, 10, 15, 0.9);
}

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

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

html.dark {
  color-scheme: dark;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* ===== Container ===== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 768px) {
  .container {
    padding: 0 2rem;
  }
}

/* ===== Header & Navigation ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, backdrop-filter 0.3s ease, border-color 0.3s ease;
}

.header.visible {
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom-color: var(--border);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .nav {
    padding: 1rem 2rem;
  }
}

.logo {
  display: flex;
  align-items: center;
}

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

@media (min-width: 768px) {
  .logo-img {
    height: 40px;
  }
}

.nav-menu {
  display: none;
  align-items: center;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .nav-menu {
    display: flex;
  }
}

.nav-link {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--accent);
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .nav-controls {
    gap: 1.5rem;
  }
}

/* Language Selector */
.language-selector {
  display: flex;
  gap: 0.25rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 0.25rem;
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.375rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

@media (min-width: 768px) {
  .lang-btn {
    font-size: 0.8125rem;
    padding: 0.5rem 0.75rem;
  }
}

.lang-btn:hover {
  color: var(--text-primary);
}

.lang-btn.active {
  background: var(--accent);
  color: white;
}

/* Theme Toggle */
.theme-toggle {
  background: var(--bg-secondary);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.theme-toggle:hover {
  background: var(--border);
  transform: scale(1.05);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

/* Show/hide icons based on theme */
html.dark .sun-icon {
  display: block;
}

html.dark .moon-icon {
  display: none;
}

html:not(.dark) .sun-icon {
  display: none;
}

html:not(.dark) .moon-icon {
  display: block;
}

/* ===== Hero Section ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 6rem 1rem 15vh;
  overflow: hidden;
}

@media (min-width: 768px) {
  .hero {
    padding: 8rem 2rem 15vh;
  }
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  display: none;
}

.hero-content {
  text-align: center;
  max-width: 1200px;
  z-index: 1;
  padding: 0 1rem;
}

.hero-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1rem;
  color: #ffffff;
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.9), 0 2px 4px rgba(0, 0, 0, 0.8);
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 3.25rem;
    margin-bottom: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .hero-title {
    font-size: 4rem;
  }
}

.hero-subtitle {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 2rem;
  max-width: 1024px;
  margin-left: auto;
  margin-right: auto;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.9), 0 2px 4px rgba(0, 0, 0, 0.8);
}

@media (min-width: 768px) {
  .hero-subtitle {
    font-size: 1.25rem;
  }
}

/* ===== CTA Button ===== */
.cta-button {
  display: inline-block;
  background: var(--accent);
  color: white;
  font-weight: 600;
  padding: 0.875rem 2rem;
  border-radius: 50px;
  font-size: 1rem;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.cta-button:hover {
  background: var(--accent-hover);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 10px 30px var(--shadow);
}

.cta-button.secondary {
  background: var(--accent);
  border: 2px solid var(--accent);
  color: white;
}

/* ===== Section Title ===== */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 2rem;
  color: var(--text-primary);
}

@media (min-width: 768px) {
  .section-title {
    font-size: 2.25rem;
    margin-bottom: 3rem;
  }
}

/* ===== Features Section ===== */
.features {
  padding: 4rem 0;
  background: var(--bg-secondary);
}

@media (min-width: 768px) {
  .features {
    padding: 6rem 0;
  }
}

.features-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

@media (min-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature-card {
  background: var(--bg-card);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #38B6FF;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px var(--shadow);
}

.feature-image {
  aspect-ratio: 16/9;
  overflow: hidden;
}

.feature-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.feature-card:hover .feature-image img {
  transform: scale(1.05);
}

.feature-content {
  padding: 1.25rem;
}

@media (min-width: 768px) {
  .feature-content {
    padding: 1.5rem;
  }
}

.feature-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 1rem;
  color: var(--accent);
}

.feature-icon svg {
  width: 100%;
  height: 100%;
}

.feature-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

@media (min-width: 768px) {
  .feature-title {
    font-size: 1.25rem;
  }
}

.feature-description {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
  text-align: justify;
}

/* ===== CTA Section ===== */
.cta-section {
  position: relative;
  padding: 4rem 0;
  text-align: center;
  overflow: hidden;
}

@media (min-width: 768px) {
  .cta-section {
    padding: 6rem 0;
  }
}

.cta-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.cta-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center calc(50% - 100px);
}

@media (max-width: 767px) {
  .cta-bg-img {
    object-fit: cover;
    object-position: center center;
  }
}

.cta-overlay {
  position: absolute;
  inset: 0;
}

html.dark .cta-overlay {
  background: linear-gradient(to right, rgba(10, 10, 15, 0.95), rgba(10, 10, 15, 0.8));
}

html:not(.dark) .cta-overlay {
  background: linear-gradient(to right, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.75));
}

.cta-content {
  position: relative;
  z-index: 1;
}

.cta-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

@media (min-width: 768px) {
  .cta-title {
    font-size: 2.5rem;
  }
}

.cta-description {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 1.5rem;
}

@media (min-width: 768px) {
  .cta-description {
    font-size: 1.125rem;
    margin-bottom: 2rem;
  }
}

.cta-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .cta-badges {
    margin-bottom: 2rem;
  }
}

.badge {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--border);
}

.badge.badge-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.badge.badge-icon svg {
  flex-shrink: 0;
}

/* ===== FAQ Section ===== */
.faq {
  padding: 4rem 0;
  background: var(--bg-primary);
}

@media (min-width: 768px) {
  .faq {
    padding: 6rem 0;
  }
}

.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item:first-child {
  border-top: 1px solid var(--border);
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  list-style: none;
  transition: color 0.2s ease;
}

@media (min-width: 768px) {
  .faq-question {
    font-size: 1.125rem;
    padding: 1rem 0;
  }
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::after {
  content: '+';
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--accent);
  transition: transform 0.3s ease;
}

.faq-item[open] .faq-question::after {
  transform: rotate(45deg);
}

.faq-question:hover {
  color: var(--accent);
}

.faq-answer {
  padding: 1rem 0 1.5rem 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.7;
}

@media (min-width: 768px) {
  .faq-answer {
    font-size: 1rem;
    padding: 1rem 0 1.75rem 0.75rem;
  }
}

/* ===== Footer ===== */
.footer {
  background: var(--bg-secondary);
  padding: 3rem 0 1.5rem;
  border-top: 1px solid var(--border);
}

@media (min-width: 768px) {
  .footer {
    padding: 4rem 0 2rem;
  }
}

.footer-content {
  display: grid;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .footer-content {
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
  }
}

.footer-brand {
  max-width: 300px;
}

.footer-logo {
  height: 40px;
  width: auto;
  margin-bottom: 1rem;
}

.footer-tagline {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-nav a {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  transition: color 0.2s ease;
}

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

.footer-social {
  display: flex;
  gap: 1rem;
}

.footer-social a {
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

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

.footer-social svg {
  width: 24px;
  height: 24px;
}

.footer-contact a {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.footer-partners {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.partner-logo {
  height: 40px;
  width: auto;
  transition: opacity 0.2s ease;
}

/* Barcelona Sport Hub logo: show dark version by default (light theme), white version in dark theme */
.partner-logo.bsh-light {
  display: block;
}

.partner-logo.bsh-dark {
  display: none;
}

html.dark .partner-logo.bsh-light {
  display: none;
}

html.dark .partner-logo.bsh-dark {
  display: block;
}

/* Partner links hover overlay */
.footer-partners a {
  position: relative;
  display: inline-block;
}

.footer-partners a::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.1);
  opacity: 0;
  transition: opacity 0.2s ease;
  border-radius: 4px;
}

.footer-partners a:hover::after {
  opacity: 1;
}

html.dark .footer-partners a::after {
  background: rgba(255, 255, 255, 0.15);
}

.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-bottom p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ===== Smooth Transitions ===== */
.hero-overlay,
.cta-overlay,
.feature-card,
.faq-item,
.badge,
.lang-btn,
.theme-toggle {
  transition: all 0.3s ease;
}

/* ===== Accessibility ===== */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* Focus styles for accessibility */
.cta-button:focus,
.lang-btn:focus,
.theme-toggle:focus,
.faq-question:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ===== Print Styles ===== */
@media print {

  .header,
  .theme-toggle,
  .language-selector {
    display: none;
  }

  body {
    background: white;
    color: black;
  }
}