/**
 * LORIS.PRO Blog - Terminal Code Block Component
 * Version: 2.0.0 - Coherent with loris.pro theme
 *
 * Design System:
 * - Background: #0a0a0b / #111113
 * - Primary: #d9913a (orange)
 * - Border: rgba(255, 255, 255, 0.08)
 * - Radius: 6px
 */

/* Terminal Container */
.terminal {
    position: relative;
    margin: 32px 0;
    background: var(--surface, #111113);
    border-radius: var(--radius, 6px);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    overflow: hidden;
}

/* Terminal Header */
.terminal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}

/* Terminal Icon */
.terminal-icon {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary, #d9913a);
}

.terminal-icon svg {
    width: 16px;
    height: 16px;
    opacity: 0.8;
}

/* Terminal Title */
.terminal-title {
    font-family: var(--font-display, 'Orbitron', monospace);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted, #71717a);
}

/* Copy Button */
.terminal-copy {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    border-radius: var(--radius, 6px);
    color: var(--text-muted, #71717a);
    font-family: var(--font-body, 'Saira', sans-serif);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.terminal-copy:hover {
    background: rgba(217, 145, 58, 0.1);
    border-color: var(--primary, #d9913a);
    color: var(--primary, #d9913a);
}

.terminal-copy:active {
    transform: scale(0.97);
}

.terminal-copy.copied {
    background: rgba(217, 145, 58, 0.15);
    border-color: var(--primary, #d9913a);
    color: var(--primary, #d9913a);
}

.terminal-copy svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.terminal-copy .icon-check {
    display: none;
}

.terminal-copy.copied .icon-copy {
    display: none;
}

.terminal-copy.copied .icon-check {
    display: block;
}

/* Code Body */
.terminal-body {
    padding: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.terminal-body pre {
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
}

.terminal-body code {
    font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', 'Liberation Mono', monospace;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-dim, #a1a1aa);
    white-space: pre;
    display: block;
}

/* Syntax Highlighting - loris.pro theme */
.terminal-body .prompt {
    color: var(--primary, #d9913a);
    user-select: none;
}

.terminal-body .command {
    color: var(--text, #fafafa);
    font-weight: 500;
}

.terminal-body .flag {
    color: var(--primary, #d9913a);
    opacity: 0.8;
}

.terminal-body .string {
    color: #a1a1aa;
}

.terminal-body .comment {
    color: #52525b;
    font-style: italic;
}

.terminal-body .output {
    color: #71717a;
}

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

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

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

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

/* =====================
   RESPONSIVE
   ===================== */

@media (max-width: 540px) {
    .terminal {
        margin: 24px -16px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .terminal-header {
        padding: 10px 14px;
    }

    .terminal-title {
        display: none;
    }

    .terminal-copy span {
        display: none;
    }

    .terminal-copy {
        padding: 8px;
    }

    .terminal-body {
        padding: 16px;
    }

    .terminal-body code {
        font-size: 13px;
    }
}

/* =====================
   PRINT STYLES
   ===================== */

@media print {
    .terminal {
        border: 1px solid #ccc;
        break-inside: avoid;
    }

    .terminal-header {
        background: #f5f5f5;
        border-bottom-color: #ccc;
    }

    .terminal-copy {
        display: none;
    }

    .terminal-body {
        background: #fafafa;
    }

    .terminal-body code {
        color: #333;
    }
}

/* =====================
   ACCESSIBILITY
   ===================== */

@media (prefers-reduced-motion: reduce) {
    .terminal-copy {
        transition: none;
    }
}

.terminal-copy:focus-visible {
    outline: 2px solid var(--primary, #d9913a);
    outline-offset: 2px;
}

/* Screen reader only */
.terminal-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
