/*
 * AILA Tech - Comprehensive Responsive Enhancement
 * Ensures friendly experience across Mobile, Tablet, and Desktop
 * Breakpoints: 320px | 480px | 640px | 768px | 1024px | 1280px | 1440px+
 */

/* ================================================
   0. GLOBAL RESPONSIVE FOUNDATION
   ================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

img,
video,
svg {
  max-width: 100%;
  height: auto;
}

/* Prevent horizontal overflow from any element */
.container,
section,
main,
header,
footer,
article,
aside,
nav {
  max-width: 100vw;
  overflow-x: clip;
}

/* ================================================
   1. MAIN CONTENT SPACING
   Each page handles its own fixed-header compensation.
   This ensures no overflow and proper stacking context.
   ================================================ */
#main-content,
main[role="main"] {
  position: relative;
  width: 100%;
  overflow-x: hidden;
}

/* ================================================
   2. TOP NAVBAR - TABLET CONDENSED MODE
   Show key info in a compact format on tablets
   ================================================ */
@media (min-width: 769px) and (max-width: 1024px) {
  .premium-top-bar {
    height: 36px;
    font-size: 0.75rem;
  }

  .premium-top-bar .container {
    padding: 0 16px;
  }

  .top-bar-contact {
    padding: 4px 8px;
    font-size: 0.75rem;
  }

  .top-bar-link {
    padding: 4px 8px;
    font-size: 0.75rem;
  }

  .lang-switcher-btn {
    padding: 4px 10px;
    font-size: 0.75rem;
  }

  /* Adjust header top to match smaller top bar */
  .main-header.aila-navbar {
    top: 36px;
  }
}

/* ================================================
   3. HEADER / NAVIGATION - ALL BREAKPOINTS
   ================================================ */

/* Large desktop: spacious nav */
@media (min-width: 1440px) {
  .aila-navbar-content {
    max-width: 1400px;
    padding: 0 2.5rem;
  }
}

/* Standard desktop */
@media (min-width: 1025px) and (max-width: 1439px) {
  .aila-navbar-content {
    padding: 0 1.5rem;
  }

  .aila-nav-link {
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
  }
}

/* Tablet: hamburger menu with wider drawer */
@media (min-width: 641px) and (max-width: 1024px) {
  .mobile-nav-drawer {
    max-width: 380px !important;
    width: 85% !important;
  }

  .mobile-nav-link {
    padding: 1rem 1.25rem;
    font-size: 1rem;
  }

  .mobile-nav-section-title {
    font-size: 0.6875rem;
  }
}

/* Mobile: full-width drawer */
@media (max-width: 640px) {
  .mobile-nav-drawer {
    max-width: 100% !important;
    width: 100% !important;
  }

  .mobile-nav-link {
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
    min-height: 48px;
    display: flex;
    align-items: center;
  }
}

/* ================================================
   4. HERO SECTION - RESPONSIVE
   ================================================ */

/* Large desktop */
@media (min-width: 1280px) {
  .animated-hero-section {
    padding: 5rem 0 4rem;
  }

  .animated-hero-content {
    gap: 4rem;
  }

  .animated-hero-title {
    font-size: 3.25rem;
  }
}

