/* Terminal Style CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier Prime', 'Courier New', monospace;
    background: #1a1a1a;
    color: #00FF00;
    overflow: auto;
    min-height: 100vh;
    user-select: none;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.terminal-container {
    width: 90%;
    max-width: 1200px;
    height: 80vh;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    background: #000;
    position: relative;
    border-radius: 10px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7),
                0 0 0 1px rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

/* Terminal Header */
.terminal-header {
    background: #1a1a1a;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #333;
}

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

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

.control.close {
    background: #ff5f57;
}

.control.minimize {
    background: #ffbd2e;
}

.control.maximize {
    background: #28ca42;
}

.terminal-title {
    color: #ccc;
    font-size: 12px;
    font-weight: 400;
}

/* Terminal Body */
.terminal-body {
    flex: 1;
    padding: 20px;
    background: #000;
    position: relative;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.scan-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        transparent 98%,
        rgba(0, 255, 0, 0.03) 100%
    );
    background-size: 100% 4px;
    animation: scan 0.1s linear infinite;
    pointer-events: none;
}

@keyframes scan {
    0% { background-position: 0 0; }
    100% { background-position: 0 4px; }
}

.terminal-content {
    flex: 1;
    line-height: 1.6;
    font-size: 16px;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin-bottom: 20px;
    color: #FFFFFF;
    scroll-behavior: smooth;
}

.input-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
}

.prompt {
    color: #00FF00;
    font-weight: 700;
    flex-shrink: 0;
}

#terminal-input {
    background: transparent;
    border: none;
    color: #00FF00;
    font-family: inherit;
    font-size: 16px;
    outline: none;
    flex: 1;
    caret-color: #00FF00;
    position: relative;
}

.cursor {
    color: #00FF00;
    animation: blink 1s infinite;
    font-weight: 700;
    display: inline-block;
    position: relative;
    margin-left: 2px;
}

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

/* Terminal Footer */
.terminal-footer {
    background: #1a1a1a;
    border-top: 1px solid #333;
}

.status-bar {
    padding: 4px 16px;
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #666;
}

.status-left {
    color: #00FF00;
}

/* Text Effects */
.glow {
    text-shadow: 0 0 10px #00FF00;
    color: #00FF00;
}

.error {
    color: #FF4444;
}

.warning {
    color: #FFAA00;
}

.info {
    color: #FFFFFF;
}

.success {
    color: #00FF00;
}

.dim {
    color: #999;
}

/* Typing Animation */
.typing {
    overflow: hidden;
    border-right: 2px solid #00FF00;
    white-space: nowrap;
    animation: typing 3s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: #00FF00; }
}

/* Matrix Animation */
.matrix {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.matrix-column {
    position: absolute;
    top: -100%;
    color: #00FF00;
    font-size: 12px;
    animation: matrix-fall 3s linear infinite;
}

@keyframes matrix-fall {
    0% { top: -100%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 20px;
    background: #333;
    border: 1px solid #00FF00;
    margin: 10px 0;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00FF00, #00AA00);
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Loading Animation */
.loading {
    display: inline-block;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #00FF00;
    margin-left: 4px;
    animation: loading-dots 1.5s infinite;
}

@keyframes loading-dots {
    0%, 20% { transform: scale(0); }
    50% { transform: scale(1); }
    80%, 100% { transform: scale(0); }
}

/* Command Processing Animation */
.processing {
    opacity: 0.7;
    animation: processing-pulse 1s infinite;
}

@keyframes processing-pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Success Message Animation */
.success {
    animation: success-flash 0.5s ease-out;
}

@keyframes success-flash {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Command Suggestions */
.command-suggestions {
    margin: 10px 0;
    padding: 10px;
    background: rgba(0, 255, 0, 0.1);
    border-left: 3px solid #00FF00;
}

.command-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.command-item {
    color: #00AAFF;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 2px;
    transition: background-color 0.2s;
}

.command-item:hover {
    background: rgba(0, 170, 255, 0.2);
}

/* ASCII Art */
.ascii-art {
    font-size: 8px;
    line-height: 1;
    color: #00FF00;
    margin: 10px 0;
}

/* Email Links */
.email-link {
    color: #00FFFF;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.email-link:hover {
    color: #FFFFFF;
    text-shadow: 0 0 5px #00FFFF;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .terminal-container {
        width: 95%;
        height: 85vh;
        min-height: 500px;
    }
    
    .terminal-body {
        padding: 10px;
    }
    
    .terminal-content {
        font-size: 14px;
    }
    
    #terminal-input {
        font-size: 14px;
    }
    
    .command-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    body {
        padding: 5px;
    }
    
    .terminal-container {
        width: 100%;
        height: 90vh;
        border-radius: 5px;
    }
    
    .terminal-header {
        padding: 6px 12px;
    }
    
    .terminal-title {
        font-size: 10px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .scan-lines {
        animation: none;
    }
    
    .cursor {
        animation: none;
        opacity: 1;
    }
    
    .matrix-column {
        animation: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .terminal-body {
        background: #000;
    }
    
    .terminal-content {
        color: #FFFFFF;
    }
    
    .prompt, #terminal-input {
        color: #FFFFFF;
    }
}