/* ==========================================================================
   Sarva Website - Main Stylesheet
   Version: 2.0 - Modern SaaS Design

   Design System:
   - Primary Color: #8E24AA (Purple - matches app theme)
   - Text Primary: #1a1a1a
   - Text Secondary: #555555
   - Background: #ffffff
   - Section Alt: #f9fafb
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Variables
   -------------------------------------------------------------------------- */
:root {
  /* Colors */
  --color-primary: #8E24AA;
  --color-primary-dark: #6a1b80;
  --color-primary-light: #e1bee7;
  --color-text: #1a1a1a;
  --color-text-secondary: #555555;
  --color-text-muted: #888888;
  --color-background: #ffffff;
  --color-background-alt: #f9fafb;
  --color-border: #e5e7eb;
  --color-card-shadow: rgba(0, 0, 0, 0.08);

  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-size-base: 16px;
  --font-size-sm: 0.875rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --line-height-base: 1.6;
  --line-height-tight: 1.3;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Layout */
  --max-width: 1200px;
  --max-width-narrow: 800px;
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
  --border-radius-xl: 24px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

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

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  font-size: 1rem;
  line-height: var(--line-height-base);
  color: var(--color-text);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

a:hover {
  color: var(--color-primary-dark);
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-weight: 600;
  line-height: var(--line-height-tight);
  color: var(--color-text);
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
}

h3 {
  font-size: clamp(1.125rem, 3vw, 1.5rem);
}

p {
  margin-bottom: var(--space-4);
}

p:last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container--narrow {
  max-width: 720px;
}

.section {
  padding: var(--space-12) 0;
}

.section--alt {
  background-color: var(--color-background-alt);
}

.section--hero {
  padding: var(--space-10) 0 var(--space-12);
  max-height: 400px;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.header {
  background-color: var(--color-primary);
  border-bottom: none;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header > .container {
  max-width: none;
}

.header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  height: 40px;
  max-width: 140px;
  overflow: hidden;
  text-decoration: none;
}

.logo:hover {
  opacity: 0.9;
}

.logo__image {
  height: 40px;
  max-height: 40px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.nav__link {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav__link:hover {
  color: var(--color-background);
}

/* Language Switcher */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: var(--space-4);
  padding-left: var(--space-4);
  border-left: 1px solid rgba(255, 255, 255, 0.3);
}

.lang-switcher__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-1) var(--space-2);
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  border-radius: 4px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.lang-switcher__link:hover {
  color: var(--color-background);
  background-color: rgba(255, 255, 255, 0.1);
}

.lang-switcher__link--active {
  color: var(--color-background);
  background-color: rgba(255, 255, 255, 0.2);
}

/* --------------------------------------------------------------------------
   Mobile Navigation (Hamburger Menu)
   -------------------------------------------------------------------------- */

/* Hamburger button - hidden on desktop */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 200;
}

.nav-toggle__bar {
  display: block;
  width: 24px;
  height: 2px;
  background-color: #ffffff;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle__bar + .nav-toggle__bar {
  margin-top: 6px;
}

/* Hamburger animation when open */
.nav-toggle--open .nav-toggle__bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle--open .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle--open .nav-toggle__bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Mobile menu overlay */
.nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 90;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nav-overlay--visible {
  display: block;
  opacity: 1;
}

/* Mobile styles */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100vh;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background-color: var(--color-primary);
    padding: 80px var(--space-6) var(--space-6);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    transition: right 0.3s ease;
    z-index: 150;
    overflow-y: auto;
  }

  .nav--open {
    right: 0;
  }

  .nav__link {
    display: block;
    padding: var(--space-4) 0;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  }

  .nav__link:last-of-type {
    border-bottom: none;
  }

  .lang-switcher {
    margin: var(--space-6) 0 0 0;
    padding: var(--space-4) 0 0 0;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    justify-content: center;
    gap: var(--space-2);
  }

  .lang-switcher__link {
    padding: var(--space-2) var(--space-3);
    font-size: 0.875rem;
  }

  /* Prevent body scroll when menu is open */
  body.nav-open {
    overflow: hidden;
  }
}


/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */
.hero {
  text-align: center;
  max-width: 840px;
  margin: 0 auto;
}

.hero__title {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  margin-bottom: var(--space-3);
}

.hero__title-accent {
  color: var(--color-primary);
}

.hero__subtitle {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-6);
  line-height: 1.55;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  background-color: var(--color-primary);
  color: var(--color-background);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--border-radius-sm);
  transition: background-color 0.2s ease;
}