/* Small desktop */
@media (min-width: 1025px) and (max-width: 1279px) {
  .animated-hero-section {
    padding: 4rem 0 3rem;
  }

  .animated-hero-title {
    font-size: 2.75rem;
  }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
  .animated-hero-section {
    padding: 3rem 0 2.5rem;
  }

  .animated-hero-content {
    grid-template-columns: 1fr !important;
    text-align: center;
    gap: 2rem;
  }

  .animated-hero-left {
    order: 1;
  }

  .animated-hero-right {
    order: 2;
    max-width: 500px;
    margin: 0 auto;
  }

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

  .animated-hero-description {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
  }

  .animated-stats-container {
    justify-content: center;
  }

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

/* Mobile */
@media (max-width: 768px) {
  .animated-hero-section {
    padding: 2rem 0 1.5rem;
  }

  .animated-hero-content {
    grid-template-columns: 1fr !important;
    text-align: center;
    gap: 1.5rem;
  }

  .animated-hero-title {
    font-size: clamp(1.75rem, 6vw, 2.25rem);
    line-height: 1.2;
  }

  .animated-hero-description {
    font-size: 0.9375rem;
    line-height: 1.6;
    padding: 0 0.5rem;
  }

  .animated-hero-badge {
    font-size: 0.8125rem;
    padding: 6px 14px;
  }

  .animated-stats-container {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.75rem;
    padding: 0 0.25rem;
  }

  .animated-stat-item {
    padding: 0.75rem 0.5rem;
    text-align: center;
  }

  .animated-stat-number {
    font-size: 1.25rem;
  }

  .animated-stat-label {
    font-size: 0.6875rem;
  }

  .animated-cta-buttons {
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    padding: 0 0.5rem;
  }

  .animated-cta-primary,
  .animated-cta-secondary {
    width: 100%;
    justify-content: center;
    text-align: center;
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
    min-height: 48px;
  }
}

/* Extra small mobile */
@media (max-width: 375px) {
  .animated-hero-title {
    font-size: 1.5rem;
  }

  .animated-stats-container {
    gap: 0.5rem;
  }

  .animated-stat-number {
    font-size: 1.125rem;
  }

  .animated-stat-label {
    font-size: 0.625rem;
  }
}

/* ================================================
   5. FEATURES / CARDS SECTION - ALL BREAKPOINTS
   ================================================ */

/* Desktop: 3-column grid */
@media (min-width: 1025px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }
}

/* Tablet: 2-column grid */
@media (min-width: 641px) and (max-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .feature-card {
    padding: 1.5rem;
  }
}

/* Mobile: single column */
@media (max-width: 640px) {
  .features-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0 0.25rem;
  }

  .feature-card {
    padding: 1.25rem;
  }

  .feature-icon {
    width: 48px;
    height: 48px;
  }

  .feature-icon i {
    font-size: 1.25rem;
  }
}

/* Section headers responsive */
@media (max-width: 768px) {
  .section-header {
    padding: 0 0.5rem;
    margin-bottom: 2rem;
  }

  .section-title {
    font-size: clamp(1.5rem, 5vw, 2rem);
    line-height: 1.3;
  }

  .section-description {
    font-size: 0.9375rem;
    line-height: 1.6;
  }

  .section-badge {
    font-size: 0.75rem;
    padding: 4px 12px;
  }
}

/* ================================================
   6. PROCESS / HOW IT WORKS - RESPONSIVE
   ================================================ */
@media (max-width: 768px) {
  .process-steps {
    flex-direction: column;
    gap: 1.25rem;
  }

  .step-card {
    flex-direction: row;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
  }

  .step-arrow {
    display: none;
  }

  .step-number {
    font-size: 1rem;
  }

  .step-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
  }
}

/* ================================================
   7. SERVICES PAGE - RESPONSIVE
   ================================================ */
@media (min-width: 769px) and (max-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .services-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .service-card {
    padding: 1.25rem;
  }

  .service-card img {
    border-radius: 8px;
    margin-bottom: 1rem;
  }
}

/* ================================================
   8. PRICING PAGE - RESPONSIVE
   ================================================ */
@media (min-width: 769px) and (max-width: 1024px) {
  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  .pricing-card {
    padding: 1.5rem;
  }
}

@media (max-width: 768px) {
  .pricing-hero-new {
    margin-top: -70px !important;
    padding-top: calc(24px + 70px) !important;
    min-height: 200px;
  }

  .pricing-hero-content-new {
    padding: 20px 16px !important;
  }

  .pricing-hero-title-new {
    font-size: clamp(1.5rem, 5vw, 2rem) !important;
    margin-bottom: 8px;
  }

  .pricing-hero-subtitle-new {
    font-size: 0.9375rem !important;
    padding: 0 8px;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
  }

  .pricing-card {
    padding: 1.5rem;
  }

  .pricing-card .price {
    font-size: 2rem;
  }

  .pricing-card .plan-name {
    font-size: 1.25rem;
  }

  .pricing-card .btn,
  .pricing-card .pricing-btn {
    width: 100%;
    min-height: 48px;
    font-size: 0.9375rem;
  }
}

@media (max-width: 480px) {
  .pricing-hero-new {
    margin-top: -60px !important;
    padding-top: calc(20px + 60px) !important;
  }

  .pricing-hero-title-new {
    font-size: 1.375rem !important;
  }
}

