/* ==========================================================================
   PREMIUM MOBILE-FIRST OVERRIDE SHEET
   "Rebuilt from Scratch" for Mobile Devices (max-width: 768px)
   ========================================================================== */

@media (max-width: 768px) {

    /* ----------------------------------
       1. RESET & LAYOUT FOUNDATIONS
       ---------------------------------- */
    :root {
        --mobile-padding: 24px;
        --header-height: 70px;
        --card-radius: 16px;
    }

    html, body {
        overflow-x: hidden !important;
        overflow-y: auto; /* Force vertical scroll */
        width: 100% !important;
        max-width: 100% !important;
        position: relative;
        cursor: auto;
        -webkit-overflow-scrolling: touch; /* Smooth scroll on iOS */
        height: auto; /* Allow body to grow */
        min-height: 100vh;
        margin: 0;
        padding: 0;
    }

    .container {
        width: 100%;
        padding: 0 var(--mobile-padding);
        max-width: 100%;
    }

    section {
        padding: 60px 0;
        overflow: visible; /* Fix: Allow content to flow */
    }

    /* Disable Desktop Cursor Effects */
    .cursor, .cursor-follower {
        display: none !important;
    }

    /* ----------------------------------
       2. NAVIGATION (App-Like Header)
       ---------------------------------- */
    .navbar {
        height: var(--header-height);
        background: rgba(10, 10, 10, 0.95); /* Darker, less transparent for readability */
        backdrop-filter: blur(20px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .nav-container {
        padding: 0 var(--mobile-padding);
    }

    .nav-logo {
        font-size: 24px;
    }

    /* Full Screen Menu Overlay */
    .nav-menu {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        height: calc(100vh - var(--header-height));
        background: #000000;
        display: flex !important;
        flex-direction: column;
        justify-content: flex-start;
        padding: 40px var(--mobile-padding);
        padding-bottom: 200px; /* Extra space for resume/profile at bottom */
        gap: 30px;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        z-index: 99999 !important;
        overflow-y: auto; /* Enable scrolling */
        -webkit-overflow-scrolling: touch;
    }

    /* ----------------------------------
       3. HERO SECTION (Clean & Centered)
       ---------------------------------- */
    .hero {
        min-height: 100vh; /* Full viewport */
        padding-top: var(--header-height);
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .hero-content {
        padding: 0 var(--mobile-padding);
        width: 100%;
    }

    .hero-badge {
        margin: 0 auto 20px;
        padding: 8px 16px;
        width: fit-content;
    }

    .hero-title {
        margin-bottom: 20px;
    }

    .hero-title .title-line {
        font-size: 24px;
        display: block;
        margin-bottom: 10px;
        color: #888;
    }

    /* Ensure Hamburger is Visible */
    /* Ensure Hamburger is Visible & Colored */
    .nav-toggle {
        display: flex !important;
        flex-direction: column;
        gap: 6px;
        cursor: pointer;
        z-index: 9999 !important; /* Max z-index */
        padding: 10px; /* Increase touch area */
    }

    .nav-toggle span {
        width: 30px;
        height: 3px;
        background-color: #E50914 !important; /* Force Red */
        border-radius: 2px;
        transition: all 0.3s ease;
        display: block !important;
        opacity: 1 !important;
    }

    /* Active Hamburger State */
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 6px);
    }

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

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

    /* ==============================================
       CRITICAL VISIBILITY FIXES FOR HERO SECTION
       Force all elements to be visible, overriding desktop animations
       ============================================== */
    
    .hero-content,
    .hero-badge,
    .hero-title,
    .title-line,
    .title-name,
    .hero-roles,
    .role-text,
    .hero-description,
    .hero-cta,
    .btn {
        opacity: 1 !important;
        visibility: visible !important;
        animation: none !important;
        transform: none !important;
    }

    /* Specific Styling for Hero Elements */
    .hero-badge {
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        color: #fff;
    }

    .title-line {
        font-size: 24px;
        color: #ccc !important;
        margin-bottom: 5px;
        display: block;
    }

    /* AUTO GLITCH EFFECT */
    @keyframes autoGlitchOpacity {
        0%, 63% { opacity: 0; }
        64%, 100% { opacity: 0.8; }
    }

    .hero-title .title-name {
        font-size: 42px;
        line-height: 1.1;
        display: block;
        color: #ffffff !important;
        background: none !important;
        -webkit-text-fill-color: #ffffff !important;
        text-shadow: 0 2px 10px rgba(0,0,0,0.5);
        margin-bottom: 15px;
        position: relative;
    }

    /* Apply Auto Glitch */
    .hero-title .title-name::before,
    .hero-title .title-name::after {
        content: "Sameer Ali Khan"; /* Hardcoded for glitch stability */
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        opacity: 0;
        background: #000; /* Match bg to hide main text */
    }

    .hero-title .title-name::before {
        color: #0ff;
        animation: glitch-1 0.3s linear infinite, autoGlitchOpacity 11s linear infinite;
        z-index: -1;
    }

    .hero-title .title-name::after {
        color: #f0f;
        animation: glitch-2 0.3s linear infinite, autoGlitchOpacity 11s linear infinite;
        z-index: -2;
    }

    .hero-roles {
        font-size: 18px; /* Reduced from 20px */
        margin-bottom: 20px;
        justify-content: center;
        display: flex;
        flex-wrap: wrap; /* Allow wrapping if needed */
        gap: 8px;
        color: #E50914 !important; /* Primary Red */
    }

    .role-text {
        color: #ffffff !important;
        font-weight: 700;
        border-right: 2px solid #E50914;
    }

    .hero-description {
        font-size: 16px;
        line-height: 1.6;
        margin-bottom: 40px;
        padding: 0 10px;
        color: #bbb;
    }

    .hero-cta {
        flex-direction: column;
        gap: 15px;
        width: 100%;
    }

    .btn {
        width: 100%;
        padding: 16px;
        justify-content: center;
        font-size: 16px;
    }

    /* Hide complex background shapes on mobile to improve performance/cleanliness */
    .floating-shapes {
        opacity: 0.3;
    }

    /* ----------------------------------
       4. STATS GRID (2x2)
       ---------------------------------- */
    .hero-stats-cards {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
        margin-top: 40px;
    }

    .hero-stat-card {
        padding: 15px 10px; /* Reduce padding */
        text-align: center;
        background: rgba(255, 255, 255, 0.03);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .stat-number {
        font-size: 24px; /* Slightly smaller */
        margin-bottom: 5px;
    }

    .stat-label {
        font-size: 10px !important; /* Small enough to fit */
        white-space: normal; /* Allow wrap */
        word-wrap: break-word;
        line-height: 1.2;
        letter-spacing: 0.5px;
        width: 100%;
    }

    /* ----------------------------------
       5. NETFLIX CARDS (The "Feed" Look)
       ---------------------------------- */
    .netflix-row {
        display: flex;
        flex-direction: column;
        gap: 30px;
        padding: 0;
    }

    .netflix-card {
        /* Reset all desktop styles */
        height: auto !important;
        width: 100% !important;
        aspect-ratio: auto !important;
        transform: none !important;
        margin: 0 !important;
        background: #181818;
        border-radius: var(--card-radius);
        overflow: hidden;
        box-shadow: 0 10px 30px rgba(0,0,0,0.2);
        border: 1px solid rgba(255, 255, 255, 0.08);
        display: flex;
        flex-direction: column;
    }

    /* Image Area */
    .netflix-card-image {
        height: 220px !important;
        width: 100%;
        position: relative;
        filter: none !important; /* No dimming */
    }

    /* Content Area */
    .netflix-card-content {
        position: relative !important;
        opacity: 1 !important;
        transform: none !important;
        background: #181818 !important;
        padding: 24px !important;
        height: auto !important;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }

    /* Typography inside Card */
    .card-title {
        font-size: 22px !important;
        font-weight: 700;
        margin-bottom: 12px !important;
        color: #ffffff !important;
        text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    }

    .card-desc {
        font-size: 15px !important;
        line-height: 1.6 !important;
        color: #ffffff !important; /* Force White */
        margin-bottom: 20px !important;
        display: block !important;
        -webkit-line-clamp: unset !important; /* Show all text */
        line-clamp: unset !important;
        overflow: visible !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    /* Meta Tags */
    .card-meta {
        display: flex;
        gap: 10px;
        margin-bottom: 15px;
        flex-wrap: wrap;
    }

    .match-score {
        font-size: 14px;
    }

    /* Actions */
    .card-actions {
        margin-top: auto;
        padding-top: 15px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        display: flex;
        gap: 15px;
    }

    .action-btn {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    /* ----------------------------------
       6. SECTIONS & TITLES
       ---------------------------------- */
    .section-header {
        text-align: left;
        margin-bottom: 30px;
        padding-left: 10px;
        border-left: 4px solid var(--primary);
    }

    .section-title, .netflix-section-title {
        font-size: 28px;
        margin: 0;
        padding-left: 15px;
        border: none; /* Remove duplicate border */
    }

    /* ----------------------------------
       7. CONTACT FORM
       ---------------------------------- */
    .contact-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .contact-content {
        display: flex !important;
        flex-direction: column !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .contact-form {
        padding: 24px;
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
    }

    .form-group input, 
    .form-group textarea {
        padding: 14px;
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    /* ----------------------------------
       8. FOOTER
       ---------------------------------- */
    .footer {
        padding: 60px 0 100px; /* Extra bottom padding for mobile browsers */
        text-align: center;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 20px;
    }

    /* ----------------------------------
       9. DISABLE ANIMATIONS (AOS OVERRIDE)
       ---------------------------------- */
    [data-aos] {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }

    .contact-form, .contact-content, .contact-info {
        opacity: 1 !important;
        visibility: visible !important;
        display: block !important; /* Ensure block layout */
    }
       ---------------------------------- */
    .mobile-hidden {
        display: none !important;
    }
}
