/* Responsive Styles */

/* Tablet */
@media (max-width: 1024px) {
    :root {
        --font-size: 1.1rem;
    }

    body {
        font-size: 1.1rem;
    }

    #terminal-container {
        padding: 1.5rem;
    }

    .ascii-art {
        font-size: 0.5rem;
    }

    .tagline {
        font-size: 1.2rem;
    }

    .section-header {
        font-size: 1.2rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    :root {
        --font-size: 1rem;
    }

    body {
        font-size: 1rem;
    }

    #terminal-container {
        padding: 1rem;
    }

    .ascii-art {
        font-size: 0.4rem;
        overflow-x: auto;
    }

    .tagline {
        font-size: 1rem;
        letter-spacing: 0.05em;
    }

    .subtitle {
        font-size: 0.9rem;
    }

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

    .operator-header,
    .module-name {
        font-size: 1.1rem;
    }

    .file-name {
        font-size: 1.1rem;
    }

    /* Make input line stack on very small screens */
    .input-line {
        flex-wrap: wrap;
    }

    .prompt {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    #terminal-input {
        width: 100%;
    }

    /* Mobile keyboard handling - ensure input visible */
    #output {
        padding-bottom: 150px; /* Extra space for mobile keyboard */
    }

    .input-line {
        position: sticky;
        bottom: 0;
        background: var(--bg);
        padding: 1rem 0;
        z-index: 10;
    }

    /* Adjust AI message position */
    .ai-message {
        bottom: 20px;
        right: 10px;
        left: 10px;
        max-width: none;
        font-size: 0.9rem;
    }

    /* Form adjustments */
    .form-submit {
        width: 100%;
        padding: 0.8rem;
    }

    /* Reduce margins */
    .operator,
    .service-module,
    .project-file {
        padding: 0.8rem;
    }

    .module-features {
        padding-left: 0.5rem;
        font-size: 0.95rem;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    body {
        font-size: 0.95rem;
    }

    #terminal-container {
        padding: 0.8rem;
    }

    .ascii-art {
        font-size: 0.35rem;
    }

    .tagline {
        font-size: 0.9rem;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .boot-line {
        font-size: 0.95rem;
    }

    .section-header {
        font-size: 1rem;
    }

    .operator-header,
    .module-name,
    .file-name {
        font-size: 1rem;
    }

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

    .form-input,
    .form-textarea {
        font-size: 1rem;
        padding: 0.6rem;
    }
}

/* Landscape Mobile */
@media (max-width: 896px) and (orientation: landscape) {
    #terminal-container {
        padding: 1rem 2rem;
    }

    .ascii-art {
        font-size: 0.4rem;
    }

    #output {
        min-height: 100px;
    }
}

/* High DPI Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .crt-overlay {
        background: repeating-linear-gradient(
            0deg,
            rgba(0, 0, 0, 0.1),
            rgba(0, 0, 0, 0.1) 1px,
            transparent 1px,
            transparent 2px
        );
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .scanlines {
        animation: none;
    }

    .cursor {
        animation: none;
        opacity: 1;
    }

    #matrix-rain {
        display: none;
    }
}

/* Print Styles */
@media print {
    .crt-overlay,
    .scanlines,
    .vignette,
    #matrix-rain,
    #code-stream,
    .ai-message,
    .input-line {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .ascii-art,
    .tagline,
    .prompt,
    .section-header {
        text-shadow: none;
        color: black;
    }
}

/* Dark Mode Override (if user has dark mode preference) */
@media (prefers-color-scheme: dark) {
    /* Already dark by default, but can add specific overrides */
}

/* Light Mode Override (for accessibility) */
body.light-mode {
    --bg-primary: #f0f0f0;
    --text-primary: #003300;
    --text-glow: #003300;
    --accent: #006600;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --text-primary: #00ff00;
        --accent: #00ff00;
    }

    .crt-overlay,
    .scanlines,
    .vignette {
        opacity: 0.5;
    }
}