/* ================================================
   8b. SERVICES PAGE - BADGE OVERLAP FIX
   ================================================ */
@media (max-width: 1024px) {
  .service-recommended-badge {
    position: absolute !important;
    top: 0.5rem !important;
    right: 0.5rem !important;
  }

  .service-recommended-badge .pricing-plan-badge {
    padding: 0.375rem 0.75rem !important;
    font-size: 0.625rem !important;
    gap: 0.25rem !important;
  }

  .service-recommended-badge .pricing-plan-badge i {
    font-size: 0.6875rem !important;
  }
}

@media (max-width: 640px) {
  .service-recommended-badge {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    display: inline-block !important;
    margin: 0.5rem 0 !important;
  }
}

/* ================================================
   9. FOOTER - IMPROVED MOBILE READABILITY
   ================================================ */
@media (max-width: 768px) {
  .premium-footer .footer-main {
    padding: 2.5rem 0 1.5rem;
  }

  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem;
    text-align: center;
  }

  .footer-brand {
    grid-column: span 1 !important;
    max-width: none;
    text-align: center;
  }

  .footer-logo-link {
    display: flex;
    justify-content: center;
  }

  .footer-tagline {
    max-width: 320px;
    margin: 0 auto 1.25rem;
    font-size: 0.875rem;
  }

  .footer-social {
    justify-content: center;
  }

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

  .footer-links {
    align-items: center;
  }

  .footer-contact {
    align-items: center;
  }

  .contact-item {
    justify-content: center;
  }

  /* Fix footer copyright readability */
  .footer-copyright {
    font-size: 0.8125rem !important;
    line-height: 1.5;
  }

  .footer-bottom-links {
    font-size: 0.8125rem !important;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.375rem;
  }

  .footer-bottom-links a {
    font-size: 0.8125rem !important;
    padding: 4px 2px;
  }

  .footer-bottom-content {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }

  /* Ensure social icons are tappable */
  .footer-social .social-link {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px;
    min-height: 44px;
  }

  .footer-social .social-link svg {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 480px) {
  .footer-copyright {
    font-size: 0.8125rem !important;
  }

  .footer-bottom-links {
    font-size: 0.8125rem !important;
  }

  .footer-bottom-links a {
    font-size: 0.8125rem !important;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
  }

  .footer-social .social-link {
    width: 42px !important;
    height: 42px !important;
  }
}

/* ================================================
   10. FORMS - RESPONSIVE & TOUCH-FRIENDLY
   ================================================ */
@media (max-width: 768px) {
  /* Prevent iOS zoom on input focus */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="number"],
  input[type="url"],
  input[type="search"],
  input[type="date"],
  textarea,
  select {
    font-size: 16px !important;
    padding: 0.75rem 1rem;
    border-radius: 10px;
  }

  /* Form labels */
  label {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
  }

  /* Form groups */
  .form-group,
  .form-field {
    margin-bottom: 1.25rem;
  }

  /* Submit buttons full width */
  form .btn,
  form button[type="submit"],
  .form-submit-btn {
    width: 100%;
    min-height: 48px;
    font-size: 1rem;
    border-radius: 12px;
  }
}

/* ================================================
   11. CONTACT PAGE - RESPONSIVE
   ================================================ */
@media (max-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .contact-form {
    padding: 1.5rem;
  }

  .contact-info-card {
    padding: 1.25rem;
  }
}

/* ================================================
   12. ABOUT / TEAM PAGE - RESPONSIVE
   ================================================ */

/* About stats - improved contrast on mobile */
@media (max-width: 768px) {
  .about-stats {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.25rem !important;
    padding: 2rem 1.25rem !important;
    border-radius: 16px !important;
  }

  .about-stat-item h3 {
    font-size: 1.75rem !important;
    color: #93C5FD !important;
  }

  .about-stat-item p {
    color: #CBD5E1 !important;
    font-size: 0.8125rem !important;
  }
}

