/* ============================================
   YALLA MOBILE - SECTION STYLES
   ============================================
   
   Styles for main content sections.
   
   TABLE OF CONTENTS:
   1. Services Section
   2. How It Works Section
   3. Features Section
   4. About Section
   5. CTA Section
   6. Download Section
   7. Blog/Coming Soon Section
   8. Scroll Animations
   
   ============================================ */

/* ===========================================
   1. SERVICES SECTION
   =========================================== */

.services {
  position: relative;
  background: var(--color-bg-subtle);
}

/* Gradient overlay from hero */
.services::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: linear-gradient(
    180deg,
    var(--color-bg-base) 0%,
    transparent 100%
  );
  pointer-events: none;
}

.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  position: relative;
  z-index: 1;
}

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

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

/* Service Card */
.service-card {
  text-align: center;
  padding: var(--space-8);
}

.service-card .card-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto var(--space-5);
  font-size: var(--text-3xl);
  background: var(--gradient-primary);
  color: var(--color-text-inverse);
  border-radius: var(--radius-xl);
}

.service-card .card-icon svg {
  width: 32px;
  height: 32px;
}

.service-card .card-title {
  font-size: var(--text-lg);
  margin-bottom: var(--space-3);
}

.service-card .card-description {
  font-size: var(--text-sm);
  margin-bottom: var(--space-5);
}

.service-card .btn {
  margin-top: auto;
}

/* ===========================================
   2. HOW IT WORKS SECTION
   =========================================== */

.how-it-works {
  position: relative;
  overflow: hidden;
}

.steps-container {
  position: relative;
}

/* Connecting line between steps */
.steps-line {
  display: none;
  position: absolute;
  top: 30px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: var(--color-border-default);
}

@media (min-width: 768px) {
  .steps-line {
    display: block;
  }
}

/* Animated progress line */
.steps-line::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  background: var(--gradient-primary);
}

/* Animate when in view */
.steps-container.in-view .steps-line::before {
  animation: line-progress 2s ease-out forwards;
}

@keyframes line-progress {
  to {
    width: 100%;
  }
}

.steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  position: relative;
  z-index: 1;
}

@media (min-width: 768px) {
  .steps-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-6);
  }
}

/* Step Card */
.step-card {
  text-align: center;
  background: transparent;
  border: none;
  padding: 0;
}

.step-card:hover {
  transform: none;
  box-shadow: none;
}

.step-number {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-5);
  background: var(--gradient-primary);
  color: var(--color-text-inverse);
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--font-extrabold);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-primary);
  position: relative;
}

/* Number ring */
.step-number::after {
  content: '';
  position: absolute;
  inset: -4px;
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-full);
  opacity: 0.3;
}

.step-title {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  margin-bottom: var(--space-2);
  color: var(--color-text-primary);
}

.step-description {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: 0;
}

/* ===========================================
   3. FEATURES SECTION
   =========================================== */

.features {
  background: var(--color-bg-subtle);
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

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

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

/* Feature Card */
.feature-card {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  padding: var(--space-5);
}

.feature-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-subtle);
  border-radius: var(--radius-lg);
  color: var(--color-primary);
}

.feature-icon svg {
  width: 24px;
  height: 24px;
}

.feature-content {
  flex: 1;
  min-width: 0;
}

.feature-title {
  font-size: var(--text-base);
  font-weight: var(--font-bold);
  margin-bottom: var(--space-1);
  color: var(--color-text-primary);
}

.feature-description {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: 0;
}

/* ===========================================
   4. ABOUT SECTION
   =========================================== */

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-12);
  align-items: center;
}

@media (min-width: 1024px) {
  .about-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Content order for responsive */
.about-content {
  order: 2;
}

.about-visual {
  order: 1;
}

@media (min-width: 1024px) {
  .about-content {
    order: 1;
  }
  
  .about-visual {
    order: 2;
  }
}

/* About Image Container */
.about-image-container {
  position: relative;
  padding: var(--space-6);
}

.about-image {
  position: relative;
  background: var(--gradient-primary);
  border-radius: var(--radius-xl);
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-inverse);
  box-shadow: var(--shadow-xl);
}

.about-image svg {
  width: 80px;
  height: 80px;
  opacity: 0.9;
}

/* Decorative dashed border */
.about-image-decoration {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 2px dashed var(--color-border-default);
  border-radius: var(--radius-xl);
  top: var(--space-4);
  left: var(--space-4);
  z-index: -1;
}

[dir="rtl"] .about-image-decoration {
  left: auto;
  right: var(--space-4);
}

/* About Text */
.about-text {
  margin-bottom: var(--space-6);
}

.about-text p {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
}

/* About Values Grid */
.about-values {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

@media (max-width: 639px) {
  .about-values {
    grid-template-columns: 1fr;
  }
}

.about-value {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--color-bg-subtle);
  border-radius: var(--radius-lg);
}

.about-value-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-subtle);
  border-radius: var(--radius-md);
  color: var(--color-primary);
  flex-shrink: 0;
}

.about-value-icon svg {
  width: 20px;
  height: 20px;
}

.about-value-text {
  font-weight: var(--font-semibold);
  color: var(--color-text-primary);
}

/* ===========================================
   5. CTA SECTION
   =========================================== */

.cta {
  position: relative;
  background: var(--gradient-primary);
  color: var(--color-text-inverse);
  overflow: hidden;
}

