@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    background-color: #0a0a0f;
    color: #00ff41;
    min-height: 100vh;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* ========== MATRIX RAIN BACKGROUND ========== */
#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.12;
    pointer-events: none;
}

/* ========== TERMINAL CONTAINER ========== */
.terminal-container {
    width: 100%;
    max-width: 1000px;
    background: rgba(12, 12, 18, 0.92);
    border: 1px solid rgba(0, 255, 65, 0.25);
    border-radius: 12px;
    box-shadow:
        0 0 40px rgba(0, 255, 65, 0.08),
        0 0 80px rgba(0, 255, 65, 0.04),
        0 25px 60px rgba(0, 0, 0, 0.6);
    position: relative;
    z-index: 1;
    overflow: hidden;
    backdrop-filter: blur(12px);
}

/* ========== CRT SCANLINE OVERLAY ========== */
.terminal-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 65, 0.015) 2px,
        rgba(0, 255, 65, 0.015) 4px
    );
    pointer-events: none;
    z-index: 100;
}

/* CRT flicker animation */
.terminal-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 255, 65, 0.01);
    pointer-events: none;
    z-index: 101;
    animation: crt-flicker 4s infinite;
}

@keyframes crt-flicker {
    0%, 100% { opacity: 0; }
    3% { opacity: 1; }
    6% { opacity: 0; }
    9% { opacity: 0.6; }
    11% { opacity: 0; }
    50% { opacity: 0; }
    52% { opacity: 0.3; }
    53% { opacity: 0; }
}

/* ========== macOS WINDOW CHROME ========== */
.terminal-header {
    background: linear-gradient(180deg, #2a2a32 0%, #1e1e26 100%);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 255, 65, 0.15);
    position: relative;
    z-index: 2;
}

.window-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.window-btn {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    border: none;
    cursor: default;
    position: relative;
    transition: filter 0.2s;
}

.window-btn:hover {
    filter: brightness(1.3);
}

.window-btn.close {
    background: #ff5f57;
    box-shadow: 0 0 6px rgba(255, 95, 87, 0.4);
}

.window-btn.minimize {
    background: #ffbd2e;
    box-shadow: 0 0 6px rgba(255, 189, 46, 0.4);
}

.window-btn.maximize {
    background: #28c840;
    box-shadow: 0 0 6px rgba(40, 200, 64, 0.4);
}

.terminal-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 13px;
    color: #7a7a88;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.terminal-title .icon {
    font-size: 14px;
}

.terminal-status {
    display: flex;
    gap: 16px;
    font-size: 11px;
    color: #5a5a68;
}

.terminal-status .online-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: #28c840;
    border-radius: 50%;
    margin-right: 5px;
    box-shadow: 0 0 8px rgba(40, 200, 64, 0.6);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 4px rgba(40, 200, 64, 0.4); }
    50% { box-shadow: 0 0 12px rgba(40, 200, 64, 0.8); }
}

/* ========== TERMINAL BODY ========== */
.terminal-body {
    background: rgba(8, 8, 14, 0.95);
    padding: 20px 24px;
    min-height: 500px;
    max-height: 65vh;
    overflow-y: auto;
    cursor: text;
    font-size: 14px;
    line-height: 1.65;
    position: relative;
    z-index: 2;
}

.terminal-body::-webkit-scrollbar {
    width: 6px;
}

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

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

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

/* ========== TERMINAL LINES ========== */
.terminal-line {
    margin-bottom: 2px;
    white-space: pre-wrap;
    word-wrap: break-word;
    animation: line-appear 0.1s ease-out;
}

@keyframes line-appear {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== INPUT LINE ========== */
.terminal-input-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.terminal-prompt {
    color: #00ff41;
    text-shadow: 0 0 8px rgba(0, 255, 65, 0.4);
    white-space: nowrap;
}

#terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #e0e0e8;
    font-family: inherit;
    font-size: 14px;
    caret-color: #00ff41;
    line-height: 1.65;
}