@media (max-width: 375px) {
  .about-stats {
    gap: 1rem !important;
    padding: 1.5rem 1rem !important;
  }

  .about-stat-item h3 {
    font-size: 1.5rem !important;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (max-width: 640px) {
  .team-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
  }

  .team-card {
    padding: 1.25rem;
  }

  .team-card img {
    width: 80px;
    height: 80px;
  }
}

/* ================================================
   13. DOCS / BLOG PAGE - RESPONSIVE
   ================================================ */
@media (max-width: 768px) {
  .docs-grid,
  .api-cards-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .docs-card,
  .api-card {
    padding: 1.25rem;
  }

  .blog-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .blog-card {
    padding: 1.25rem;
  }
}

/* ================================================
   14. DASHBOARD / AUTHENTICATED PAGES - RESPONSIVE
   ================================================ */
@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .dashboard-card {
    padding: 1.25rem;
  }

  .dashboard-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-card .stat-value {
    font-size: 1.5rem;
  }

  .stat-card .stat-label {
    font-size: 0.75rem;
  }

  /* Profile page */
  .profile-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .profile-card {
    padding: 1.5rem;
  }

  /* Settings page */
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .settings-sidebar {
    display: none;
  }

  /* Billing page */
  .billing-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* API Token page */
  .api-token-container {
    padding: 1rem;
  }

  .token-display {
    font-size: 0.75rem;
    word-break: break-all;
  }
}

/* Dashboard single column on very small */
@media (max-width: 480px) {
  .dashboard-stats {
    grid-template-columns: 1fr;
  }
}

/* ================================================
   15. AUTH PAGES (LOGIN/SIGNUP) - RESPONSIVE
   These are standalone pages not using base.html
   ================================================ */
@media (max-width: 768px) {
  .login-page,
  .signup-page {
    padding: 1rem;
  }

  .auth-container,
  .login-container,
  .signup-container {
    max-width: 100%;
    padding: 1.5rem;
    margin: 0.5rem;
    border-radius: 16px;
  }

  .auth-header h1,
  .login-title,
  .signup-title {
    font-size: 1.5rem;
  }

  .auth-form input,
  .login-form input,
  .signup-form input {
    font-size: 16px !important;
    padding: 0.75rem 1rem;
    min-height: 48px;
  }

  .auth-form .btn,
  .login-form .btn,
  .signup-form .btn,
  .auth-submit-btn {
    width: 100%;
    min-height: 48px;
    font-size: 1rem;
  }

  .auth-links,
  .auth-footer-links {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }

  /* Auth nav links - larger touch targets */
  .auth-nav-link {
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    padding: 0.5rem 1rem !important;
    font-size: 0.875rem !important;
  }

  .auth-nav-link i {
    font-size: 0.875rem;
  }

  .auth-nav {
    height: 60px;
  }

  .auth-nav-container {
    padding: 0 0.75rem;
  }
}

@media (max-width: 480px) {
  .auth-container,
  .login-container,
  .signup-container {
    padding: 1.25rem;
    margin: 0.25rem;
  }

  .auth-nav-link {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.8125rem !important;
    min-height: 40px !important;
    gap: 4px;
  }
}

/* ================================================
   16. VERIFY OTP PAGE - RESPONSIVE
   ================================================ */
@media (max-width: 768px) {
  .otp-container {
    max-width: 100%;
    padding: 1.5rem;
  }

  .otp-inputs {
    gap: 0.5rem;
  }

  .otp-inputs input {
    width: 44px;
    height: 52px;
    font-size: 1.25rem;
  }
}

@media (max-width: 375px) {
  .otp-inputs input {
    width: 38px;
    height: 46px;
    font-size: 1.125rem;
  }
}

/* ================================================
   17. TABLES - RESPONSIVE
   ================================================ */
@media (max-width: 768px) {
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  table th,
  table td {
    padding: 0.75rem 0.625rem;
    font-size: 0.8125rem;
  }
}

/* ================================================
   18. MODALS & DIALOGS - RESPONSIVE
   ================================================ */
@media (max-width: 768px) {
  .modal-content,
  .dialog-content {
    width: calc(100% - 2rem) !important;
    max-width: none !important;
    margin: 1rem;
    border-radius: 16px;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
  }

  .modal-header,
  .dialog-header {
    padding: 1.25rem;
  }

  .modal-body,
  .dialog-body {
    padding: 1.25rem;
  }

  .modal-footer,
  .dialog-footer {
    padding: 1rem 1.25rem;
    flex-direction: column;
    gap: 0.75rem;
  }

  .modal-footer .btn,
  .dialog-footer .btn {
    width: 100%;
    min-height: 44px;
  }
}