/* Pattern overlay */
.cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.cta-container {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.cta-title {
  color: inherit;
  margin-bottom: var(--space-4);
}

.cta-description {
  font-size: var(--text-lg);
  opacity: 0.9;
  margin-bottom: var(--space-8);
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: center;
}

/* CTA Button Overrides */
.cta .btn-primary {
  background: var(--color-text-inverse);
  color: var(--color-primary);
  box-shadow: 0 4px 15px rgb(0 0 0 / 0.2);
}

.cta .btn-primary:hover {
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.3);
}

.cta .btn-outline {
  border-color: rgb(255 255 255 / 0.5);
  color: inherit;
}

.cta .btn-outline:hover {
  background: rgb(255 255 255 / 0.1);
  border-color: rgb(255 255 255 / 1);
}

@media (max-width: 639px) {
  .cta-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .cta-actions .btn {
    width: 100%;
  }
}

/* ===========================================
   6. DOWNLOAD SECTION
   =========================================== */

.download {
  background: var(--color-bg-subtle);
}

.download-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-12);
  align-items: center;
}

@media (min-width: 1024px) {
  .download-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Phone Mockup */
.download-mockup {
  display: flex;
  justify-content: center;
  perspective: 1000px;
}

.download-phone {
  position: relative;
  width: 260px;
  height: 520px;
  background: var(--color-bg-elevated);
  border-radius: 36px;
  border: 6px solid var(--color-border-emphasis);
  box-shadow: 
    0 50px 100px -20px rgb(0 0 0 / 0.2),
    0 30px 60px -30px rgb(var(--color-primary-rgb) / 0.25);
  transform: rotateY(-5deg) rotateX(5deg);
  transition: transform var(--transition-slow);
}

.download-phone:hover {
  transform: rotateY(0deg) rotateX(0deg);
}

.download-phone-notch {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 20px;
  background: var(--color-border-emphasis);
  border-radius: var(--radius-full);
}

.download-phone-screen {
  position: absolute;
  top: 40px;
  left: 6px;
  right: 6px;
  bottom: 6px;
  background: var(--gradient-primary);
  border-radius: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  color: var(--color-text-inverse);
  text-align: center;
}

.download-phone-logo {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: var(--font-extrabold);
  margin-bottom: var(--space-2);
}

.download-phone-text {
  font-size: var(--text-sm);
  opacity: 0.9;
}

/* Responsive phone */
@media (max-width: 767px) {
  .download-phone {
    width: 220px;
    height: 440px;
  }
}

/* Download Content */
.download-content .section-title {
  text-align: left;
  margin-bottom: var(--space-3);
}

.download-content .section-description {
  text-align: left;
  margin-bottom: var(--space-6);
}

[dir="rtl"] .download-content .section-title,
[dir="rtl"] .download-content .section-description {
  text-align: right;
}

/* Feature List */
.download-features {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.download-feature {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.download-feature-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-success);
  color: var(--color-text-inverse);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  flex-shrink: 0;
}

.download-feature-text {
  color: var(--color-text-secondary);
}

/* App Store Buttons */
.download-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

@media (max-width: 639px) {
  .download-buttons {
    flex-direction: column;
  }
}

.download-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-lg);
  transition: 
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
}

.download-btn:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.download-btn-icon {
  font-size: var(--text-2xl);
  color: var(--color-text-primary);
}

.download-btn-icon svg {
  width: 28px;
  height: 28px;
}

.download-btn-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

[dir="rtl"] .download-btn-text {
  text-align: right;
}

.download-btn-small {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--color-text-tertiary);
}

.download-btn-large {
  font-size: var(--text-base);
  font-weight: var(--font-bold);
  color: var(--color-text-primary);
}

/* ===========================================
   7. BLOG/COMING SOON SECTION
   =========================================== */

.blog-coming-soon {
  text-align: center;
  padding: var(--space-16) 0;
}

.coming-soon-icon {
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-6);
  background: var(--color-primary-subtle);
  border-radius: var(--radius-full);
  color: var(--color-primary);
}

.coming-soon-icon svg {
  width: 48px;
  height: 48px;
}

@media (max-width: 639px) {
  .coming-soon-icon {
    width: 80px;
    height: 80px;
  }
  
  .coming-soon-icon svg {
    width: 32px;
    height: 32px;
  }
}

.coming-soon-title {
  margin-bottom: var(--space-3);
}

.coming-soon-description {
  color: var(--color-text-secondary);
  max-width: 500px;
  margin: 0 auto var(--space-6);
}

/* Newsletter Form */
.coming-soon-form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
  max-width: 450px;
  margin: 0 auto;
}

.coming-soon-form .form-input {
  flex: 1;
  min-width: 200px;
}

@media (max-width: 639px) {
  .coming-soon-form {
    flex-direction: column;
    width: 100%;
  }
  
  .coming-soon-form .form-input,
  .coming-soon-form .btn {
    width: 100%;
  }
}

/* ===========================================
   8. SCROLL ANIMATIONS
   =========================================== */

/* Base animation state */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: 
    opacity 0.6s ease-out,
    transform 0.6s ease-out;
}

/* Animated state */
.animate-on-scroll.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered delays for grid items */
.animate-on-scroll:nth-child(1) { transition-delay: 0.1s; }
.animate-on-scroll:nth-child(2) { transition-delay: 0.2s; }
.animate-on-scroll:nth-child(3) { transition-delay: 0.3s; }
.animate-on-scroll:nth-child(4) { transition-delay: 0.4s; }
.animate-on-scroll:nth-child(5) { transition-delay: 0.5s; }
.animate-on-scroll:nth-child(6) { transition-delay: 0.6s; }