/**
 * Terminal Window Styles
 * Renders bash/shell/terminal code blocks as terminal windows
 */

/* === Terminal Window Container === */
.terminal-window {
    background: #0d1117;
    border-radius: 10px;
    overflow: hidden;
    width: 100%;
    max-width: 760px;
    margin: 1rem auto;
    font-family: 'JetBrains Mono', 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(0, 0, 0, 0.5);
}

/* === Terminal Header (Title Bar) === */
.terminal-header {
    background: linear-gradient(180deg, #1c2128 0%, #161b22 100%);
    padding: 0 14px;
    height: 38px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    user-select: none;
}

/* Traffic lights */
.terminal-dots {
    display: flex;
    gap: 8px;
    align-items: center;
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    position: relative;
}

.terminal-dot.red {
    background: #ff5f57;
    box-shadow: inset 0 -1px 1px rgba(0, 0, 0, 0.2);
}

.terminal-dot.yellow {
    background: #febc2e;
    box-shadow: inset 0 -1px 1px rgba(0, 0, 0, 0.2);
}

.terminal-dot.green {
    background: #28c840;
    box-shadow: inset 0 -1px 1px rgba(0, 0, 0, 0.2);
}

/* Terminal title */
.terminal-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #8b949e;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.terminal-title i {
    font-size: 11px;
    opacity: 0.7;
}

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

.terminal-copy {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: #8b949e;
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
}

.terminal-copy:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #c9d1d9;
    border-color: rgba(255, 255, 255, 0.15);
}

.terminal-copy.copied {
    background: rgba(16, 163, 127, 0.15);
    border-color: rgba(16, 163, 127, 0.3);
    color: #10A37F;
}

.terminal-copy i {
    font-size: 11px;
}

/* === Terminal Body === */
.terminal-body {
    padding: 16px 18px;
    overflow-x: auto;
    background: #0d1117;
}

.terminal-body pre {
    margin: 0;
    padding: 0;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.terminal-body code {
    font-family: inherit;
    font-size: 13px;
    line-height: 1.6;
    color: #c9d1d9;
    background: transparent !important;
    padding: 0 !important;
}

/* === Terminal Line Styling === */
.terminal-line {
    display: flex;
    margin-bottom: 4px;
}

.terminal-line:last-child {
    margin-bottom: 0;
}

/* Command prompt styling */
.terminal-prompt {
    color: #10A37F;
    font-weight: 600;
    user-select: none;
    margin-right: 8px;
    flex-shrink: 0;
}

.terminal-command {
    color: #c9d1d9;
}

/* Output styling (lines without $) */
.terminal-output {
    color: #8b949e;
    padding-left: 0;
}

/* === Syntax Highlighting in Terminal === */
.terminal-body .token.command,
.terminal-body .command {
    color: #c9d1d9;
}

.terminal-body .token.parameter,
.terminal-body .parameter {
    color: #79c0ff;
}

.terminal-body .token.flag,
.terminal-body .flag {
    color: #ff7b72;
}

.terminal-body .token.string,
.terminal-body .string {
    color: #a5d6ff;
}

.terminal-body .token.path,
.terminal-body .path {
    color: #ffa657;
}

.terminal-body .token.comment,
.terminal-body .comment {
    color: #6e7681;
    font-style: italic;
}

/* Success/error indicators */
.terminal-success {
    color: #3fb950;
}

.terminal-error {
    color: #f85149;
}

.terminal-warning {
    color: #d29922;
}

/* === Scrollbar === */
.terminal-body::-webkit-scrollbar {
    height: 6px;
}

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

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

.terminal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* === Mobile Responsive === */
@media (max-width: 600px) {
    .terminal-window {
        border-radius: 8px;
        margin: 0.75rem auto;
    }

    .terminal-header {
        height: 34px;
        padding: 0 12px;
    }

    .terminal-dot {
        width: 10px;
        height: 10px;
    }

    .terminal-dots {
        gap: 6px;
    }

    .terminal-title {
        font-size: 11px;
    }

    .terminal-copy span {
        display: none;
    }

    .terminal-body {
        padding: 12px 14px;
        font-size: 12px;
    }
}

/* === Animation === */
@keyframes terminalBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.terminal-cursor {
    display: inline-block;
    width: 8px;
    height: 16px;
    background: #c9d1d9;
    margin-left: 2px;
    animation: terminalBlink 1s step-end infinite;
}
