/* 
🎨 Moroccan Color Palette for a Surf & Skate Context (Tamraght Edition)

🇲🇦 Red (#D62F2C) - Blood, life, love, and resistance
    Think the clay-red hills above Tamraght, the glowing sunset behind surfboards
    Use for: Main headers, strong visual accents, buttons, calls to action

🇲🇦 Green (#006233) - Islam, nature, and blessing
    Think Argan trees in the wind, cactus paddles, surf wax, and mosaic tiles
    Use for: Backgrounds, outlines, hover effects, natural/cultural references

⚫ Black (#000000) - Earth, shadow, truth
    Think Volcanic rock, tire rubber, outlines on henna tattoos, old tagine pots
    Use for: Base text, outlines, gritty elements in skate/surf branding

🥚 Eggshell White (#f9f9f9) - Neutrality, openness, desert light
    Think Sun-bleached stone, surfboard wax, linen shirts, morning fog over dunes
    Use for: Backgrounds, padding zones, breathing space

✨ Gold (#FFD700) - Royalty, sunshine, generosity
    Think Golden hour glint on the ocean, brass trays, antique tiles in Taghazout
    Use for: Delicate highlights, icons, accent lines, hover glows
*/

:root {
  /* Core Colors */
  --color-primary: #D62F2C;    /* Moroccan Red - For action and headers */
  --color-secondary: #006233;  /* Moroccan Green - For calm accents and borders */
  --color-accent: #FFD700;     /* Moroccan Gold - For subtle highlights and warmth */
  --color-light: #f9f9f9;      /* Eggshell White - For backgrounds and clarity */
  --color-dark: #000000;       /* Black - For text and edge */
  
  /* Functional Colors */
  --color-text: var(--color-dark);
  --color-border: rgba(0, 98, 51, 0.2);  /* Semi-transparent green */
  --color-shadow: rgba(214, 47, 44, 0.1); /* Soft red shadow */
  
  /* Transitions and Effects */
  --transition: all 0.3s ease;
  --border-radius: 12px;
  --box-shadow: 0 8px 30px var(--color-shadow);
  
  /* Typography */
  --font-heading: 'Poppins', -apple-system, sans-serif;
  --font-body: 'Open Sans', -apple-system, sans-serif;

  /* Focus Styles */
  --focus-outline: 3px solid var(--color-accent);
  --focus-outline-offset: 2px;
}

/* Base Styles */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&family=Open+Sans:wght@400;500;600&display=swap');

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-light);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding: 0;
  margin: 0;
  overflow-x: hidden;
}

/* Focus Styles */
:focus {
  outline: var(--focus-outline);
  outline-offset: var(--focus-outline-offset);
}

:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: var(--focus-outline);
  outline-offset: var(--focus-outline-offset);
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary);
  color: white;
  padding: 8px;
  z-index: 100;
  transition: top 0.3s ease;
}

.skip-link:focus {
  top: 0;
}

/* Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.3;
  margin-bottom: 1.25rem;
  font-weight: 700;
  color: var(--color-dark);
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  color: white;
  margin-bottom: 1rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  letter-spacing: -1px;
}

h2 {
  font-size: clamp(2rem, 4vw, 2.5rem);
  color: var(--color-dark);
  margin: 3rem 0 1.5rem;
  position: relative;
  display: inline-block;
}

h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--color-accent);
  border-radius: 2px;
}

p {
  margin-bottom: 1.25rem;
  font-size: clamp(1rem, 1.5vw, 1.1rem);
  color: var(--color-text);
  opacity: 0.9;
}

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

/* Navigation */
.nav-links {
  display: flex;
  justify-content: center;
  list-style: none;
  padding: 1rem 0;
  background: rgba(249, 249, 249, 0.95);
  backdrop-filter: blur(10px);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px var(--color-shadow);
}

.nav-links ul {
  display: flex;
  align-items: center;
  gap: 1rem;
  list-style: none;
  padding: 0 1rem;
  margin: 0;
  flex-wrap: nowrap;
}

