/* Terminal-specific styles */
.terminal-container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-strong);
    overflow: hidden;
    font-family: var(--font-mono);
    position: relative;
}

.terminal-header {
    background: var(--bg-tertiary);
    padding: var(--space-sm) var(--space-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    user-select: none;
}

.terminal-controls {
    display: flex;
    gap: var(--space-xs);
}

.terminal-button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.terminal-button.close {
    background: #ff5f56;
}

.terminal-button.minimize {
    background: #ffbd2e;
}

.terminal-button.maximize {
    background: #27ca3f;
}

.terminal-button:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

.terminal-title {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    text-align: center;
    flex-grow: 1;
}

.terminal-body {
    background: var(--bg-primary);
    min-height: 60vh;
    max-height: 70vh;
    overflow-y: auto;
    padding: var(--space-md);
    color: var(--accent-primary);
    font-size: var(--font-size-sm);
    line-height: 1.4;
}

.terminal-output {
    white-space: pre-wrap;
    word-wrap: break-word;
    margin-bottom: var(--space-md);
}

.terminal-input-line {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin-top: var(--space-sm);
    position: sticky;
    bottom: 0;
    background: var(--bg-primary);
    padding: var(--space-xs) 0;
}

.terminal-prompt {
    color: var(--accent-primary);
    font-weight: 600;
    white-space: nowrap;
}

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

.terminal-input:focus {
    outline: none;
}

/* Welcome message styling */
.welcome-message {
    margin-bottom: var(--space-lg);
}

.ascii-art {
    color: var(--accent-secondary);
    font-size: 0.7rem;
    margin: 0;
    overflow-x: auto;
}

/* Command output styling */
.command-line {
    margin-bottom: var(--space-xs);
}

.command-line .prompt {
    color: var(--accent-primary);
    font-weight: 600;
}

.command-line .command {
    color: var(--text-primary);
}

.output {
    margin-bottom: var(--space-md);
    padding-left: 0;
}

.output.error {
    color: #ff6b6b;
}

.output.success {
    color: var(--accent-primary);
}

.output.info {
    color: var(--accent-secondary);
}

.output.warning {
    color: #ffd93d;
}

/* File listing styles */
.file-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-xs);
    margin: var(--space-sm) 0;
}

.file-item {
    padding: var(--space-xs);
    border-radius: var(--border-radius);
    transition: background var(--transition-fast);
}

.file-item:hover {
    background: var(--bg-secondary);
}

.file-item.directory {
    color: var(--accent-secondary);
    font-weight: 600;
}

.file-item.executable {
    color: var(--accent-primary);
    font-weight: 600;
}

.file-item.hidden {
    color: var(--text-muted);
    opacity: 0.7;
}

/* Directory tree styling */
.tree-structure {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    margin: var(--space-sm) 0;
}

.tree-structure .tree-directory {
    color: var(--accent-secondary);
    font-weight: 600;
}

.tree-structure .tree-file {
    color: var(--text-primary);
}

.tree-structure .tree-executable {
    color: var(--accent-primary);
}

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

.cursor {
    animation: blink 1s infinite;
    background: var(--accent-primary);
    width: 8px;
    height: 1.2em;
    display: inline-block;
    margin-left: 2px;
}

/* Matrix effect for easter eggs */
@keyframes matrix-rain {
    0% { transform: translateY(-100vh); opacity: 1; }
    100% { transform: translateY(100vh); opacity: 0; }
}

.matrix-char {
    position: absolute;
    color: var(--accent-primary);
    font-family: var(--font-mono);
    animation: matrix-rain 3s linear infinite;
    pointer-events: none;
}

/* Typing effect */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

.typing-effect {
    overflow: hidden;
    white-space: nowrap;
    animation: typing 2s steps(40, end);
}

/* Help command styling */
.help-section {
    margin: var(--space-md) 0;
}

.help-section h4 {
    color: var(--accent-secondary);
    margin-bottom: var(--space-sm);
    font-size: var(--font-size-base);
}

.help-command {
    display: flex;
    margin-bottom: var(--space-xs);
}

.help-command .command-name {
    color: var(--accent-primary);
    min-width: 120px;
    font-weight: 600;
}

.help-command .command-desc {
    color: var(--text-secondary);
}

/* Mobile responsiveness */
@media (max-width: 767px) {
    .terminal-container {
        margin: var(--space-sm);
        border-radius: var(--border-radius);
    }
    
    .terminal-body {
        font-size: 0.75rem;
        padding: var(--space-sm);
        min-height: 50vh;
        max-height: 60vh;
    }
    
    .ascii-art {
        font-size: 0.5rem;
    }
    
    .file-list {
        grid-template-columns: 1fr;
    }
    
    .help-command {
        flex-direction: column;
    }
    
    .help-command .command-name {
        min-width: auto;
        margin-bottom: var(--space-xs);
    }
}

/* Theme-specific adjustments */
[data-theme="light"] .terminal-body {
    background: #f8f8f8;
}

[data-theme="light"] .terminal-input-line {
    background: #f8f8f8;
}

[data-theme="light"] .ascii-art {
    color: var(--accent-primary);
}

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

.terminal-body::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.terminal-body::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

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

/* Loading dots animation for commands */
@keyframes loading-dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

.loading-dots::after {
    content: '';
    animation: loading-dots 1.5s infinite;
}

/* Auto-scroll behavior */
.terminal-body.auto-scroll {
    scroll-behavior: smooth;
}