/* ========== TERMINAL FOOTER ========== */
.terminal-footer {
    background: linear-gradient(180deg, #1e1e26 0%, #2a2a32 100%);
    padding: 8px 16px;
    border-top: 1px solid rgba(0, 255, 65, 0.12);
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #5a5a68;
    position: relative;
    z-index: 2;
}

/* ========== QUICK COMMAND BUTTONS ========== */
.quick-commands {
    width: 100%;
    max-width: 1000px;
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.quick-cmd-btn {
    background: rgba(12, 12, 18, 0.8);
    border: 1px solid rgba(0, 255, 65, 0.2);
    color: #00ff41;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
    text-shadow: 0 0 6px rgba(0, 255, 65, 0.3);
    letter-spacing: 0.5px;
}

.quick-cmd-btn:hover {
    background: rgba(0, 255, 65, 0.08);
    border-color: rgba(0, 255, 65, 0.5);
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.15);
    transform: translateY(-1px);
}

.quick-cmd-btn:active {
    transform: translateY(0);
}

.gui-btn {
    text-decoration: none;
    border-color: rgba(24, 220, 255, 0.5);
    color: #18dcff;
    text-shadow: 0 0 8px rgba(24, 220, 255, 0.4);
    background: rgba(24, 220, 255, 0.06);
}

.gui-btn:hover {
    background: rgba(24, 220, 255, 0.12);
    border-color: rgba(24, 220, 255, 0.7);
    box-shadow: 0 0 24px rgba(24, 220, 255, 0.2);
    color: #18dcff;
}

/* ========== GLOWING TEXT CLASSES ========== */
.text-error {
    color: #ff4757;
    text-shadow: 0 0 8px rgba(255, 71, 87, 0.4);
}

.text-success {
    color: #00ff41;
    text-shadow: 0 0 8px rgba(0, 255, 65, 0.3);
}

.text-warning {
    color: #ffd32a;
    text-shadow: 0 0 8px rgba(255, 211, 42, 0.3);
}

.text-info {
    color: #18dcff;
    text-shadow: 0 0 8px rgba(24, 220, 255, 0.3);
}

.text-white {
    color: #e0e0e8;
}

.text-command {
    color: #c56cf0;
    text-shadow: 0 0 8px rgba(197, 108, 240, 0.3);
}

.text-category {
    color: #ffd32a;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(255, 211, 42, 0.35);
}

.text-job {
    color: #7bed9f;
    font-weight: 600;
    text-shadow: 0 0 8px rgba(123, 237, 159, 0.3);
}

.text-project {
    color: #70a1ff;
    font-weight: 600;
    text-shadow: 0 0 8px rgba(112, 161, 255, 0.3);
}

.text-cert {
    color: #ffd32a;
    text-shadow: 0 0 6px rgba(255, 211, 42, 0.25);
}

.text-link {
    color: #18dcff;
    text-shadow: 0 0 8px rgba(24, 220, 255, 0.3);
}

.text-ascii {
    color: #00ff41;
    font-weight: 700;
    text-shadow: 0 0 12px rgba(0, 255, 65, 0.5);
}

.text-system {
    color: #6a6a78;
}

.text-output {
    color: #c8c8d4;
}

.text-boot {
    color: #00ff41;
    text-shadow: 0 0 6px rgba(0, 255, 65, 0.25);
}

/* ========== BOOT SEQUENCE ========== */
.boot-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0a0f;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease;
}

.boot-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.boot-text {
    font-family: 'JetBrains Mono', monospace;
    color: #00ff41;
    font-size: 14px;
    max-width: 700px;
    width: 90%;
    line-height: 1.7;
    text-shadow: 0 0 8px rgba(0, 255, 65, 0.4);
}

.boot-text .boot-line {
    opacity: 0;
    transform: translateY(2px);
    animation: boot-line-in 0.15s ease-out forwards;
}

@keyframes boot-line-in {
    to { opacity: 1; transform: translateY(0); }
}

.boot-cursor {
    display: inline-block;
    width: 8px;
    height: 16px;
    background: #00ff41;
    animation: blink-cursor 0.7s step-end infinite;
    vertical-align: text-bottom;
    box-shadow: 0 0 6px rgba(0, 255, 65, 0.5);
}

@keyframes blink-cursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .terminal-body {
        min-height: 350px;
        max-height: 55vh;
        font-size: 12px;
        padding: 16px;
    }

    .terminal-status {
        display: none;
    }

    .terminal-title {
        position: static;
        transform: none;
    }

    .quick-cmd-btn {
        padding: 6px 14px;
        font-size: 11px;
    }
}