.nav-links a {
  color: var(--color-dark);
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  border-radius: 50px;
  transition: var(--transition);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a:focus {
  color: var(--color-primary);
  background: rgba(214, 47, 44, 0.1);
}

.nav-links .lang-selector {
  margin-left: 0.5rem;
}

.nav-links .lang-selector select {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-dark);
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  min-width: 80px;
}

.nav-links .lang-selector select:hover,
.nav-links .lang-selector select:focus {
  border-color: var(--color-primary);
}

.nav-links .lang-selector select:focus {
  outline: var(--focus-outline);
  outline-offset: var(--focus-outline-offset);
}

.nav-links .lang-selector select option {
  background: var(--color-light);
  color: var(--color-dark);
}

/* Hero Section */
.hero {
  height: 100vh;
  background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)),
  url('images/live-background.gif');
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 2rem;
  margin-top: 0;
}

.hero-content {
  max-width: 800px;
}

.tagline {
  font-size: 1.8rem;
  color: white;
  margin-bottom: 2rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Features Section */
.features {
  padding: 6rem 0;
  background: linear-gradient(135deg, var(--color-light) 0%, #f0f0f0 100%);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.feature-card {
  background: var(--color-light);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  text-align: center;
  transition: var(--transition);
  border: 1px solid var(--color-border);
}

.feature-card:hover {
  transform: translateY(-5px);
  border-color: var(--color-accent);
}

.feature-card i {
  font-size: 2.5rem;
  color: var(--color-primary);
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

/* Language Section */
.language-section {
  padding: 6rem 0;
  background: white;
}

.categories-container {
  display: grid;
  gap: 2rem;
  margin-top: 3rem;
}

.category-card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  overflow: hidden;
}

.category-header {
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--color-primary), #b32424);
  color: white;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.category-header h3 {
  color: white;
  margin: 0;
}

.toggle-icon {
  font-size: 1.5rem;
  transition: var(--transition);
}

.category-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-content.open {
  max-height: none;
}

.translation-list {
  padding: 1.5rem;
}

.translation-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--color-border);
  transition: var(--transition);
}

.translation-item:hover {
  background: rgba(0, 163, 255, 0.05);
}

.translation-text {
  font-size: 1.1rem;
}

.script {
  font-family: 'Noto Naskh Arabic', serif;
  font-size: 1.2rem;
  margin-left: 0.5rem;
}

