/* ================================================
   MOBILE-SPECIFIC STYLES FOR AIRCREW24
   Applied when screen width is 768px or less
   ================================================ */

/* ========== CSS CUSTOM PROPERTIES FOR MOBILE ========== */
:root {
    /* Section Spacing */
    --mobile-section-padding-top: 50px;
    --mobile-section-padding-bottom: 50px;
    
    /* Hero Section */
    --mobile-hero-padding-top: 40px;
    --mobile-hero-padding-bottom: 30px;
    --mobile-hero-content-gap: 2rem;
    
    /* Screenshots Carousel */
    --mobile-carousel-padding-top: 0;
    --mobile-carousel-padding-bottom: 0;
    --mobile-carousel-wrapper-padding: 1rem;
    --mobile-carousel-dots-margin: 0;
    
    /* Title & Subtitle */
    --mobile-title-margin-bottom: 0.75rem;
    --mobile-subtitle-margin-bottom: 1.5rem;
    
    /* Feature Cards */
    --mobile-features-gap: 1.25rem;
    --mobile-feature-card-padding: 1rem;
    
    /* Testimonials */
    --mobile-testimonials-gap: 1.5rem;
    
    /* Footer */
    --mobile-footer-padding-top: 40px;
    --mobile-footer-sections-gap: 2.5rem;
}

/* ========== VIEWPORT CONTROL ========== */
html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    padding-top: 60px !important; /* Space for fixed navbar */
}

/* ========== NAVIGATION ========== */
.navbar {
    padding: 0.5rem 0;
    position: fixed !important;
    position: -webkit-fixed !important; /* For Safari */
    top: 0 !important;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    transform: translateY(0) !important;
    -webkit-transform: translateY(0) !important;
}

/* Prevent navbar from hiding on scroll */
.navbar.scrolled {
    transform: translateY(0) !important;
    top: 0 !important;
    position: fixed !important;
}

/* Override any transform animations */
.navbar,
.navbar.scrolled,
.navbar.hide {
    transform: none !important;
    transform: translateY(0) !important;
    top: 0 !important;
    position: fixed !important;
    transition: background-color 0.3s ease, box-shadow 0.3s ease !important;
}

.nav-wrapper {
    padding: 0.5rem 0;
}

.nav-links {
    display: none;
}

.mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0.5rem;
    margin-right: -0.5rem;
    cursor: pointer;
    z-index: 1001;
    position: relative;
    background: transparent;
    border: none;
    -webkit-tap-highlight-color: transparent;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 2px;
    background: var(--primary-color);
    transition: all 0.3s ease;
    display: block;
}

.mobile-menu {
    top: 60px;
}

.mobile-menu-links {
    gap: 0.5rem;
    padding: 1rem;
}

.mobile-menu-links a {
    padding: 0.75rem 1rem;
    border-radius: 8px;
}

.logo {
    font-size: 1.1rem;
}

/* ========== HERO SECTION ========== */
.hero {
    padding: var(--mobile-hero-padding-top) 0 var(--mobile-hero-padding-bottom);
    min-height: auto;
}

.hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--mobile-hero-content-gap);
}

.hero-badge {
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
    margin-bottom: 1.25rem;
}

.hero-title {
    font-size: 1.75rem;
    line-height: 1.3;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1rem;
    padding: 0 1rem;
    margin-bottom: 1rem;
}

.hero-buttons {
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    padding: 0 2rem;
    margin-bottom: 0.5rem;
}