/* ================================================
   19. SLIDESHOW / PRODUCT SHOWCASE - RESPONSIVE
   ================================================ */
@media (min-width: 769px) and (max-width: 1024px) {
  .product-slideshow-container {
    max-width: 480px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .product-slideshow-container {
    max-width: 100%;
    margin: 0 auto;
    border-radius: 12px;
  }

  .slideshow-btn {
    width: 36px;
    height: 36px;
  }

  .slideshow-btn i {
    font-size: 0.875rem;
  }
}

@media (max-width: 480px) {
  .product-slideshow-container {
    border-radius: 10px;
  }

  .slideshow-btn {
    width: 32px;
    height: 32px;
  }
}

/* ================================================
   20. FLASH MESSAGES - RESPONSIVE
   ================================================ */
@media (max-width: 768px) {
  .flash-messages {
    padding: 0 0.5rem;
  }

  .flash-message {
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 0.5rem;
  }

  .flash-message .close-btn {
    min-width: 32px;
    min-height: 32px;
  }
}

/* ================================================
   21. API ENDPOINTS / TESTING PAGES - RESPONSIVE
   ================================================ */
@media (max-width: 768px) {
  .api-test-container {
    padding: 1rem;
  }

  .api-test-form {
    padding: 1.25rem;
  }

  .api-response-container {
    padding: 1rem;
    font-size: 0.8125rem;
  }

  .api-response-container pre {
    font-size: 0.75rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
  }

  .file-upload-area {
    padding: 1.5rem 1rem;
    min-height: 120px;
  }

  .file-upload-area i {
    font-size: 2rem;
  }

  .file-upload-area p {
    font-size: 0.875rem;
  }
}

/* ================================================
   22. LIVE API DOCS PAGE - RESPONSIVE
   ================================================ */
@media (max-width: 768px) {
  .api-docs-sidebar {
    display: none;
  }

  .api-docs-content {
    width: 100%;
    padding: 1rem;
  }

  .api-endpoint-card {
    padding: 1.25rem;
  }

  .endpoint-method {
    font-size: 0.75rem;
    padding: 0.25rem 0.625rem;
  }

  .endpoint-path {
    font-size: 0.8125rem;
    word-break: break-all;
  }

  .code-block {
    font-size: 0.75rem;
    padding: 1rem;
    overflow-x: auto;
  }
}

/* ================================================
   23. UTILITY - VISIBILITY CLASSES
   ================================================ */
@media (max-width: 640px) {
  .hide-mobile-sm {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .hide-tablet {
    display: none !important;
  }
}

@media (min-width: 1025px) {
  .hide-desktop {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .show-mobile-only {
    display: block !important;
  }
}

@media (min-width: 769px) {
  .show-mobile-only {
    display: none !important;
  }
}

/* ================================================
   24. TOUCH-FRIENDLY IMPROVEMENTS
   ================================================ */
@media (hover: none) and (pointer: coarse) {
  a,
  button,
  .btn,
  [role="button"],
  input[type="submit"],
  input[type="button"],
  .clickable {
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(0, 102, 255, 0.1);
  }

  /* Better tap feedback */
  a:active,
  button:active,
  .btn:active {
    opacity: 0.85;
    transform: scale(0.98);
  }

  /* Disable hover effects on touch */
  .feature-card:hover,
  .service-card:hover,
  .pricing-card:hover {
    transform: none;
  }

  /* Larger checkbox/radio targets */
  input[type="checkbox"],
  input[type="radio"] {
    width: 20px;
    height: 20px;
  }

  /* Links in body text need adequate spacing */
  p a,
  li a {
    padding: 2px 0;
  }
}

/* ================================================
   25. SAFE AREA SUPPORT (Notched Devices)
   ================================================ */
@supports (padding: max(0px)) {
  .premium-top-bar .container {
    padding-left: max(24px, env(safe-area-inset-left));
    padding-right: max(24px, env(safe-area-inset-right));
  }

  .aila-navbar-content {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .premium-footer .footer-container {
    padding-left: max(1.5rem, env(safe-area-inset-left));
    padding-right: max(1.5rem, env(safe-area-inset-right));
  }

  .mobile-nav-drawer {
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }
}

/* ================================================
   26. LANDSCAPE MOBILE FIXES
   ================================================ */
@media (max-width: 896px) and (orientation: landscape) {
  .animated-hero-section {
    padding: 1.5rem 0;
    min-height: auto;
  }

  .animated-hero-content {
    grid-template-columns: 1fr 1fr !important;
    gap: 1.5rem;
    text-align: left;
  }

  .animated-hero-title {
    font-size: 1.5rem;
  }

  .animated-hero-description {
    font-size: 0.8125rem;
  }

  .animated-stats-container {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.5rem;
  }

  .animated-cta-buttons {
    flex-direction: row;
    gap: 0.75rem;
  }

  .animated-cta-primary,
  .animated-cta-secondary {
    width: auto;
    padding: 0.625rem 1.25rem;
    font-size: 0.8125rem;
  }

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

  /* Compact nav in landscape */
  .mobile-nav-drawer {
    max-width: 300px !important;
  }

  .mobile-nav-content {
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .animated-hero-section {
    padding: 1rem 0;
  }

  .animated-hero-title {
    font-size: 1.375rem;
    margin-bottom: 0.5rem;
  }

  .animated-hero-description {
    font-size: 0.75rem;
    margin-bottom: 0.75rem;
  }

  .animated-hero-badge {
    font-size: 0.6875rem;
    padding: 4px 10px;
    margin-bottom: 0.5rem;
  }

  .section-header {
    margin-bottom: 1.5rem;
  }

  #main-content > section {
    padding: 2rem 0;
  }
}

/* ================================================
   27. FAQ PAGE - RESPONSIVE
   ================================================ */
@media (max-width: 768px) {
  .faq-container {
    padding: 0 0.5rem;
  }

  .faq-item {
    padding: 1rem;
    margin-bottom: 0.75rem;
  }

  .faq-question {
    font-size: 0.9375rem;
    padding-right: 2rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .faq-answer {
    font-size: 0.875rem;
    line-height: 1.6;
  }
}

/* ================================================
   28. COMING SOON DIALOG - RESPONSIVE
   ================================================ */
@media (max-width: 480px) {
  .coming-soon-dialog-content {
    width: calc(100% - 2rem) !important;
    padding: 1.5rem;
    border-radius: 16px;
  }

  .coming-soon-dialog-title {
    font-size: 1.25rem;
  }

  .coming-soon-dialog-message {
    font-size: 0.875rem;
  }

  .coming-soon-dialog-button {
    padding: 0.75rem 1.25rem;
    font-size: 0.9375rem;
    min-height: 44px;
  }
}

/* ================================================
   29. SCROLLBAR STYLING (Desktop)
   ================================================ */
@media (min-width: 769px) {
  ::-webkit-scrollbar {
    width: 8px;
  }

  ::-webkit-scrollbar-track {
    background: #f1f5f9;
  }

  ::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
  }

  ::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
  }
}

/* ================================================
   30. ANIMATION PERFORMANCE
   ================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* GPU-accelerated animations for smooth performance */
.animated-hero-section,
.feature-card,
.service-card,
.pricing-card,
.team-card,
.mobile-nav-overlay,
.mobile-nav-drawer {
  will-change: auto;
}

/* ================================================
   31. TYPOGRAPHY RESPONSIVE SCALE
   ================================================ */
@media (max-width: 768px) {
  h1 { font-size: clamp(1.5rem, 6vw, 2.25rem); }
  h2 { font-size: clamp(1.25rem, 5vw, 1.875rem); }
  h3 { font-size: clamp(1.125rem, 4vw, 1.5rem); }
  h4 { font-size: clamp(1rem, 3vw, 1.25rem); }
  h5 { font-size: clamp(0.9375rem, 2.5vw, 1.125rem); }
  h6 { font-size: clamp(0.875rem, 2vw, 1rem); }

  p, li, span {
    font-size: clamp(0.875rem, 2.5vw, 1rem);
  }
}

@media (max-width: 375px) {
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1.125rem; }

  p, li {
    font-size: 0.875rem;
    line-height: 1.6;
  }
}
