/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Terminal Colors - Classic Green Phosphor */
    --primary-color: #00ff41;
    --secondary-color: #00cc33;
    --background-color: #0a0e0a;
    --terminal-bg: #0d1117;
    --text-color: #00ff41;
    --text-dim: #00aa2b;
    --error-color: #ff4444;
    --warning-color: #ffaa00;
    --info-color: #00aaff;
    
    /* Glow Effects */
    --text-glow: 0 0 5px rgba(0, 255, 65, 0.5),
                 0 0 10px rgba(0, 255, 65, 0.3);
    --strong-glow: 0 0 10px rgba(0, 255, 65, 0.8),
                   0 0 20px rgba(0, 255, 65, 0.5),
                   0 0 30px rgba(0, 255, 65, 0.3);
    
    /* Fonts */
    --font-mono: 'Fira Code', 'Courier New', monospace;
    --font-retro: 'VT323', monospace;
}

body {
    font-family: var(--font-mono);
    background: linear-gradient(135deg, #0a0e0a 0%, #1a1f1a 100%);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow: hidden;
}

/* Terminal Container */
.terminal-container {
    width: 100%;
    max-width: 1200px;
    height: 85vh;
    background: var(--terminal-bg);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8),
                0 0 40px rgba(0, 255, 65, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(0, 255, 65, 0.2);
    position: relative;
}

/* CRT Scanline Effect */
.terminal-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 10;
    animation: scanline 8s linear infinite;
}

@keyframes scanline {
    0% { transform: translateY(0); }
    100% { transform: translateY(10px); }
}

/* Terminal Header */
.terminal-header {
    background: linear-gradient(180deg, #1c2128 0%, #161b22 100%);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(0, 255, 65, 0.2);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

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

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

.btn-close {
    background: #ff5f56;
    box-shadow: 0 0 5px rgba(255, 95, 86, 0.5);
}

.btn-minimize {
    background: #ffbd2e;
    box-shadow: 0 0 5px rgba(255, 189, 46, 0.5);
}

.btn-maximize {
    background: #27c93f;
    box-shadow: 0 0 5px rgba(39, 201, 63, 0.5);
}

.terminal-title {
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Terminal Body */
.terminal-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    font-size: 15px;
    line-height: 1.6;
    position: relative;
}

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

.terminal-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.terminal-body::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 5px;
    box-shadow: var(--text-glow);
}

.terminal-body::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Terminal Output */
#terminal-output {
    margin-bottom: 20px;
}

.output-line {
    margin: 4px 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--text-color);
    text-shadow: var(--text-glow);
}

.output-line.error {
    color: var(--error-color);
    text-shadow: 0 0 5px rgba(255, 68, 68, 0.5);
}

.output-line.warning {
    color: var(--warning-color);
    text-shadow: 0 0 5px rgba(255, 170, 0, 0.5);
}

.output-line.info {
    color: var(--info-color);
    text-shadow: 0 0 5px rgba(0, 170, 255, 0.5);
}

.output-line.success {
    color: var(--primary-color);
    text-shadow: var(--strong-glow);
}

.output-line.dim {
    color: var(--text-dim);
    opacity: 0.7;
}

/* Command Echo */
.command-echo {
    color: var(--primary-color);
    margin: 8px 0;
    font-weight: 500;
}

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

.prompt {
    color: var(--primary-color);
    font-weight: 700;
    text-shadow: var(--strong-glow);
    white-space: nowrap;
}

.terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-color);
    font-family: var(--font-mono);
    font-size: 15px;
    caret-color: var(--primary-color);
    text-shadow: var(--text-glow);
}

.terminal-input::selection {
    background: rgba(0, 255, 65, 0.3);
}

/* ASCII Art */
.ascii-art {
    color: var(--primary-color);
    font-family: var(--font-retro);
    font-size: 16px;
    line-height: 1.2;
    text-shadow: var(--strong-glow);
    margin: 10px 0;
    white-space: pre;
}

/* Links */
a {
    color: var(--info-color);
    text-decoration: none;
    text-shadow: 0 0 5px rgba(0, 170, 255, 0.5);
    transition: all 0.3s ease;
}

a:hover {
    color: var(--primary-color);
    text-shadow: var(--strong-glow);
    text-decoration: underline;
}

/* Tables */
.terminal-table {
    margin: 10px 0;
    border-collapse: collapse;
}

.terminal-table td {
    padding: 4px 12px;
    border: 1px solid rgba(0, 255, 65, 0.2);
}

.terminal-table td:first-child {
    color: var(--info-color);
    font-weight: 600;
}

/* Lists */
.terminal-list {
    list-style: none;
    margin: 10px 0;
    padding-left: 20px;
}

.terminal-list li {
    margin: 6px 0;
    position: relative;
}

.terminal-list li::before {
    content: '▸';
    position: absolute;
    left: -15px;
    color: var(--primary-color);
}

/* Typing Animation */
@keyframes typing {
    from { opacity: 0; }
    to { opacity: 1; }
}

.typing {
    animation: typing 0.1s;
}

/* Cursor Blink */
@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.cursor-blink::after {
    content: '▊';
    animation: blink 1s infinite;
    color: var(--primary-color);
    text-shadow: var(--strong-glow);
}

/* Hidden Class */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .terminal-container {
        height: 90vh;
        border-radius: 8px;
    }
    
    .terminal-body {
        padding: 15px;
        font-size: 13px;
    }
    
    .terminal-input {
        font-size: 13px;
    }
    
    .ascii-art {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .terminal-header {
        padding: 10px 12px;
    }
    
    .terminal-title {
        font-size: 11px;
    }
    
    .terminal-body {
        padding: 12px;
        font-size: 12px;
    }
    
    .terminal-input {
        font-size: 12px;
    }
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Highlight */
.highlight {
    background: rgba(0, 255, 65, 0.2);
    padding: 2px 6px;
    border-radius: 3px;
}

/* Code Block */
.code-block {
    background: rgba(0, 0, 0, 0.4);
    border-left: 3px solid var(--primary-color);
    padding: 10px 15px;
    margin: 10px 0;
    font-family: var(--font-mono);
    overflow-x: auto;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 20px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--primary-color);
    border-radius: 3px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    box-shadow: var(--strong-glow);
    transition: width 0.3s ease;
}
