/* Mobile First Responsive Design */

/* Small phones (320px - 480px) */
@media (max-width: 480px) {
  .hero-container {
    grid-template-columns: 1fr;
    gap: var(--spacing-8);
    text-align: center;
  }

  .hero-title {
    font-size: var(--font-size-3xl);
  }

  .hero-subtitle {
    font-size: var(--font-size-lg);
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 300px;
  }

  .hero-stats {
    justify-content: center;
    gap: var(--spacing-6);
  }

  .phone-mockup {
    width: 250px;
    height: 500px;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-6);
  }

  .feature-card {
    padding: var(--spacing-6);
  }

  .screenshots-carousel {
    grid-template-columns: 1fr;
    gap: var(--spacing-6);
  }

  .download-info {
    flex-direction: column;
    gap: var(--spacing-4);
    align-items: center;
    text-align: center;
  }

  .info-item {
    justify-content: center;
    text-align: center;
  }

  .support-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-6);
  }

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

  .social-links {
    justify-content: center;
    align-items: center;
    display: flex;
    gap: var(--spacing-4);
  }

  .footer-section {
    text-align: center;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: var(--spacing-4);
  }

  .footer-bottom-right {
    flex-direction: column;
    gap: var(--spacing-4);
    align-items: center;
    width: 100%;
  }

  .footer-legal {
    flex-direction: column;
    gap: var(--spacing-2);
  }

  .footer-lang-switcher {
    justify-content: center;
    gap: 3px;
    max-width: 100%;
  }

  .footer-lang-switcher .lang-btn {
    font-size: 9px;
    padding: 3px 5px;
    min-width: 26px;
    max-width: 50px;
  }

  /* For Chinese and other longer text buttons */
  .footer-lang-switcher .lang-btn[id*="zh-CN"] {
    font-size: 8px;
    padding: 3px 4px;
    max-width: 45px;
  }

  .nav-menu {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background: var(--surface-color);
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: var(--spacing-8);
    transition: left 0.3s ease;
    border-top: 1px solid var(--border-color);
  }

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

  .nav-toggle {
    display: flex;
  }

  .nav-toggle.active .bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .nav-toggle.active .bar:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.active .bar:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }
}

/* Mobile (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
  .footer-lang-switcher {
    justify-content: center;
    gap: var(--spacing-1);
  }

  .footer-lang-switcher .lang-btn {
    font-size: 11px;
    padding: 5px 8px;
  }
  .hero-container {
    grid-template-columns: 1fr;
    gap: var(--spacing-12);
    text-align: center;
  }

  .hero-title {
    font-size: var(--font-size-4xl);
  }

  .hero-subtitle {
    font-size: var(--font-size-xl);
  }

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

  .features-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-6);
  }

  .screenshots-carousel {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-6);
  }

  .support-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-6);
  }

  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }

  .nav-menu {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }
}

/* Tablet (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .hero-container {
    gap: var(--spacing-12);
  }

  .hero-title {
    font-size: var(--font-size-4xl);
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-8);
  }

  .screenshots-carousel {
    grid-template-columns: repeat(2, 1fr);
  }

  .support-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }

  .nav-menu {
    display: flex;
  }

  .nav-toggle {
    display: none;
  }

  .footer-lang-switcher {
    justify-content: center;
    gap: var(--spacing-1);
  }

  .footer-lang-switcher .lang-btn {
    font-size: var(--font-size-xs);
    padding: 6px 10px;
  }
}

/* Desktop (1025px and up) */
@media (min-width: 1025px) {
  .hero-container {
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-16);
  }

  .hero-title {
    font-size: var(--font-size-5xl);
  }

  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .screenshots-carousel {
    grid-template-columns: repeat(4, 1fr);
  }

  .support-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .footer-content {
    grid-template-columns: repeat(4, 1fr);
  }

  .nav-menu {
    display: flex;
  }

  .nav-toggle {
    display: none;
  }

  .footer-lang-switcher {
    justify-content: center;
    gap: var(--spacing-1);
    flex-wrap: wrap;
  }

  .footer-lang-switcher .lang-btn {
    font-size: var(--font-size-xs);
    padding: var(--spacing-1) var(--spacing-2);
  }
}

/* Large Desktop (1200px and up) */
@media (min-width: 1200px) {
  .container {
    max-width: 1200px;
  }

  .nav-container {
    max-width: 1200px;
  }
}

/* Extra Large Desktop (1400px and up) */
@media (min-width: 1400px) {
  .container {
    max-width: 1400px;
  }

  .nav-container {
    max-width: 1400px;
  }

  .hero-container {
    max-width: 1400px;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .logo,
  .app-preview,
  .screenshot-img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Print styles */
@media print {
  .navbar,
  .footer-lang-switcher,
  .hero-buttons,
  .download,
  .footer {
    display: none;
  }

  .hero {
    padding: var(--spacing-8) 0;
  }

  .hero-title {
    color: black;
  }

  .section-title {
    color: black;
  }

  .feature-title {
    color: black;
  }

  body {
    background: white;
    color: black;
  }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  :root {
    --border-color: #000000;
    --text-secondary: #000000;
  }

  .btn-primary {
    border: 2px solid #000000;
  }

  .btn-secondary {
    border-width: 3px;
  }
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 600px) {
  .hero {
    padding: 80px 0 40px;
    min-height: auto;
  }

  .hero-container {
    gap: var(--spacing-8);
  }

  .hero-title {
    font-size: var(--font-size-3xl);
  }

  .hero-subtitle {
    font-size: var(--font-size-lg);
  }

  .phone-mockup {
    width: 200px;
    height: 400px;
  }
}
