/* ============================================
   Sonata Landing Page Styles
   ============================================ */

/* CSS Variables - Exact Match with Flutter App Theme Colors */
:root {
  /* Primary colors from Flutter Light Theme */
  --primary-color: #835415;
  --primary-dark: #2B1700;
  --primary-light: #FFDDBA;
  --primary-container: #FFDDBA;
  --on-primary: #FFFFFF;
  --on-primary-container: #2B1700;
  --accent-color: #829460;

  /* Secondary colors */
  --secondary-color: #715A41;
  --secondary-container: #FDDDBD;
  --on-secondary: #FFFFFF;
  --on-secondary-container: #281805;

  /* Tertiary colors */
  --tertiary-color: #55633C;
  --tertiary-container: #D9E9B7;

  /* Surface colors from Flutter Light Theme */
  --surface: #FFF8F4;
  --surface-variant: #F1DFD0;
  --on-surface: #211A14;
  --on-surface-variant: #50453A;

  /* Text colors */
  --text-primary: #211A14;
  --text-secondary: #50453A;
  --text-light: #827568;

  /* Background colors */
  --bg-primary: #FFF8F4;
  --bg-secondary: #F1DFD0;

  /* Border and outline */
  --border-color: #D4C4B5;
  --outline: #827568;
  --outline-variant: #D4C4B5;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);

  /* Animation - Optimized for performance with specific properties instead of all */
  /* --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); */
  --transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);

  /* Typography */
  --font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Dark Theme - Exact Match with Flutter Dark Theme Colors */
@media (prefers-color-scheme: dark) {
  :root {
    /* Primary colors from Flutter Dark Theme */
    --primary-color: #CABEFF;
    --primary-dark: #32285F;
    --primary-light: #E6DEFF;
    --primary-container: #483F77;
    --on-primary: #32285F;
    --on-primary-container: #E6DEFF;
    --accent-color: #EDB8CC;

    /* Secondary colors */
    --secondary-color: #C9C3DC;
    --secondary-container: #484459;
    --on-secondary: #312E41;
    --on-secondary-container: #E6DFF9;

    /* Tertiary colors */
    --tertiary-color: #EDB8CC;
    --tertiary-container: #623B4C;

    /* Surface colors from Flutter Dark Theme */
    --surface: #141318;
    --surface-variant: #48454E;
    --on-surface: #E6E1E9;
    --on-surface-variant: #C9C4D0;

    /* Text colors */
    --text-primary: #E6E1E9;
    --text-secondary: #C9C4D0;
    --text-light: #938F99;

    /* Background colors */
    --bg-primary: #141318;
    --bg-secondary: #48454E;

    /* Border and outline */
    --border-color: #48454E;
    --outline: #938F99;
    --outline-variant: #48454E;
  }
}

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

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

body {
  font-family: var(--font-family);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  z-index: 1000;
  transition: var(--transition);
}

@media (prefers-color-scheme: dark) {
  .navbar {
    background: rgba(26, 26, 26, 0.95);
  }
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.5rem;
  transition: var(--transition);
}

.logo:hover {
  transform: scale(1.05);
}

.logo-img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.logo-text {
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
}

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: var(--transition);
}

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

.nav-link:hover::after {
  width: 100%;
}

.nav-link-primary {
  /* background: linear-gradient(135deg, var(--tertiary-color), var(--tertiary-container)); */
  background: var(--tertiary-container);
  color: var(--tertiary-color);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
}

.nav-link-primary::after {
  display: none;
}

.nav-link-primary:hover {
  transform: translateY(-2px);
  /* box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.3); */
  box-shadow: var(--shadow-md);
  color: var(--bg-dark);
  border-color: var(--bg-dark);
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.mobile-menu-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: var(--transition);
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 0 80px;
  overflow: hidden;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
  opacity: 0.1;
  z-index: -1;
}

.hero-background::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: float 20s infinite linear;
}

@keyframes float {
  0% {
    transform: translate(0, 0);
  }

  100% {
    transform: translate(50px, 50px);
  }
}

.hero-content {
  text-align: center;
  max-width: 800px;
  z-index: 1;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-style: italic;
}