.hero__cta:hover {
  background-color: var(--color-primary-dark);
  color: var(--color-background);
}

/* --------------------------------------------------------------------------
   Section Headers
   -------------------------------------------------------------------------- */
.section__header {
  text-align: center;
  margin-bottom: var(--space-8);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.section__title {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  margin-bottom: var(--space-2);
}

.section__subtitle {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Screenshot Grid
   -------------------------------------------------------------------------- */
.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(3, 220px);
  gap: var(--space-6);
  justify-content: center;
  max-width: 820px;
  margin: 0 auto;
}

.screenshot-card {
  width: 220px;
  background-color: var(--color-background);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.screenshot-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.screenshot-card__image {
  width: 220px;
  max-width: 220px;
  height: 440px;
  max-height: 440px;
  object-fit: cover;
  object-position: top;
  background-color: var(--color-background-alt);
}

/* Image placeholder styling */
.screenshot-card__image--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 220px;
  height: 440px;
  background: linear-gradient(135deg, var(--color-background-alt) 0%, var(--color-border) 100%);
  color: var(--color-text-muted);
  font-size: 0.75rem;
  text-align: center;
  padding: var(--space-2);
}

.screenshot-card__label {
  padding: var(--space-2) var(--space-3);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  background-color: var(--color-background);
  border-top: 1px solid var(--color-border);
}

/* Responsive: 2 columns on tablet */
@media (max-width: 820px) {
  .screenshot-grid {
    grid-template-columns: repeat(2, 180px);
    gap: var(--space-4);
  }

  .screenshot-card {
    width: 180px;
  }

  .screenshot-card__image,
  .screenshot-card__image--placeholder {
    width: 180px;
    height: 360px;
  }

  .screenshot-grid .screenshot-card:last-child {
    grid-column: span 2;
    justify-self: center;
  }
}

/* Responsive: 1 column on mobile */
@media (max-width: 420px) {
  .screenshot-grid {
    grid-template-columns: 160px;
  }

  .screenshot-card {
    width: 160px;
  }

  .screenshot-card__image,
  .screenshot-card__image--placeholder {
    width: 160px;
    height: 320px;
  }

  .screenshot-grid .screenshot-card:last-child {
    grid-column: span 1;
  }
}

/* --------------------------------------------------------------------------
   Features Section (compact version)
   -------------------------------------------------------------------------- */
.features-row {
  display: grid;
  grid-template-columns: repeat(3, 200px);
  gap: var(--space-5);
  justify-content: center;
  max-width: 720px;
  margin: 0 auto;
}

.feature-item {
  text-align: center;
  padding: var(--space-4);
  background-color: var(--color-background);
  border-radius: var(--border-radius-md);
  border: 1px solid var(--color-border);
}

.feature-item__icon {
  width: 40px;
  height: 40px;
  margin: 0 auto var(--space-3);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-primary-light);
  border-radius: 50%;
  font-size: 1.25rem;
}

.feature-item__title {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.feature-item__description {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin: 0;
  line-height: 1.4;
}

@media (max-width: 620px) {
  .features-row {
    grid-template-columns: repeat(3, 1fr);
    max-width: 400px;
  }

  .feature-item {
    padding: var(--space-3);
  }

  .feature-item__icon {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .feature-item__title {
    font-size: 0.875rem;
  }

  .feature-item__description {
    font-size: 0.75rem;
  }
}

/* --------------------------------------------------------------------------
   Download Section
   -------------------------------------------------------------------------- */
.download {
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
}

.download__badges {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-6);
  flex-wrap: wrap;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  height: 44px;
  padding: var(--space-2) var(--space-4);
  background-color: var(--color-text);
  color: var(--color-background);
  font-weight: 500;
  font-size: 0.8125rem;
  border-radius: var(--border-radius-sm);
  transition: background-color 0.2s ease;
}

.store-badge:hover {
  background-color: var(--color-primary);
  color: var(--color-background);
}

.store-badge--placeholder {
  background-color: var(--color-background-alt);
  color: var(--color-text-muted);
  border: 1px dashed var(--color-border);
}

.store-badge--placeholder:hover {
  background-color: var(--color-background-alt);
  color: var(--color-text-muted);
}

@media (max-width: 400px) {
  .download__badges {
    flex-direction: column;
    align-items: center;
  }

  .store-badge {
    width: 160px;
  }
}

/* --------------------------------------------------------------------------
   Contact Section
   -------------------------------------------------------------------------- */
.contact {
  text-align: center;
  max-width: 400px;
  margin: 0 auto;
}

.contact__email {
  display: inline-block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-top: var(--space-2);
}

.contact__email:hover {
  color: var(--color-primary-dark);
}

.contact__social {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--color-primary);
  color: var(--color-background);
  transition: opacity 0.2s ease;
}