.hero-buttons .btn {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.hero-stats {
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.stat {
    min-width: 80px;
}

.stat-number {
    font-size: 2rem;
}

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

.iphone-mockup {
    width: 320px;
    margin: 1.5rem auto 0;
}

/* ========== GLOBAL LAYOUT ========== */
.container {
    width: 100%;
    max-width: 100%;
    padding: 0 1.5rem;
}

/* ========== SECTIONS ========== */
.features {
    padding: 30px 0 1rem;
}

.screenshots {
    padding: 5px 0 10px 0;
    overflow: visible;
}

/* Add scroll padding for anchor navigation */
#gallery,
#features,
#pricing,
#hero {
    scroll-margin-top: 80px; /* Account for fixed navbar + some space */
}

.testimonials {
    padding: 1rem 0 0.5rem;
}

.comparison {
    padding: 0.5rem 0 1.5rem;
}

.pricing {
    padding: 0.5rem 0 2rem;
}

.cta {
    padding: 1rem 0 2rem;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: var(--mobile-title-margin-bottom);
}

.section-subtitle {
    font-size: 0.9rem;
    padding: 0 1rem;
    margin-bottom: var(--mobile-subtitle-margin-bottom);
}

/* Screenshots specific */
.screenshots .section-title {
    font-size: 1.25rem;
    margin: 0;
    padding: 0;
}

.screenshots .section-subtitle {
    margin: 0;
    padding: 0;
    font-size: 0.8rem;
    position: relative;
    z-index: 5;
}

/* Center the theme toggle and remove spacing */
.screenshots .container {
    text-align: center;
    padding: 0 1.5rem;
    margin: 0;
}

/* Force adjacent sibling spacing */
.screenshots .container + .screenshots-carousel {
    margin-top: 0;
}

.screenshots-carousel {
    margin-top: 0;
}

/* ========== FEATURES ========== */
.features-grid {
    grid-template-columns: 1fr;
    gap: var(--mobile-features-gap);
}

.feature-card {
    padding: var(--mobile-feature-card-padding);
    margin-bottom: 0.75rem;
}

.feature-card:last-child {
    margin-bottom: 0;
}

.feature-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 0;
    flex-shrink: 0;
}

.feature-header {
    gap: 1rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0;
}

.feature-card p {
    font-size: 0.875rem;
    line-height: 1.6;
}

/* ========== SCREENSHOTS CAROUSEL ========== */
.theme-toggle-container {
    gap: 0.5rem;
    position: relative;
    z-index: 10;
    padding: 0;
    background: transparent;
    display: inline-flex;
    margin: 0 auto;
}

.theme-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

.theme-toggle {
    width: 50px;
    height: 28px;
}

.slider:before {
    height: 18px;
    width: 18px;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    bottom: auto;
}

.theme-toggle input:checked + .slider:before {
    transform: translateY(-50%) translateX(22px);
}

.screenshots-carousel {
    margin: 0;
    padding: 0;
    overflow: visible;
    width: 100%;
    max-width: 100vw;
    touch-action: pan-y pinch-zoom;
    position: relative;
    height: auto;
    z-index: 1;
}

.carousel-wrapper {
    padding: 0;
    position: relative;
    overflow: visible;
    height: auto;
    display: block;
    margin: 0 auto;
}

.carousel-track {
    position: relative;
    width: 100%;
    height: calc(70vw * 2.16);
    max-height: 600px;
    overflow: visible;
    margin: 10px auto;
    padding-top: 10px;
}

.screenshot-item {
    position: absolute;
    width: auto;
    height: auto;
    display: block;
    overflow: visible;
    top: 0;
    transform-origin: center center;
}

.screenshot-item.side,
.screenshot-item.hidden {
    opacity: 0;
    pointer-events: none;
}

.screenshot-item.center {
    opacity: 1;
}

.screenshot-phone {
    width: 75vw;
    max-width: 350px;
    height: auto;
    position: relative;
    margin: 0 auto;
    display: block;
}

.phone-frame {
    width: 100%;
    height: auto;
    position: relative;
    padding: 6px;
    border-radius: 30px;
    box-sizing: border-box;
    display: block;
}

.phone-screen {
    width: 100%;
    height: auto;
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    display: block;
    line-height: 0;
}

.screenshot-item img {
    width: 100%;
    height: auto;
    object-fit: scale-down;
    display: block;
    max-width: 100%;
}

.screenshot-item p {
    display: none;
}

.carousel-nav {
    display: none;
}

.screenshot-dots {
    margin-top: 10px;
    margin-bottom: 10px;
    padding: 0;
    gap: 10px;
    position: relative;
    display: flex;
    justify-content: center;
}

.dot {
    width: 8px;
    height: 8px;
}

.dot.active {
    transform: scale(1.3);
}

/* ========== TESTIMONIALS ========== */
.testimonials-grid {
    grid-template-columns: 1fr;
    gap: var(--mobile-testimonials-gap);
}

.testimonial-card {
    padding: 1.5rem;
    margin-bottom: 0.75rem;
}

.testimonial-card:last-child {
    margin-bottom: 0;
}

/* ========== COMPARISON TABLE ========== */
.comparison-table {
    font-size: 0.75rem;
    overflow-x: auto;
    display: block;
}

.comparison-table table {
    min-width: auto;
    width: 100%;
}

.comparison-table th,
.comparison-table td {
    padding: 0.75rem 0.5rem;
    font-size: 0.75rem;
    vertical-align: middle;
}