.hero-description {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  line-height: 1.8;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons - Material 3 Style */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  border-radius: 20px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  /* hint element changes to pre-optimization animation */
  will-change: transform, box-shadow;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.1);
  opacity: 0;
  transition: opacity 0.2s ease-out;
  will-change: opacity;
}

.btn:hover::before {
  opacity: 1;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}

.btn-primary:hover {
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--tertiary-container);
  color: var(--tertiary-color);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  /* box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.3); */
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  animation: bounce 2s infinite;
  will-change: transform;
}

@keyframes bounce {
  /* Using GPU-accelerated properties with translate3d for smoother animation */

  0%,
  100% {
    transform: translate3d(-50%, 0, 0);
  }

  50% {
    transform: translate3d(-50%, -10px, 0);
  }
}

/* Section Styles */
section {
  padding: 80px 0;
}

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

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

.section-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
}

/* Features Section */
.features {
  background: var(--bg-secondary);
}

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

/* Feature Cards - Material 3 Style */
.feature-card {
  background: var(--surface);
  padding: 24px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  transition: var(--transition);
  text-align: center;
  will-change: transform;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  border-color: var(--primary-light);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

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

.feature-description {
  color: var(--text-secondary);
  line-height: 1.8;
}

/* Screenshots Section */
.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.screenshot-item {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-secondary);
  will-change: transform;
}

.screenshot-item:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
}

.screenshot-img {
  width: 100%;
  height: auto;
  display: block;
  transition: var(--transition);
}

/* Testimonials Section */
.testimonials {
  background: var(--bg-secondary);
}

.testimonials-carousel {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  min-height: 300px;
}

.testimonial-card {
  display: none;
  background: var(--bg-primary);
  padding: 2.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  text-align: center;
  align-items: center;
  min-height: 330px;
}

.testimonial-card.active {
  display: flex;
  animation: fadeIn 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translate3d(0, 5px, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.testimonial-stars {
  font-size: 1.5rem;
  color: var(--accent-color);
  margin-bottom: 1.5rem;
}

.testimonial-text {
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 2rem;
  font-style: italic;
}

.testimonial-author {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.testimonial-author strong {
  color: var(--text-primary);
  font-size: 1.125rem;
}

.testimonial-author span {
  color: var(--text-light);
  font-size: 0.875rem;
}

.testimonials-controls {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2rem;
}

.testimonial-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  background: var(--border-color);
  cursor: pointer;
  transition: var(--transition);
}

.testimonial-btn.active {
  background: var(--primary-color);
  width: 32px;
  border-radius: 6px;
}

/* Download Section */
.download-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
}

.download-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 2rem;
  justify-content: center;
  max-width: 800px;
}

.download-card {
  display: flex;
  justify-content: center;
  align-items: center;
  transition: var(--transition);
}

.download-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.download-img {
  max-width: 100%;
  height: auto;
  transition: transform 0.3s ease;
}

.download-img:hover {
  transform: scale(1.05);
}

.download-note {
  text-align: center;
}

.download-note p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

.qr-codes {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1rem;
}

.qr-code {
  text-align: center;
}

.qr-img {
  max-width: 240px;
  height: auto;
  border-radius: 12px;
  padding: 8px;
  background: var(--bg-secondary);
}

.qr-code p {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-light);
}

/* Footer */
.footer {
  background: var(--bg-dark);
  color: var(--text-primary);
  padding: 4rem 0 2rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.footer-logo-img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.footer-logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-tagline {
  color: var(--text-secondary);
  font-style: italic;
}

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

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--primary-color);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-light);
  font-size: 0.875rem;
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.lightbox.active {
  display: flex;
}

.lightbox-img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  font-size: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-close {
  top: 20px;
  right: 20px;
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    flex-direction: column;
    background: var(--bg-primary);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    gap: 1rem;
  }

  .nav-menu.active {
    left: 0;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    font-size: 1.25rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .screenshots-grid {
    grid-template-columns: 1fr;
  }

  .download-content {
    grid-template-columns: 1fr;
  }

  .download-buttons {
    grid-template-columns: 1fr;
  }

  .footer-content {
    grid-template-columns: 1fr;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .testimonial-card {
    padding: 2rem 1.5rem;
  }
}

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

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

/* Focus Styles */
a:focus,
button:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}