/*
 * VibeCreAI Responsive Styles
 * Mobile and tablet breakpoints and responsive adjustments
 */

/* Tablet and Mobile Breakpoint (768px and below) */
@media (max-width: 768px) {
    /* Source Code Terminal Mobile */
    .source-code-terminal {
        width: 95vw;
        max-height: 0;
        margin: 15px auto 0;
    }
    
    .source-code-terminal.active {
        max-height: 520px;
        padding: 0 15px 15px 15px;
    }
    
    .terminal-content {
        font-size: 0.8rem;
        line-height: 1.3;
        padding-top: 40px;
    }
    
    .terminal-cursor {
        width: 10px;
        height: 16px;
    }
    
    .terminal-next-text {
        padding: 2px 4px;
        margin: -2px -4px;
    }
    
    /* Mobile Hero Height Adjustment */
    body.terminal-active:not(.game-modal-open) .hero {
        height: calc(100vh + 150px);
    }
    
    body.terminal-active .cta-container {
        z-index: 1002;
        margin-bottom: 30px;
        padding-top: 20px;
    }
    
    body.terminal-active .cta-button {
        position: relative;
        z-index: 1003;
        pointer-events: auto;
        touch-action: manipulation;
    }
    
    /* Header Mobile */
    header {
        padding: 20px 20px;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .nav-links {
        display: none;
        position: fixed;
        top: 0;
        right: 0;
        width: 300px;
        height: 100vh;
        background: rgba(0, 0, 0, 0.95);
        backdrop-filter: blur(15px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        z-index: 1000;
        border-left: 2px solid var(--primary-color);
        transform: translateX(100%);
        transition: transform 0.3s ease, opacity 0.3s ease;
    }
    
    .nav-links.active {
        display: flex;
        transform: translateX(0);
        opacity: 1;
    }
    
    .nav-links li {
        margin: 0;
    }
    
    .nav-links a {
        font-size: 1.2rem;
        padding: 1rem 2rem;
        border-radius: 10px;
        transition: all 0.3s ease;
        text-align: center;
        min-width: 150px;
    }
    
    .nav-links a:hover {
        background: rgba(0, 255, 255, 0.1);
        transform: scale(1.05);
    }
    
    /* About Grid Mobile */
    .about-grid {
        gap: 30px;
    }
    
    /* App Showcase Mobile */
    .app-showcase {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 30px;
        margin-top: 40px;
    }
    
    .app-card {
        padding: 20px;
    }
    
    .app-icon-wrapper {
        width: 80px;
        height: 80px;
        margin: 0 auto 15px;
    }
    
    .app-title {
        font-size: 1.3rem;
        margin-bottom: 12px;
    }
    
    .app-description {
        font-size: 0.9rem;
        line-height: 1.5;
        margin-bottom: 20px;
    }
    
    /* Contact Form Mobile */
    .form-group {
        gap: 10px;
    }
    
    .form-group input {
        min-width: 200px;
    }
    
    .form-group button {
        padding: 15px 25px;
        font-size: 0.9rem;
    }
    
    .contact-info {
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }
}

/* Desktop Navigation - Show header menu, hide hamburger (769px and above) */
@media (min-width: 769px) {
    .menu-toggle {
        display: none !important;
    }
    
    .nav-links {
        display: flex !important;
        position: static !important;
        width: auto !important;
        height: auto !important;
        background: transparent !important;
        flex-direction: row !important;
        backdrop-filter: none !important;
        padding: 0 !important;
        gap: 30px !important;
        transform: none !important;
        opacity: 1 !important;
    }
    
    .nav-links li {
        transform: none !important;
        opacity: 1 !important;
    }
    
    .nav-links a {
        color: var(--text-color) !important;
        font-size: 1rem !important;
        padding: 5px 10px !important;
    }
}

/* Very Narrow Screen Optimizations (480px and below) */
@media (max-width: 480px) {
    body.terminal-active:not(.game-modal-open) .hero {
        height: calc(100vh + 150px);
    }
    
    body.terminal-active .cta-container {
        z-index: 1002;
        margin-bottom: 30px;
        padding-top: 20px;
    }
    
    body.terminal-active .cta-button {
        position: relative;
        z-index: 1003;
        pointer-events: auto;
        touch-action: manipulation;
    }
    
    .app-showcase {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 10px;
    }
    
    .app-card {
        padding: 15px;
        margin: 0 5px;
    }
    
    .form-group {
        flex-direction: column;
        gap: 15px;
    }
    
    .form-group input {
        max-width: 100%;
        min-width: unset;
    }
    
    .form-group button {
        padding: 15px 20px;
        font-size: 0.85rem;
    }
}

/* Hero Section Scaling for Very Narrow Screens (420px and below) */
@media (max-width: 420px) {
    .hero-content {
        transform: scale(0.95);
        transform-origin: center;
    }
    
    /* Prevent scaling from affecting game modals */
    .vibe-survivor-modal,
    .vibe-runner-modal,
    .runner-modal {
        transform: none !important;
    }
    
    .vibe-survivor-modal *,
    .vibe-runner-modal *,
    .runner-modal * {
        transform: none !important;
    }
    
    .hero-title {
        font-size: 5.7rem; /* 95% of 6rem */
    }
    
    .title-v, .title-c, .title-ai, .glitch {
        font-size: 5.7rem; /* 95% of 6rem */
    }
    
    .title-small {
        font-size: 4.56rem; /* 95% of 4.8rem */
    }
    
    .hero-subtitle {
        font-size: 1.425rem; /* 95% of 1.5rem */
    }
    
    .tagline {
        font-size: 1.14rem; /* 95% of 1.2rem */
        min-height: 2.375rem; /* 95% of 2.5rem */
    }
    
    .cta-button {
        padding: 14.25px 38px; /* 95% of 15px 40px */
        font-size: 0.95rem;
    }
}

/* Ultra Narrow Screen Optimizations (400px and below) */
@media (max-width: 400px) {
    .apps {
        padding: 100px 20px;
    }
    
    .app-showcase {
        padding: 0;
    }
    
    .form-group button {
        font-size: 0.8rem;
        letter-spacing: 0.05em;
    }
}