/* NUCLEAR REWRITE - Absolute Containment Guaranteed */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    background: #0a0a0a;
    color: #e0e0e0;
    min-height: 100vh;
    padding: 0;
    margin: 0;
    line-height: 1.4;
    font-size: 13px;
    overflow-x: hidden;
}

/* Terminal Container - STRICT BOUNDS */
.terminal-container {
    max-width: 850px;
    width: 100%;
    margin: 0 auto;
    background: #1e1e1e;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    position: relative;
}

/* Terminal Header */
.terminal-header {
    background: linear-gradient(to bottom, #3a3a3a 0%, #2d2d2d 100%);
    padding: 10px 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #1a1a1a;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.terminal-buttons {
    display: flex;
    gap: 8px;
}

.btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.btn-close {
    background: linear-gradient(135deg, #ff6057 0%, #ff3b30 100%);
}

.btn-minimize {
    background: linear-gradient(135deg, #ffbd44 0%, #ffac00 100%);
}

.btn-maximize {
    background: linear-gradient(135deg, #28cd41 0%, #20c035 100%);
}

.terminal-title {
    flex: 1;
    text-align: center;
    color: #8a8a8a;
    font-size: 12px;
}

/* Terminal Body - ABSOLUTE CONTAINMENT */
.terminal-body {
    background: #0f0f0f;
    padding: 3px 5px 3px 8px;
    min-height: 600px;
    height: 70vh;
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
    font-size: 13px;
    line-height: 1.4;
    color: #d4d4d4;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

/* Force all children to stay within bounds */
.terminal-body * {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Scrollbar */
.terminal-body::-webkit-scrollbar {
    width: 10px;
}

.terminal-body::-webkit-scrollbar-track {
    background: #1e1e1e;
}

.terminal-body::-webkit-scrollbar-thumb {
    background: #3e3e3e;
    border-radius: 5px;
}

/* Shell Output - CONTAINED */
.shell-output {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    color: #e0e0e0;
    width: 100%;
    overflow: hidden;
}

.shell-output pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    overflow: hidden;
}

/* Prompt Colors */
.prompt-path {
    color: #888;
}

.prompt-symbol {
    color: #0f0;
}

/* Links */
a {
    color: #5bc0de;
    text-decoration: none;
    word-break: break-all;
}

a:hover {
    text-decoration: underline;
    color: #7dd5ee;
}

/* ASCII Art Container for Shadow Effect */
.ascii-logo-container {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 20px;
    align-items: center;
    margin-bottom: 0;
}

/* ASCII Wrapper - contains shadow + main logo */
.ascii-wrapper {
    position: relative;
    display: inline-block;
}

/* ASCII Art Shadow - Gemini Style */
.ascii-logo-shadow {
    color: #2a2a2a;
    font-size: 10px;
    line-height: 1.0;
    margin: 0;
    padding: 0;
    font-weight: normal;
    white-space: pre;
    display: block;
    position: absolute;
    top: 2px;
    left: 2px;
    z-index: 1;
    opacity: 0.5;
}

/* ASCII Art Main - Gemini Style */
.ascii-logo {
    color: #ff9966;
    font-size: 10px;
    line-height: 1.0;
    margin: 0;
    padding: 0;
    font-weight: normal;
    white-space: pre;
    display: block;
    position: relative;
    z-index: 2;
}

/* Subtitle - matches ASCII logo width */
.subtitle {
    color: #888;
    font-size: 11px;
    margin: 8px 0 4px 0;
    padding: 0;
    line-height: 1.2;
    max-width: 82ch; /* Matches ASCII logo character width */
}

/* Bio Text - positioned to the right of ASCII */
.bio-text {
    color: #aaa;
    font-size: 10px;
    margin: 0;
    padding: 0 0 0 10px;
    line-height: 1.5;
    max-width: 400px;
    font-style: italic;
    align-self: center;
}

/* Gradient bar under logo */
.gradient-bar {
    background: linear-gradient(90deg, #ff9966 0%, #ff5e62 50%, #cc3366 100%);
    height: 4px;
    width: 100%;
    max-width: 500px;
    margin: 0;
    padding: 0;
    display: block;
}


/* Info Boxes Container - STRICT LAYOUT */
.info-boxes-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin: 4px 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
}

/* Individual Info Box - NUCLEAR CONTAINMENT */
.info-box {
    border: 1px solid #3a3a3a;
    border-radius: 2px;
    padding: 4px 6px;
    background: rgba(20, 20, 20, 0.8);
    overflow: hidden;
    position: relative;
    min-height: 55px;
    margin: 0;
}

.info-box-header {
    color: #ff9966;
    font-weight: bold;
    margin: 0;
    padding: 0 0 1px 0;
    border-bottom: 1px solid #3a3a3a;
    font-size: 11px;
    line-height: 1.0;
}

.info-box-content {
    color: #b0b0b0;
    font-size: 11px;
    line-height: 1.35;
    word-wrap: break-word;
    overflow-wrap: break-word;
    margin: 0;
    padding: 1px 0 0 0;
}

.info-box-content br {
    display: block;
    content: "";
    margin: 0;
    padding: 0;
    line-height: 0;
}

.info-box-content * {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Legend Container */
.legend-container {
    margin: 6px 0 0 0;
    border: 1px solid #3a3a3a;
    border-radius: 2px;
    padding: 4px 6px;
    background: rgba(20, 20, 20, 0.8);
    overflow: hidden;
    max-width: 100%;
}

.legend-container pre {
    color: #888;
    font-size: 11px;
    line-height: 1.2;
    margin: 0;
    padding: 1px 0 0 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Input Line */
.input-line {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.command-input {
    background: transparent;
    border: none;
    color: #e0e0e0;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    outline: none;
    flex: 1;
    caret-color: #61c9d2;
}

/* Command Output */
.command-line {
    margin: 2px 0;
    padding: 0;
}

.command-text {
    color: #d4d4d4;
}

/* Section Headers */
.section-header {
    color: #e5c07b;
    font-weight: bold;
    margin: 5px 0 3px;
    padding: 0;
}

/* Status Messages */
.success {
    color: #56b6c2;
}

.error {
    color: #e06c75;
}

.warning {
    color: #e5c07b;
}

.comment {
    color: #5c6370;
}

/* Footer */
.page-footer {
    max-width: 850px;
    margin: 10px auto;
    text-align: center;
    color: #5c6370;
    font-size: 11px;
}

.page-footer p {
    margin: 3px 0;
}

.page-footer a {
    color: #61afef;
}

/* Animation */
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.typing-cursor {
    animation: blink 1s infinite;
}

/* Mobile Optimization */
@media (max-width: 768px) {
    body {
        padding: 0;
        margin: 0;
        font-size: 12px;
    }
    
    .terminal-container {
        margin: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 0;
    }
    
    .terminal-body {
        padding: 3px;
        font-size: 12px;
        min-height: 500px;
        height: 75vh;
        max-height: 75vh;
    }
    
    .ascii-logo-shadow {
        font-size: 9px;
        line-height: 0.85;
    }
    
    .ascii-logo {
        font-size: 9px;
        line-height: 0.85;
    }
    
    .ascii-logo-container {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .bio-text {
        padding: 10px 0 0 0;
        max-width: 100%;
        font-size: 9px;
    }
    
    .gradient-bar {
        height: 5px;
    }
    
    .info-boxes-container {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    
    .info-box {
        padding: 3px 4px;
    }
    
    .info-box-header,
    .info-box-content,
    .legend-container pre {
        font-size: 10px;
        line-height: 1.1;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0;
        margin: 0;
        font-size: 11px;
    }
    
    .terminal-body {
        padding: 2px;
        font-size: 11px;
        height: 80vh;
        max-height: 80vh;
    }
    
    .ascii-logo-shadow {
        font-size: 8px;
        line-height: 0.8;
    }
    
    .ascii-logo {
        font-size: 8px;
        line-height: 0.8;
    }
    
    .gradient-bar {
        height: 4px;
    }
    
    .info-box {
        padding: 2px 3px;
    }
    
    .info-box-header,
    .info-box-content,
    .legend-container pre {
        font-size: 9px;
        line-height: 1.0;
    }
}

/* ======================================================================== */
/* 90s HACKER MOVIE AESTHETICS - Scanlines, CRT, Screen Glow               */
/* ======================================================================== */

/* Scanlines overlay - subtle CRT monitor effect */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0) 50%,
        rgba(0, 0, 0, 0.1) 51%
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.05;
    animation: scanlines 8s linear infinite;
}

@keyframes scanlines {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

/* Screen flicker effect - very subtle */
.terminal-container {
    animation: flicker 3s infinite;
}

@keyframes flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.97; }
    75% { opacity: 0.99; }
}

/* Phosphor glow on text - green terminal glow */
.success, .comment {
    text-shadow: 0 0 2px currentColor, 0 0 5px rgba(0, 255, 100, 0.3);
}

/* Enhanced glow for success messages */
.success {
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        text-shadow: 0 0 2px #0f0, 0 0 5px rgba(0, 255, 0, 0.4);
    }
    to {
        text-shadow: 0 0 3px #0f0, 0 0 8px rgba(0, 255, 0, 0.6);
    }
}

/* Matrix-style data stream effect for AI thinking */
@keyframes matrix-rain {
    0% { transform: translateY(-100%); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(100vh); opacity: 0; }
}

/* CRT screen curvature - very subtle (optional, can be removed if too much) */
.terminal-container {
    transform: perspective(1000px) rotateX(0.5deg);
}

/* Neon border glow effect */
.terminal-container {
    box-shadow: 
        0 0 5px rgba(0, 255, 100, 0.1),
        0 10px 50px rgba(0, 0, 0, 0.5),
        inset 0 0 20px rgba(0, 255, 100, 0.02);
}

/* Grid background pattern - subtle cyberpunk grid */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 255, 100, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 100, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: -1;
}

/* Enhanced prompt with glow */
.command-line::before {
    text-shadow: 0 0 5px rgba(0, 255, 200, 0.5);
}

/* Error messages - red alert style */
.error {
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
    animation: alert-pulse 1s ease-in-out infinite;
}

@keyframes alert-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* ASCII art enhanced glow */
.ascii-logo {
    text-shadow: 0 0 10px rgba(0, 255, 200, 0.3);
}

/* Digital glitch effect (disabled by default, can enable on demand) */
@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

/* Uncomment to enable glitch on errors */
/* .error {
    animation: glitch 0.3s infinite, alert-pulse 1s ease-in-out infinite;
} */

/* Screen static/noise overlay (very subtle) */
body {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300"><filter id="noise"><feTurbulence baseFrequency="0.9"/></filter><rect width="100%" height="100%" filter="url(%23noise)" opacity="0.02"/></svg>');
}
