/* ===================================
   Terminal Styles
   =================================== */

.terminal-container {
    background: #1e1e2e;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.terminal-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #181825;
    border-bottom: 1px solid #313244;
}

.terminal-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #cdd6f4;
    font-size: 0.9rem;
}

.terminal-title i {
    color: #a6e3a1;
}

.terminal-actions {
    display: flex;
    gap: 4px;
}

.terminal-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: #6c7086;
    cursor: pointer;
    transition: all 0.15s ease;
}

.terminal-btn:hover {
    background: #313244;
    color: #cdd6f4;
}

#terminal {
    height: 350px;
    padding: 8px;
}

/* xterm.js overrides */
#terminal .xterm {
    padding: 8px;
}

#terminal .xterm-viewport {
    background-color: #1e1e2e !important;
}

#terminal .xterm-screen {
    padding: 8px;
}

/* Custom terminal theme */
.terminal-custom {
    --terminal-bg: #1e1e2e;
    --terminal-fg: #cdd6f4;
    --terminal-cursor: #f5e0dc;
    --terminal-selection: #45475a;
    --terminal-black: #45475a;
    --terminal-red: #f38ba8;
    --terminal-green: #a6e3a1;
    --terminal-yellow: #f9e2af;
    --terminal-blue: #89b4fa;
    --terminal-magenta: #cba6f7;
    --terminal-cyan: #94e2d5;
    --terminal-white: #bac2de;
}

/* Terminal hints */
.terminal-hints {
    padding: 16px;
    background: #181825;
    border-top: 1px solid #313244;
}

.terminal-hints h4 {
    font-size: 0.85rem;
    color: #6c7086;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.hint-btn {
    padding: 8px 16px;
    background: #313244;
    border: none;
    border-radius: 6px;
    color: #89b4fa;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.hint-btn:hover {
    background: #45475a;
    color: #cdd6f4;
    transform: translateY(-2px);
}

/* Command suggestions */
.terminal-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(137, 180, 250, 0.1);
    border-top: 1px solid #313244;
}

.suggestion {
    padding: 4px 12px;
    background: #313244;
    border-radius: 4px;
    color: #a6e3a1;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.suggestion:hover {
    background: #45475a;
}

/* Output styling */
.terminal-output {
    color: #cdd6f4;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

.terminal-output .prompt {
    color: #89b4fa;
}

.terminal-output .command {
    color: #a6e3a1;
}

.terminal-output .error {
    color: #f38ba8;
}

.terminal-output .success {
    color: #a6e3a1;
}

.terminal-output .info {
    color: #94e2d5;
}

.terminal-output .warning {
    color: #f9e2af;
}

/* File listing */
.terminal-output .directory {
    color: #89b4fa;
    font-weight: bold;
}

.terminal-output .file {
    color: #cdd6f4;
}

.terminal-output .executable {
    color: #a6e3a1;
}

.terminal-output .symlink {
    color: #94e2d5;
}

/* ASCII art header */
.ascii-header {
    color: #89b4fa;
    font-size: 0.75rem;
    line-height: 1.2;
    margin-bottom: 16px;
}

/* Command history */
.command-history {
    max-height: 150px;
    overflow-y: auto;
    padding: 8px;
    background: #11111b;
    border-radius: 4px;
    margin-top: 8px;
}

.history-item {
    padding: 4px 8px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #6c7086;
    cursor: pointer;
    border-radius: 2px;
}

.history-item:hover {
    background: #1e1e2e;
    color: #cdd6f4;
}

/* Loading animation */
.terminal-loading {
    display: inline-flex;
    gap: 4px;
}

.terminal-loading span {
    width: 6px;
    height: 6px;
    background: #a6e3a1;
    border-radius: 50%;
    animation: terminalBounce 1.4s infinite ease-in-out both;
}

.terminal-loading span:nth-child(1) { animation-delay: -0.32s; }
.terminal-loading span:nth-child(2) { animation-delay: -0.16s; }
.terminal-loading span:nth-child(3) { animation-delay: 0s; }

@keyframes terminalBounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Welcome message */
.terminal-welcome {
    padding: 16px;
    color: #cdd6f4;
}

.terminal-welcome h3 {
    color: #a6e3a1;
    margin-bottom: 8px;
}

.terminal-welcome p {
    color: #6c7086;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.terminal-welcome .highlight {
    color: #f9e2af;
}

/* Responsive */
@media (max-width: 600px) {
    #terminal {
        height: 280px;
    }

    .hint-buttons {
        gap: 6px;
    }

    .hint-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}
