/* Mobile-Optimized Luxury UI */

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.mobile-menu-toggle svg {
    width: 28px;
    height: 28px;
}

/* Mobile Navigation Overlay */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .navbar-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--bg-primary);
        flex-direction: column;
        padding: 5rem 2rem 2rem;
        gap: 1.5rem;
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.2);
        transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        z-index: 1000;
        overflow-y: auto;
    }

    .navbar-menu.active {
        right: 0;
        animation: slideInRight 0.4s ease-out;
    }

    .navbar-menu li {
        width: 100%;
    }

    .navbar-link, .navbar-menu .btn {
        width: 100%;
        display: block;
        padding: 1rem;
        text-align: center;
        border-radius: var(--radius-lg);
        transition: all 0.3s ease;
    }

    .navbar-link:hover {
        background: var(--bg-secondary);
        transform: translateX(5px);
    }

    /* Mobile menu backdrop */
    .mobile-menu-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(5px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
        z-index: 999;
    }

    .mobile-menu-backdrop.active {
        opacity: 1;
        pointer-events: all;
    }

    /* Hero adjustments for mobile */
    .hero {
        min-height: 100svh; /* Use svh for mobile browsers */
        padding: 2rem 1rem;
    }

    .hero-title {
        font-size: clamp(2rem, 10vw, 3rem) !important;
        animation: float 3s ease-in-out infinite; /* Simpler animation for mobile */
    }

    .hero-subtitle {
        font-size: 1rem !important;
        line-height: 1.6;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
        gap: 1rem;
    }

    .hero-btn {
        width: 100%;
        padding: 1rem 1.5rem !important;
        justify-content: center;
        font-size: 1rem !important;
    }

    /* Disable heavy animations on mobile */
    .hero {
        animation: none !important;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }

    .feature-icon {
        animation: float 3s ease-in-out infinite !important; /* Simple float only */
    }

    /* Optimize card grid for mobile */
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }

    .card {
        margin-bottom: 1rem;
    }

    /* Better touch targets */
    .btn, .hero-btn, .navbar-link {
        min-height: 44px;
        min-width: 44px;
    }

    /* Package cards mobile optimization */
    .package-card {
        padding: 1.5rem !important;
    }

    .package-size {
        font-size: 1.75rem !important;
    }

    .package-price {
        font-size: 1.25rem !important;
    }

    /* Stats section mobile */
    .stat-number {
        font-size: 2rem !important;
    }

    .stat-label {
        font-size: 0.875rem !important;
    }

    /* Features section mobile */
    .features {
        padding: 3rem 0 !important;
    }

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

    .feature-icon {
        width: 3rem !important;
        height: 3rem !important;
        font-size: 1.5rem !important;
    }

    /* Stats section mobile */
    .stats {
        padding: 3rem 0 !important;
    }

    /* CTA section mobile */
    .cta-section {
        padding: 3rem 0 !important;
    }

    /* Footer mobile */
    footer {
        padding: 2rem 0 !important;
        margin-top: 2rem !important;
    }

    footer .grid-cols-3 {
        gap: 2rem;
    }

    /* Form inputs mobile */
    .form-input,
    .form-select,
    .form-textarea {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }

    /* Modal mobile */
    .modal-content {
        width: 95% !important;
        max-height: 85vh;
        padding: 1.5rem !important;
    }

    /* Table mobile - horizontal scroll */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        min-width: 600px;
    }

    /* Reduce particle count on mobile */
    canvas {
        opacity: 0.5; /* Make particles less distracting */
    }
}

/* Touch-specific enhancements */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .card:hover,
    .feature-card:hover,
    .package-card:hover {
        transform: none !important;
    }

    /* Add tap feedback instead */
    .card:active,
    .btn:active,
    .hero-btn:active {
        transform: scale(0.97);
        opacity: 0.9;
    }

    /* Larger touch targets */
    .btn, .hero-btn {
        padding: 1rem 2rem;
    }

    /* Disable complex animations on touch devices */
    * {
        animation-duration: 0.5s !important; /* Speed up all animations */
    }
}

/* Small mobile (iPhone SE, etc) */
@media (max-width: 375px) {
    .hero-title {
        font-size: 1.75rem !important;
    }

    .hero-subtitle {
        font-size: 0.875rem !important;
    }

    .container {
        padding: 0 1rem;
    }

    .navbar-brand {
        font-size: 1.125rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
    }

    .stat-number {
        font-size: 1.75rem !important;
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        padding: 1rem;
    }

    .hero-content {
        padding: 1rem 0;
    }

    .features,
    .stats,
    .cta-section {
        padding: 2rem 0 !important;
    }
}

/* iOS specific fixes */
@supports (-webkit-touch-callout: none) {
    .hero {
        min-height: -webkit-fill-available;
    }

    /* Fix iOS input zoom */
    input, select, textarea {
        font-size: 16px !important;
    }

    /* Fix iOS safe area */
    .navbar {
        padding-top: env(safe-area-inset-top);
    }

    .navbar-menu {
        padding-top: calc(5rem + env(safe-area-inset-top));
    }
}

/* Android specific fixes */
@media screen and (-webkit-min-device-pixel-ratio: 0) and (min-resolution: .001dpcm) {
    /* Better scrolling on Android */
    .modal-content,
    .navbar-menu {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
}

/* Performance optimization for mobile */
@media (max-width: 768px) {
    /* Reduce shadow complexity */
    .card,
    .btn,
    .hero-btn {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    }

    /* Simplify transitions */
    * {
        transition-duration: 0.2s !important;
    }

    /* Disable particle system on very small devices */
    @media (max-width: 375px) {
        canvas {
            display: none !important;
        }
    }
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Pull-to-refresh support */
body {
    overscroll-behavior-y: contain;
}

/* Mobile-friendly modal */
@media (max-width: 768px) {
    .modal {
        padding: 1rem;
    }

    .auth-card {
        padding: 2rem 1.5rem !important;
        width: 95%;
    }

    .auth-logo {
        font-size: 1.5rem !important;
    }
}

/* Improved mobile form layout */
@media (max-width: 768px) {
    .form-group {
        margin-bottom: 1.25rem;
    }

    .form-label {
        font-size: 0.875rem;
    }

    .form-input,
    .form-select {
        padding: 0.875rem;
    }
}

/* Better mobile footer */
@media (max-width: 768px) {
    footer h4 {
        font-size: 1.125rem;
        margin-bottom: 0.75rem;
    }

    footer p,
    footer a {
        font-size: 0.875rem;
        line-height: 1.8;
    }
}