/* Experience Section */
.experience {
  padding: 6rem 0;
  background: linear-gradient(135deg, #f6f9fc 0%, #eef2f7 100%);
}

.experience-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.experience-card {
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
}

.experience-card:hover {
  transform: translateY(-5px);
}

.experience-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.experience-card h3 {
  padding: 1.5rem 1.5rem 0.5rem;
  font-size: 1.5rem;
}

.experience-card p {
  padding: 0 1.5rem 1.5rem;
}

/* Booking CTA */
.booking-cta {
  padding: 6rem 0;
  background: linear-gradient(135deg, var(--color-primary), #0088cc);
  color: white;
  text-align: center;
}

.booking-cta h2 {
  color: white;
  margin-bottom: 1.5rem;
}

.booking-cta h2::after {
  background: var(--color-accent);
  left: 50%;
  transform: translateX(-50%);
}

.booking-cta p {
  color: white;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 2rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  text-align: center;
}

.btn:focus {
  outline: var(--focus-outline);
  outline-offset: var(--focus-outline-offset);
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-light);
}

.btn-primary:hover,
.btn-primary:focus {
  background: #b71c1c;
  transform: translateY(-2px);
}

.btn-listen {
  background: var(--color-primary);
  color: var(--color-light);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1.6rem;
}

.btn-listen:hover,
.btn-listen:focus {
  background: #b71c1c;
  transform: scale(1.1);
}

.btn-listen:focus {
  outline: var(--focus-outline);
  outline-offset: var(--focus-outline-offset);
}

.btn-listen.playing {
  background: #b71c1c;
}

/* Footer */
footer {
  background: var(--color-secondary);
  color: var(--color-light);
  padding: 3rem 0;
  text-align: center;
}

footer p {
  color: white;
  opacity: 0.8;
}

.social-links {
  margin-top: 1.5rem;
}

.social-links a {
  color: var(--color-light);
  font-size: 1.5rem;
  margin: 0 0.5rem;
  opacity: 0.8;
  transition: var(--transition);
}

.social-links a:hover {
  color: var(--color-accent);
  transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
  .nav-links ul {
    gap: 0.5rem;
    padding: 0 0.5rem;
  }

  .nav-links a {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
  }

  .nav-links .lang-selector select {
    padding: 0.3rem 0.4rem;
    font-size: 0.8rem;
    min-width: 70px;
  }

  .feature-grid,
  .experience-grid {
    grid-template-columns: 1fr;
  }

  .container {
    padding: 0 1rem;
  }
}

@media (max-width: 480px) {
  .nav-links {
    padding: 0.5rem 0;
  }

  .nav-links ul {
    gap: 0.25rem;
    padding: 0 0.25rem;
  }

  .nav-links a {
    font-size: 0.75rem;
    padding: 0.3rem 0.5rem;
  }

  .nav-links .lang-selector select {
    padding: 0.25rem 0.3rem;
    font-size: 0.75rem;
    min-width: 65px;
  }

  .btn {
    width: auto;
    max-width: 90vw;
    font-size: 1rem;
    padding: 0.7rem 1.2rem;
    min-width: 0;
    display: inline-block;
  }
  .btn-primary {
    font-size: 1rem;
    padding: 0.7rem 1.2rem;
    min-width: 0;
    max-width: 90vw;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out forwards;
}

/* Loading States */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  animation: shimmer 1.5s infinite;
}

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

/* Swiper Styles */
.main-categories-swiper {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto 2rem auto;
}

.phrases-swiper {
  width: 100%;
  max-width: 1100px;
}

.swiper-slide {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.phrases-swiper .swiper-slide {
  align-items: stretch;
  height: auto;
}

.audio-card {
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  padding: 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  justify-content: space-between;
}

.audio-thumbnail {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 18px;
  margin-bottom: 1.5rem;
}

.phrase-main {
  font-weight: bold;
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}

.phrase-darija {
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.btn-listen {
  background: #d32f2f;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  margin-top: 1rem;
  cursor: pointer;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, transform 0.2s;
}

.btn-listen:hover {
  background-color: #b71c1c;
  transform: scale(1.05);
}

.swiper-button-next, .swiper-button-prev {
  color: #d32f2f;
  background: rgba(255, 255, 255, 0.9);
  width: 40px !important;
  height: 40px !important;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.swiper-button-next:after, .swiper-button-prev:after {
  font-size: 18px !important;
  font-weight: bold;
}

.swiper-button-next:hover, .swiper-button-prev:hover {
  background: #fff;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.swiper-button-disabled {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
}

.phrases-swiper {
  position: relative;
  padding: 0 40px;
}

.phrases-swiper .swiper-button-next {
  right: 0;
}

.phrases-swiper .swiper-button-prev {
  left: 0;
}

.category-title {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.category-desc {
  margin-bottom: 1rem;
}

.category-tabs {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #eee;
}

.category-tab {
  flex: 1;
  max-width: 200px;
  text-align: center;
  padding: 0.75rem 0;
  font-weight: bold;
  font-size: 1.1rem;
  color: #222;
  background: none;
  border: none;
  outline: none;
  cursor: pointer;
  transition: color 0.2s;
  border-bottom: 3px solid transparent;
  box-shadow: none;
}

.category-tab.active {
  color: #d32f2f;
  border-bottom: 3px solid #d32f2f;
  background: #fff;
}

.category-tab:not(.active):hover {
  color: #b71c1c;
}

.category-tab:focus {
  outline: none;
  box-shadow: none;
}

@media (max-width: 600px) {
  .audio-thumbnail {
    height: 180px;
    border-radius: 16px;
  }
}