/* Terminal Window Styles */
:root {
    --term-bg: #1e1e1e;
    --term-header: #2d2d2d;
    --term-text: #e0e0e0;
    --term-green: #4ade80;
    --term-blue: #60a5fa;
    --term-yellow: #facc15;
    --term-red: #f87171;
    --term-gray: #9ca3af;
}

.terminal-interactive {
    font-family: 'JetBrains Mono', monospace;
    background: var(--term-bg);
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.terminal-interactive:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.terminal-header {
    background: var(--term-header);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

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

.dot-red {
    background: #ff5f56;
}

.dot-yellow {
    background: #ffbd2e;
}

.dot-green {
    background: #27c93f;
}

.terminal-title {
    color: var(--term-gray);
    font-size: 0.85rem;
    font-weight: 500;
    margin-left: auto;
    margin-right: auto;
    transform: translateX(-28px);
    /* Center optically ignoring controls */
}

.terminal-body {
    padding: 20px;
    height: 350px;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--term-text);
    background: var(--term-bg);
    cursor: text;
}

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

.terminal-body::-webkit-scrollbar-track {
    background: transparent;
}

.terminal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Content Styles */
.prompt {
    color: var(--term-gree);
    margin-right: 8px;
    font-weight: bold;
}

.path {
    color: var(--term-blue);
}

.command-line {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.output-line {
    margin-bottom: 2px;
    word-break: break-word;
}

.text-green {
    color: var(--term-green);
}

.text-blue {
    color: var(--term-blue);
}

.text-yellow {
    color: var(--term-yellow);
}

.text-red {
    color: var(--term-red);
}

.text-gray {
    color: var(--term-gray);
}

.text-dim {
    opacity: 0.6;
}

/* Typing Animation */
.cursor {
    display: inline-block;
    width: 8px;
    height: 16px;
    background: var(--term-text);
    margin-left: 4px;
    vertical-align: middle;
    animation: blink 1s step-end infinite;
}

.typing .cursor {
    animation: none;
    opacity: 1;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Spinner */
.spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Viewer Modal Override */
.viewer-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 1000px;
    height: 85vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.viewer-modal.active {
    opacity: 1;
    pointer-events: all;
    transform: translate(-50%, -50%) scale(1);
}

.viewer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.viewer-backdrop.active {
    opacity: 1;
    pointer-events: all;
}

.viewer-header {
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9fafb;
}

.viewer-close {
    padding: 8px;
    border-radius: 8px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

.viewer-close:hover {
    background: #e5e7eb;
    color: #111827;
}

/* Input Area */
.input-area {
    display: flex;
    align-items: center;
}

.command-input {
    background: transparent;
    border: none;
    color: var(--term-text);
    font-family: inherit;
    font-size: inherit;
    flex: 1;
    outline: none;
    padding: 0;
    margin: 0;
}