/* Mobile-specific styles for the RESPECT MY VPS website
   Optimized for mobile browsers and touch interactions */

/* Base mobile adjustments */
@media (max-width: 768px) {
    /* Global adjustments */
    body {
        font-size: 16px;
        -webkit-tap-highlight-color: transparent;
    }

    .container {
        padding: 0 15px;
    }

    /* Header adjustments */
    header {
        padding: 10px 0;
    }

    .logo {
        font-size: 1.8rem;
    }

    .logo-subtext {
        font-size: 0.7rem;
        bottom: -0.4rem;
    }

    /* Mobile navigation */
    .nav-links {
        position: fixed;
        flex-direction: column;
        top: 60px;
        left: 0;
        width: 100%;
        background-color: rgba(5, 5, 24, 0.98);
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.7);
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease, padding 0.3s ease;
        z-index: 999;
    }

    .nav-links.active {
        max-height: 80vh; /* Use viewport height to ensure all links fit */
        padding: 15px 0;
        border-top: 2px solid var(--primary);
        border-bottom: 2px solid var(--primary);
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.8), 
                    inset 0 0 10px rgba(0, 187, 255, 0.1);
        display: flex;
        flex-direction: column;
        align-items: center;
        overflow-y: auto; /* Enable scrolling */
        -webkit-overflow-scrolling: touch; /* Better scrolling on iOS */
    }

    .nav-links li {
        width: 100%;
        text-align: center;
        opacity: 0;
        transform: translateY(-10px);
        transition: opacity 0.3s ease, transform 0.3s ease;
    }

    .nav-links.active li {
        opacity: 1 !important; /* Force visibility */
        transform: translateY(0) !important;
        display: block !important;
    }

    .nav-links.active li:nth-child(1) { transition-delay: 0.05s; }
    .nav-links.active li:nth-child(2) { transition-delay: 0.1s; }
    .nav-links.active li:nth-child(3) { transition-delay: 0.15s; }
    .nav-links.active li:nth-child(4) { transition-delay: 0.2s; }
    .nav-links.active li:nth-child(5) { transition-delay: 0.25s; }
    .nav-links.active li:nth-child(6) { transition-delay: 0.3s; }

    .nav-link {
        display: block;
        padding: 12px 0;
        width: 100%;
        font-size: 1.1rem;
    }

    /* Add visual feedback for active nav items */
    .nav-link:active {
        background-color: rgba(0, 217, 232, 0.1);
        text-shadow: 0 0 8px var(--primary-glow);
    }

    /* Enhanced menu button for better touch */
    .menu-button {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 44px;
        height: 44px;
        padding: 10px;
        border-radius: 6px;
        background: rgba(5, 5, 24, 0.9);
        border: 1px solid var(--primary);
        box-shadow: 0 0 12px var(--primary-glow);
        transition: all 0.2s ease;
        color: var(--primary);
        font-size: 1.3rem;
        -webkit-tap-highlight-color: transparent;
    }

    .menu-button:active {
        transform: scale(0.95);
        box-shadow: 0 0 5px var(--primary-glow);
    }
    
    /* Active state for menu button */
    .menu-button-active {
        color: var(--secondary) !important;
        text-shadow: 0 0 10px var(--secondary-glow);
        background: rgba(5, 5, 24, 0.95);
        border-color: var(--secondary);
        box-shadow: 0 0 15px var(--secondary-glow);
    }

    /* Content sections */
    .section-header h1 {
        font-size: 2.5rem;
    }

    .section-header p {
        font-size: 1.1rem;
    }

    /* Contact links */
    .contact-links {
        flex-direction: column;
        align-items: center;
    }
    
    .contact-link {
        width: 90%;
        max-width: 300px;
        margin-bottom: 2rem;
        padding: 2rem 1.5rem;
    }

    .contact-link i {
        margin-bottom: 1rem;
    }
    
    /* Audio controls - larger touch target and visible position */
    #audio-controls {
        bottom: 30px;
        right: 20px;
    }
    
    .cyberpunk-btn {
        width: 50px;
        height: 50px;
        border-width: 2px;
        font-size: 1.2rem;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .ultra-glitch {
        font-size: 2.2rem !important;
    }
    
    .neon-pulse {
        font-size: 1.1rem;
    }
    
    /* Hide copyright and footer on mobile */
    footer {
        display: none;
    }
    
    /* Additional small device nav improvements */
    .nav-links.active {
        max-height: calc(100vh - 60px - 75px) !important; /* Force all items to fit on screens, excluding top header and bottom space */
        height: auto !important;
        position: fixed;
        top: 60px;
        overflow-y: auto;
        padding-bottom: 20px; /* Add some padding at the bottom */
    }
    
    /* Ensure contact section expands properly */
    #contact-section.hero {
        padding-bottom: 120px; /* Extra padding at the bottom for small devices */
        height: auto !important; /* Force height auto */
        min-height: 100vh; /* Ensure it takes at least full viewport height */
    }
}
    
    .nav-links li {
        margin: 5px 0;
        padding: 8px 0;
    }
    
    .nav-link {
        padding: 12px 20px; /* Larger touch target */
        display: block;
    }

    /* Audio button moves to bottom center for thumb reach */
    #audio-controls {
        bottom: 20px;
        right: 50%;
        transform: translateX(50%);
    }
    
    .cyberpunk-btn {
        width: 55px;
        height: 55px;
        border-radius: 50%;
    }
    
    /* Optimize animations for mobile to reduce battery drain */
    @keyframes scanline {
        0% { transform: translateY(-120%); }
        100% { transform: translateY(120vh); }
    }
    
    /* Optimize glitch effects to be less CPU intensive */
    @keyframes glitch {
        0%, 100% { transform: translate(0); }
        33% { transform: translate(-3px, 3px); }
        66% { transform: translate(3px, -3px); }
    }
}