.comparison-table td:first-child {
    white-space: normal;
    line-height: 1.4;
    max-width: 140px;
    padding-right: 0.75rem;
}

.comparison-table th {
    font-size: 0.7rem;
    white-space: nowrap;
}

/* ========== PRICING ========== */
.pricing-cards {
    grid-template-columns: 1fr;
    gap: 4rem;
    padding: 0 1rem;
}

.pricing-card {
    padding: 2rem 1.75rem;
    margin-bottom: 1rem;
}

.pricing-card:nth-child(2) {
    margin-top: 1.5rem;
}

.pricing-card:last-child {
    margin-bottom: 2.5rem;
}

.pricing-card.featured {
    transform: scale(1);
    margin-top: 1.5rem !important;
}

.pricing-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.plan-badge {
    padding: 6px 16px;
    font-size: 0.7rem;
    white-space: nowrap;
    top: -12px;
}

.savings {
    padding: 0.5rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.8rem;
}

.price-tag {
    margin-bottom: 1rem;
}

.price {
    font-size: 2.5rem;
}

.price-features {
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.price-features li {
    padding: 0.875rem 0;
    gap: 0.75rem;
}

.btn-large {
    padding: 0.875rem 2rem;
    font-size: 0.95rem;
    margin-top: 1.25rem;
}

.price-note {
    margin-top: 1.25rem;
    font-size: 0.8rem;
}

/* ========== FOOTER ========== */
.footer {
    padding: 20px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 2rem;
    row-gap: var(--mobile-footer-sections-gap);
    text-align: left;
    margin-bottom: 2rem;
    padding: 0;
}

.footer-section:first-child {
    grid-column: 1 / -1;
    text-align: center;
    margin-bottom: 0.5rem;
}

.footer-section:first-child .social-links {
    justify-content: center;
}

.footer-section {
    padding: 0 0.5rem;
}

.footer-section h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
}

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

.footer-logo h4 {
    margin-bottom: 0;
    font-size: 1.3rem;
}

.footer-logo-img {
    width: 26px;
    height: 26px;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.social-links {
    gap: 1.75rem;
    margin-top: 1rem;
}

.social-links a svg {
    width: 24px;
    height: 24px;
}

/* ========== BUTTONS & TYPOGRAPHY ========== */
.btn {
    font-size: 0.9rem;
    padding: 0.75rem 1.5rem;
}

p {
    font-size: 0.9rem;
    line-height: 1.6;
}

h3 {
    font-size: 1.25rem;
}

/* ========== OVERFLOW PREVENTION ========== */
* {
    max-width: 100%;
}

/* ========== EXTRA SMALL DEVICES ========== */
@media (max-width: 480px) {
    .hero-title {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .hero-stats {
        gap: 1rem;
    }
    
    .stat-number {
        font-size: 1.25rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    .iphone-mockup {
        width: 280px;
    }
    
    .screenshot-phone {
        width: 70vw;
        max-width: 280px;
    }
    
    .pricing-card {
        padding: 1.25rem;
    }
    
    .price {
        font-size: 2rem;
    }
}

/* ========== CRITICAL NAVBAR FIX ========== */
/* Force navbar to stay fixed on mobile - must be last to override everything */
@media (max-width: 768px) {
    .navbar,
    .navbar.scrolled,
    .navbar.hide,
    .navbar.hidden,
    .navbar.scroll-up,
    .navbar.scroll-down {
        position: fixed !important;
        position: -webkit-fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        transform: none !important;
        transform: translateY(0) !important;
        -webkit-transform: translateY(0) !important;
        opacity: 1 !important;
        visibility: visible !important;
        display: block !important;
        will-change: auto !important;
        transition: background-color 0.3s ease, box-shadow 0.3s ease !important;
        padding: 0.5rem 0 !important;
        height: auto !important;
        min-height: unset !important;
        max-height: unset !important;
    }
    
    .navbar .nav-wrapper {
        padding: 0.5rem 0 !important;
    }
    
    body {
        padding-top: 60px !important;
    }
    
    .mobile-menu {
        top: 60px !important;
    }
    
    /* Prevent any animations that might cause sliding */
    .navbar * {
        animation: none !important;
    }
    
    /* iOS specific fixes */
    @supports (-webkit-touch-callout: none) {
        .navbar {
            position: fixed !important;
            -webkit-transform: translateZ(0) !important;
            transform: translateZ(0) !important;
        }
    }
}