.social-link:hover {
  opacity: 0.85;
  color: var(--color-background);
}

.social-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Footer social link (inverted colors) */
.footer__social {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  margin-top: var(--space-2);
}

.footer__social .social-link {
  background-color: rgba(255, 255, 255, 0.15);
  color: var(--color-background);
}

.footer__social .social-link:hover {
  background-color: rgba(255, 255, 255, 0.25);
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
  background-color: var(--color-text);
  color: var(--color-background);
  padding: var(--space-8) 0;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  max-width: 600px;
  margin: 0 auto;
}

.footer__brand {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-background);
}

.footer__links {
  display: flex;
  gap: var(--space-4);
}

.footer__link {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  transition: color 0.2s ease;
}

.footer__link:hover {
  color: var(--color-background);
}

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

/* --------------------------------------------------------------------------
   Privacy Policy Page
   -------------------------------------------------------------------------- */
.policy {
  padding: var(--space-12) 0 var(--space-20);
}

.policy__content {
  max-width: var(--max-width-narrow);
  margin: 0 auto;
}

.policy__title {
  margin-bottom: var(--space-3);
}

.policy__updated {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-10);
}

.policy__section {
  margin-bottom: var(--space-10);
}

.policy__section-title {
  font-size: 1.25rem;
  margin-bottom: var(--space-4);
}

.policy__content p {
  color: var(--color-text-secondary);
}

.policy__content ul,
.policy__content ol {
  margin-left: var(--space-6);
  margin-bottom: var(--space-4);
  color: var(--color-text-secondary);
}

.policy__content li {
  margin-bottom: var(--space-2);
}

.policy__content strong {
  color: var(--color-text);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Utility Classes
   -------------------------------------------------------------------------- */
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }

.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;
}

/* --------------------------------------------------------------------------
   RTL Support (Arabic & Hebrew)
   -------------------------------------------------------------------------- */
[dir="rtl"] {
  text-align: right;
}

[dir="rtl"] .header__inner {
  flex-direction: row-reverse;
}

[dir="rtl"] .nav {
  flex-direction: row-reverse;
}

[dir="rtl"] .lang-switcher {
  margin-left: 0;
  margin-right: var(--space-4);
  padding-left: 0;
  padding-right: var(--space-4);
  border-left: none;
  border-right: 1px solid rgba(255, 255, 255, 0.3);
}

[dir="rtl"] .hero {
  text-align: center;
}

[dir="rtl"] .section__header {
  text-align: center;
}

[dir="rtl"] .feature-item {
  text-align: center;
}

[dir="rtl"] .screenshot-card__label {
  text-align: center;
}

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

[dir="rtl"] .contact {
  text-align: center;
}

[dir="rtl"] .footer__inner {
  text-align: center;
}

[dir="rtl"] .policy__content ul,
[dir="rtl"] .policy__content ol {
  margin-left: 0;
  margin-right: var(--space-6);
}

@media (max-width: 640px) {
  [dir="rtl"] .lang-switcher {
    margin-right: var(--space-2);
    padding-right: var(--space-2);
  }
}

/* --------------------------------------------------------------------------
   RTL Mobile Navigation (must come AFTER general RTL styles)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  /* Reset RTL header for mobile */
  [dir="rtl"] .header__inner {
    flex-direction: row;
  }

  /* RTL nav drawer - slides from LEFT side */
  [dir="rtl"] .nav {
    position: fixed;
    top: 0;
    right: auto;
    left: -280px;
    width: 280px;
    height: 100vh;
    flex-direction: column;
    align-items: stretch;
    text-align: right;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    transition: left 0.3s ease;
  }

  [dir="rtl"] .nav--open {
    left: 0;
    right: auto;
  }

  /* RTL nav links */
  [dir="rtl"] .nav__link {
    text-align: right;
  }

  /* RTL language switcher in mobile menu */
  [dir="rtl"] .lang-switcher {
    margin: var(--space-6) 0 0 0;
    padding: var(--space-4) 0 0 0;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    justify-content: center;
  }
}