/* Touch-specific optimizations */
@media (hover: none) {
    /* Reduce hover states and optimize for touch */
    .contact-link {
        transition: transform 0.3s ease;
    }
    
    .contact-link:active {
        transform: scale(0.97);
    }
    
    /* Show some effects permanently rather than on hover */
    .cyberpunk-style .cyber-glitch-box,
    .neotech-style .neotech-circuit,
    .tech-style .tech-grid {
        opacity: 0.1;
    }
    
    /* Adding a subtle touch feedback */
    .nav-link:active::after,
    .contact-link:active,
    .cyberpunk-btn:active {
        transform: scale(0.97);
        opacity: 0.9;
        transition: transform 0.1s ease, opacity 0.1s ease;
    }
}

/* Fix for iOS notch devices */
@supports (padding-top: env(safe-area-inset-top)) {
    header {
        padding-top: env(safe-area-inset-top);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    
    #audio-controls {
        bottom: calc(20px + env(safe-area-inset-bottom));
    }
}

/* Portrait orientation specific adjustments */
@media (max-width: 768px) and (orientation: portrait) {
    .hero {
        min-height: 85vh; /* Changed from fixed height to min-height */
        height: auto; /* Allow it to expand as needed */
    }
    
    #contact-section.hero {
        padding-top: 80px; /* Ensure content doesn't hide under header */
        padding-bottom: 100px; /* Add padding at the bottom */
    }
}

/* Landscape orientation specific adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        height: auto; /* Allow it to expand as needed */
    }
    
    header {
        padding: 5px 0;
    }
    
    .contact-links {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .contact-link {
        width: 45%;
        margin: 1%;
        padding: 1.5rem 1rem;
    }
    
    #contact-section.hero {
        padding-bottom: 80px; /* Add padding at bottom for landscape */
    }
}

/* Additional mobile menu improvements */
.nav-links a i {
    font-size: 1.2rem;
    margin-right: 5px;
}

/* Fix for sticky hover effects on mobile */
@media (hover: hover) {
    .cyberpunk-btn:hover {
        transform: scale(1.05);
    }
}