/* ==========================================================================
   Design System & Styling variables
   ========================================================================== */
:root {
  --accent: #d4af37; /* Soft gold for badges / highlights */
  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Medrus Theme (TR - Green) */
body, body.theme-medrus {
  --primary: #20794e;
  --primary-rgb: 32, 121, 78;
  --primary-light: #2fa36b;
  --primary-dark: #144e32;
  --bg-dark: #07110c; /* Deep rich forest black */
  --bg-dark-secondary: #0b1a13;
  --text-light: #f5f8f6;
  --text-muted: #8fa89b;
  --text-dark: #122119;
  --glass-bg: rgba(11, 26, 19, 0.5);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(47, 163, 107, 0.3);
  --bg-radial: radial-gradient(circle at 80% 20%, rgba(32, 121, 78, 0.15) 0%, transparent 50%);
}

/* Madrus Theme (EN - Blue) */
body.theme-madrus {
  --primary: #204e79;
  --primary-rgb: 32, 78, 121;
  --primary-light: #2f6ba3;
  --primary-dark: #14324e;
  --bg-dark: #070d11; /* Deep rich blue black */
  --bg-dark-secondary: #0b141a;
  --text-light: #f5f7f8;
  --text-muted: #8f9fa8;
  --text-dark: #121921;
  --glass-bg: rgba(11, 20, 26, 0.5);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(47, 107, 163, 0.3);
  --bg-radial: radial-gradient(circle at 80% 20%, rgba(32, 78, 121, 0.15) 0%, transparent 50%);
}

/* ==========================================================================
   Base resets
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-light);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ==========================================================================
   Navigation Bar
   ========================================================================== */
header {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background-color: rgba(7, 17, 12, 0.8);
  border-bottom: 1px solid var(--glass-border);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  transition: var(--transition-smooth);
}

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

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-logo {
  height: 40px;
  width: auto;
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ffffff 0%, var(--primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

nav ul {
  display: flex;
  gap: 2rem;
  list-style: none;
}

nav a {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

nav a:hover {
  color: #ffffff;
  text-shadow: 0 0 10px rgba(255,255,255,0.2);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 0.35rem 0.75rem;
  border-radius: 50px;
}

.lang-switch button {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.lang-switch button:hover {
  color: #ffffff;
}

.lang-switch button.active-lang {
  color: var(--primary-light);
  text-shadow: 0 0 10px rgba(var(--primary-rgb), 0.4);
}

.lang-switch .divider {
  color: var(--glass-border);
  font-size: 0.8rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.5);
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
}

.nav-download-btn {
  padding: 0.5rem 1.25rem;
  font-size: 0.9rem;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  padding: 10rem 2rem 5rem 2rem;
  position: relative;
  background: var(--bg-radial);
}

.hero-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  gap: 4rem;
}

.hero-content {
  flex: 1;
  max-width: 600px;
}

.app-badges {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
}

.badge-tr {
  color: var(--primary-light);
  border-color: rgba(47, 163, 107, 0.2);
}

.badge-en {
  color: var(--accent);
  border-color: rgba(212, 175, 55, 0.2);
}

.hero-content h1 {
  font-size: 3.25rem;
  margin-bottom: 1.5rem;
  line-height: 1.15;
  background: linear-gradient(135deg, #ffffff 0%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-content p {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

.download-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.store-button {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background-color: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  transition: var(--transition-smooth);
}

.store-button:hover {
  border-color: var(--glass-border-hover);
  background-color: rgba(var(--primary-rgb), 0.08);
  transform: translateY(-2px);
}

.store-button i {
  font-size: 1.75rem;
}

.store-text {
  display: flex;
  flex-direction: column;
}

.store-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.store-name {
  font-size: 1rem;
  font-weight: 700;
}

.hero-visual {
  flex: 1;
  display: flex;
  justify-content: center;
  position: relative;
}

.glowing-backdrop {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(var(--primary-rgb), 0.2) 0%, transparent 70%);
  filter: blur(40px);
  z-index: 1;
  pointer-events: none;
}

.hero-mockup-img {
  width: 100%;
  max-width: 420px;
  z-index: 2;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.5));
  animation: floatApp 6s ease-in-out infinite;
}

@keyframes floatApp {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* ==========================================================================
   Stats Section
   ========================================================================== */
.stats-section {
  padding: 3rem 2rem;
  background-color: var(--bg-dark-secondary);
}

.stats-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 1000px;
  margin: 0 auto;
  gap: 2rem;
  text-align: center;
}

.stat-card {
  padding: 1.5rem;
}

.stat-number {
  font-size: 3rem;
  color: var(--primary-light);
  margin-bottom: 0.5rem;
}

.stat-label {
  font-weight: 500;
  color: var(--text-muted);
}

/* ==========================================================================
   Features Section
   ========================================================================== */
.features-section {
  padding: 7rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 5rem;
}

.section-header h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.section-header p {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2.5rem;
}

.feature-card {
  background-color: var(--bg-dark-secondary);
  border: 1px solid var(--glass-border);
  padding: 2.5rem;
  border-radius: 16px;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
  opacity: 0;
  transition: var(--transition-smooth);
}

.feature-card:hover {
  transform: translateY(-5px);
  border-color: var(--glass-border-hover);
  box-shadow: 0 10px 30px rgba(var(--primary-rgb), 0.05);
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-icon {
  font-size: 2rem;
  color: var(--primary-light);
  margin-bottom: 1.5rem;
}

.feature-card h3 {
  font-size: 1.35rem;
  margin-bottom: 1rem;
  color: #ffffff;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ==========================================================================
   Podcasts Section
   ========================================================================== */
.podcasts-section {
  padding: 7rem 2rem;
  background: radial-gradient(circle at 10% 80%, rgba(var(--primary-rgb), 0.1) 0%, transparent 60%);
  background-color: var(--bg-dark-secondary);
}

.podcasts-container {
  display: flex;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  gap: 5rem;
}

.podcasts-visual {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  min-height: 350px;
}

.main-podcast-icon {
  font-size: 7rem;
  color: var(--primary-light);
  z-index: 2;
  filter: drop-shadow(0 0 30px rgba(var(--primary-rgb), 0.3));
}

.podcast-wave-animation {
  display: flex;
  align-items: center;
  gap: 15px;
  position: absolute;
  z-index: 1;
}

.podcast-wave-animation .bar {
  width: 10px;
  height: 50px;
  background-color: rgba(var(--primary-rgb), 0.15);
  border-radius: 5px;
  animation: pulseWave 1.5s ease-in-out infinite alternate;
}

.podcast-wave-animation .bar:nth-child(2) { animation-delay: 0.2s; height: 80px; }
.podcast-wave-animation .bar:nth-child(3) { animation-delay: 0.4s; height: 110px; }
.podcast-wave-animation .bar:nth-child(4) { animation-delay: 0.6s; height: 80px; }
.podcast-wave-animation .bar:nth-child(5) { animation-delay: 0.8s; height: 50px; }

@keyframes pulseWave {
  0% { transform: scaleY(0.4); }
  100% { transform: scaleY(1); }
}

.podcasts-content {
  flex: 1.2;
}

.podcasts-content h2 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
}

.podcasts-content p {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.podcast-benefits {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.podcast-benefits li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
}

.podcast-benefits i {
  color: var(--primary-light);
  font-size: 1.25rem;
}

/* ==========================================================================
   Screenshots Section & Device Simulator
   ========================================================================== */
.screenshots-section {
  padding: 7rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.carousel-wrapper {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  overflow: hidden;
  padding: 2rem 0;
}

.carousel-container {
  display: flex;
  transition: transform 0.5s ease-in-out;
  gap: 2rem;
}

.carousel-slide {
  min-width: calc(33.333% - 1.33rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

/* Simulation of app screens instead of using images */
.mock-device {
  width: 250px;
  height: 480px;
  background-color: #1a1a1a;
  border-radius: 36px;
  border: 10px solid #333333;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  padding: 10px;
  position: relative;
  overflow: hidden;
}

.mock-screen {
  width: 100%;
  height: 100%;
  background-color: #000;
  border-radius: 20px;
  overflow: hidden;
  padding: 0;
}

.app-screenshot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mock-header {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-dark);
  text-align: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 0.5rem;
}

.mock-text-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mock-text-item {
  background-color: #ffffff;
  padding: 0.75rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  font-size: 0.8rem;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mock-text-item.active {
  border-left: 4px solid var(--primary);
  color: var(--primary);
}

.mock-text-item i {
  font-size: 0.75rem;
}

.reading-mode {
  background-color: #faf6f0;
  justify-content: space-between;
}

.mock-arabic {
  font-family: Arial, sans-serif;
  font-size: 1.35rem;
  text-align: right;
  line-height: 2;
  margin-top: 2rem;
}

.mock-translation {
  font-size: 0.85rem;
  color: #666;
  border-top: 1px solid #e5dec9;
  padding-top: 0.75rem;
  margin-bottom: 2rem;
}

.mock-action-bar {
  display: flex;
  justify-content: space-around;
  border-top: 1px solid #e5dec9;
  padding-top: 0.75rem;
  color: var(--primary);
}

.mock-grammar-item {
  background-color: #ffffff;
  padding: 0.75rem;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  border-left: 3px solid var(--accent);
}

.carousel-slide h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffffff;
}

.carousel-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin-top: 3rem;
}

.carousel-nav button {
  background-color: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: #ffffff;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.carousel-nav button:hover {
  border-color: var(--glass-border-hover);
  background-color: rgba(32, 121, 78, 0.1);
  color: var(--primary-light);
}

.carousel-dots {
  display: flex;
  gap: 0.5rem;
}

.carousel-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--glass-border);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.carousel-dots span.active {
  background-color: var(--primary-light);
  width: 20px;
  border-radius: 10px;
}

/* ==========================================================================
   FAQ Section
   ========================================================================== */
.faq-section {
  padding: 7rem 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.faq-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.faq-item {
  background-color: var(--bg-dark-secondary);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.faq-item:hover {
  border-color: var(--glass-border-hover);
}

.faq-question {
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
  font-size: 1.1rem;
}

.faq-question i {
  color: var(--primary-light);
  transition: transform 0.3s ease;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
  padding: 0 1.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.faq-item.open .faq-answer {
  max-height: 500px;
  padding-bottom: 1.5rem;
  transition: max-height 0.3s cubic-bezier(0.5, 0, 1, 0.5);
}

.faq-item.open .faq-question i {
  transform: rotate(180deg);
}

/* ==========================================================================
   Download Promo Section
   ========================================================================== */
.download-section {
  padding: 8rem 2rem;
  text-align: center;
  background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-dark-secondary) 100%);
  border-top: 1px solid var(--glass-border);
}

.download-container {
  max-width: 600px;
  margin: 0 auto;
}

.download-container h2 {
  font-size: 2.75rem;
  margin-bottom: 1.25rem;
}

.download-container p {
  color: var(--text-muted);
  font-size: 1.15rem;
  margin-bottom: 3rem;
}

.center-buttons {
  justify-content: center;
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
  background-color: #040a07;
  border-top: 1px solid var(--glass-border);
  padding: 4rem 2rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
}

.footer-logo {
  height: 35px;
  width: auto;
}

.footer-links {
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  color: var(--text-muted);
  font-weight: 500;
  transition: var(--transition-smooth);
}

.footer-links a:hover {
  color: #ffffff;
}

.copyright {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   Media Queries & Responsiveness
   ========================================================================== */
@media (max-width: 968px) {
  .hero-container {
    flex-direction: column;
    text-align: center;
    gap: 3rem;
  }
  
  .hero-content h1 {
    font-size: 2.5rem;
  }

  .download-buttons {
    justify-content: center;
  }

  .podcasts-container {
    flex-direction: column;
    gap: 3rem;
  }

  .carousel-slide {
    min-width: calc(50% - 1rem);
  }
}

@media (max-width: 600px) {
  header {
    padding: 0.5rem 0;
  }
  .nav-container {
    padding: 1rem;
  }
  nav {
    display: none; /* Hide top links in mobile, keeping it simple for landing page */
  }

  .stats-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .carousel-slide {
    min-width: 100%;
  }

  .footer-links {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
}

/* ==========================================================================
   Lightbox Image Modal
   ========================================================================== */
.lightbox {
  display: none;
  position: fixed;
  z-index: 2000;
  padding-top: 50px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(7, 17, 12, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  justify-content: center;
  align-items: center;
}

.lightbox-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 85vh;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: zoomLightbox 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes zoomLightbox {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #fff;
  font-size: 40px;
  font-weight: 300;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.lightbox-close:hover {
  color: var(--primary-light);
  transform: rotate(90deg);
}

.lightbox-prev,
.lightbox-next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  width: auto;
  padding: 16px;
  margin-top: -50px;
  color: white;
  font-weight: bold;
  font-size: 30px;
  transition: var(--transition-smooth);
  user-select: none;
  z-index: 2010;
}

.lightbox-prev {
  left: 30px;
  border-radius: 0 3px 3px 0;
}

.lightbox-next {
  right: 30px;
  border-radius: 3px 0 0 3px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  color: var(--primary-light);
  transform: scale(1.1);
}
