/* ==============================================
   Mobile Optimization Overrides
   Target: Mobile Devices (< 768px)
============================================== */

/* Default: Hide Mobile Elements on Desktop */
.mobile-nav-menu,
.mobile-menu-overlay,
.bottom-floating-nav,
.hamburger-toggle {
    display: none !important;
}

@media screen and (max-width: 768px) {

    /* Enable Mobile Elements */
    .mobile-nav-menu,
    .mobile-menu-overlay,
    .bottom-floating-nav,
    .hamburger-toggle {
        display: flex !important;
    }

    .mobile-menu-overlay {
        display: block !important;
        /* Overlay is block, not flex */
    }

    .mobile-nav-menu {
        display: flex !important;
        flex-direction: column !important;
    }

    /* === GENERAL ADJUSTMENTS === */
    :root {
        --section-padding: 60px 0;
        /* Reduced from 100px */
        --container-padding: 0 20px;
    }

    body {
        overflow-x: hidden;
    }

    /* === HEADER & NAVIGATION === */
    .hero-header {
        padding: 20px;
        flex-direction: row;
        /* Row for logo + toggle */
        justify-content: space-between;
        align-items: center;
        gap: 0;
    }

    /* Restored Hamburger Styles */
    .hamburger-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 26px;
        height: 20px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 1001;
    }

    .hamburger-toggle span {
        width: 100%;
        height: 2px;
        background: #1a1a1a;
        border-radius: 2px;
        transition: all 0.3s ease;
    }

    /* Restored Mobile Menu Styles */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 2000;
        backdrop-filter: blur(4px);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .mobile-nav-menu {
        position: fixed;
        top: 0;
        right: -300px;
        width: 280px;
        height: 100%;
        background: #ffffff;
        z-index: 2001;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 30px 24px;
        /* Default hidden state is handled by global rule, layout here */
    }

    .mobile-nav-menu.active {
        right: 0;
    }

    .mobile-nav-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 40px;
        padding-bottom: 20px;
        border-bottom: 1px solid #f0f0f0;
    }

    .mobile-menu-close {
        background: none;
        border: none;
        font-size: 24px;
        color: #1a1a1a;
        cursor: pointer;
        padding: 5px;
    }

    .mobile-nav-links {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .mobile-nav-link {
        font-size: 1.1rem;
        font-weight: 500;
        color: #333;
        text-decoration: none;
        padding: 10px 0;
        border-bottom: 1px solid transparent;
        transition: color 0.2s;
    }

    .mobile-nav-link:hover {
        color: #4A90E2;
    }

    .mobile-nav-cta {
        margin-top: 20px;
        background: #1a1a1a;
        color: #fff;
        text-align: center;
        padding: 14px;
        border-radius: 12px;
        text-decoration: none;
        font-weight: 600;
        display: block;
    }

    /* Restored Bottom Nav Styles */
    .bottom-floating-nav {
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        width: 90%;
        max-width: 400px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border: 1px solid rgba(255, 255, 255, 0.5);
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
        border-radius: 24px;
        align-items: center;
        justify-content: space-around;
        padding: 10px 20px;
        z-index: 9999;
        transition: transform 0.3s ease;
    }

    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: #94a3b8;
        gap: 5px;
        font-size: 0.7rem;
        transition: all 0.2s ease;
        padding: 8px;
        border-radius: 12px;
        width: 60px;
    }

    .bottom-nav-item i {
        font-size: 1.25rem;
    }

    .bottom-nav-item.active {
        color: #4A90E2;
    }

    .nav-pills {
        width: 100%;
        overflow-x: auto;
        justify-content: flex-start;
        padding: 10px;
        -webkit-overflow-scrolling: touch;
        /* Smooth scroll */
        scrollbar-width: none;
        /* Firefox */
    }

    .nav-pills::-webkit-scrollbar {
        display: none;
        /* Chrome/Safari */
    }

    .nav-pill {
        white-space: nowrap;
        font-size: 0.85rem;
        padding: 8px 16px;
    }

    .cta-button {
        width: 100%;
        text-align: center;
        display: block;
    }

    /* === HERO SECTION === */
    .hero {
        padding-top: 140px;
        /* Space for stacked header */
        padding-bottom: 60px;
        align-items: center;
    }

    .hero-content {
        padding-top: 0;
    }

    .hero-title {
        font-size: 2.8rem;
        /* Explicit smaller size */
        margin-bottom: 15px;
    }

    .hero-subtitle {
        font-size: 1rem;
        padding: 0 10px;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
        gap: 15px;
    }

    .btn-primary-clean,
    .btn-ghost-clean {
        width: 100%;
        padding: 14px 20px;
    }

    /* === HERO 3D ELEMENTS === */
    .controller-container {
        width: 100%;
        margin-top: 30px;
        margin-bottom: 20px;
        transform: scale(0.9);
        /* Slight scale down */
    }

    .cursor-tag {
        display: none;
        /* Hide cursors on mobile to reduce clutter */
    }

    /* === VIBEA AI INTERFACE === */
    .vibea-feature {
        padding: 40px 0;
    }

    .glass-dashboard-container {
        border-radius: 16px;
        margin: 0 15px;
    }

    .dashboard-header {
        padding: 15px;
    }

    .dashboard-body {
        padding: 20px;
    }

    .ai-mode-selector {
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
    }

    .mode-btn {
        flex: 1;
        min-width: 80px;
        font-size: 0.8rem;
        padding: 8px 12px;
    }

    .prompt-input-container {
        margin-bottom: 20px;
    }

    .input-glass-wrapper {
        flex-direction: column;
        gap: 10px;
        padding: 0;
        background: transparent;
        border: none;
    }

    .premium-input {
        width: 100%;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 12px;
        padding: 15px;
        margin-bottom: 10px;
    }

    .premium-generate-btn {
        width: 100%;
        margin-left: 0;
        border-radius: 12px;
    }

    .suggestion-chips {
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 5px;
    }

    .chip {
        white-space: nowrap;
    }

    /* === AI RESULTS === */
    .generated-result-container {
        border-radius: 16px;
    }

    .result-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .result-actions {
        width: 100%;
        justify-content: flex-end;
    }

    /* === MODALS === */
    .modal-content {
        width: 95vw;
        max-height: 90vh;
        border-radius: 20px;
    }

    .modal-header {
        padding: 15px 20px;
    }

    .modal-footer {
        flex-direction: column;
        padding: 20px;
    }

    .modal-action-btn {
        width: 100%;
    }

    /* === TECH STACK === */
    .tech-logos-grid {
        gap: 30px;
    }

    .tech-logo-item {
        flex-direction: column;
        font-size: 0.9rem;
    }
}

/* === SMALL MOBILE (< 380px) === */
@media screen and (max-width: 380px) {
    .hero-title {
        font-size: 2.2rem;
    }
}