/* ===========================
   TERMINAL LOADER
   =========================== */
.terminal-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, transform 1s cubic-bezier(0.77, 0, 0.175, 1);
    overflow: hidden;
}

.terminal-loader.slide-up {
    transform: translateY(-100%);
    opacity: 0;
}

/* Effet Matrix en arrière-plan */
.matrix-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.1;
    pointer-events: none;
    background:
        linear-gradient(90deg, transparent 0%, rgba(140, 168, 124, 0.06) 50%, transparent 100%),
        repeating-linear-gradient(
            0deg,
            rgba(140, 168, 124, 0.05) 0px,
            transparent 1px,
            transparent 2px,
            rgba(140, 168, 124, 0.05) 3px
        );
    animation: matrix-scroll 20s linear infinite;
}

@keyframes matrix-scroll {
    0% {
        background-position: 0 0, 0 0;
    }
    100% {
        background-position: 100% 0, 0 100%;
    }
}

/* Terminal Window */
.terminal-wrapper {
    width: 90%;
    max-width: 800px;
    background: rgba(69, 67, 67, 0.95);
    border-radius: 8px;
    box-shadow:
        0 0 80px rgba(140, 168, 124, 0.3),
        0 0 40px rgba(65, 75, 59, 0.2),
        inset 0 0 20px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--color-border-strong);
    overflow: hidden;
    animation: terminal-glitch 3s ease-in-out infinite;
}

@keyframes terminal-glitch {
    0%, 90%, 100% {
        transform: translate(0, 0);
        filter: hue-rotate(0deg);
    }
    92% {
        transform: translate(-2px, 2px);
        filter: hue-rotate(5deg);
    }
    94% {
        transform: translate(2px, -2px);
        filter: hue-rotate(-5deg);
    }
    96% {
        transform: translate(-1px, 1px);
    }
}

/* Terminal Header */
.terminal-header {
    background: linear-gradient(180deg, rgba(69, 67, 67, 0.6), rgba(58, 56, 56, 0.95));
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(140, 168, 124, 0.3);
}

.terminal-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.terminal-btn.red {
    background: var(--color-red);
    box-shadow: 0 0 5px var(--color-red);
}

.terminal-btn.yellow {
    background: var(--color-amber);
    box-shadow: 0 0 5px var(--color-amber);
}

.terminal-btn.green {
    background: var(--color-green);
    box-shadow: 0 0 5px var(--color-green);
}

.terminal-title {
    margin-left: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    color: var(--accent-primary);
    font-weight: 600;
    text-shadow: 0 0 10px rgba(140, 168, 124, 0.4);
}

/* Terminal Content */
.terminal-content {
    font-family: 'Courier New', Courier, monospace;
    font-size: 16px;
    color: var(--accent-primary);
    line-height: 1.8;
    padding: 25px;
    min-height: 300px;
    background: rgba(0, 0, 0, 0.8);
    text-shadow: 0 0 5px rgba(140, 168, 124, 0.4);
}

#terminal-text {
    white-space: pre-wrap;
    color: var(--accent-primary);
    animation: text-flicker 0.15s infinite alternate;
}

.cursor {
    display: inline-block;
    width: 10px;
    background-color: var(--accent-primary);
    animation: cursor-blink 0.8s infinite, cursor-glitch 5s ease-in-out infinite;
    margin-left: 2px;
    box-shadow: 0 0 10px rgba(140, 168, 124, 0.6);
}

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

@keyframes cursor-glitch {
    0%, 90%, 100% {
        transform: scaleX(1);
    }
    92% {
        transform: scaleX(1.2) translateX(2px);
    }
    94% {
        transform: scaleX(0.8) translateX(-2px);
    }
    96% {
        transform: scaleX(1.1);
    }
}

/* Scrollbar Styles */
.modal-content::-webkit-scrollbar {
    width: 8px;
    background: rgba(255, 255, 255, 0.1);
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(140, 168, 124, 0.4);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(140, 168, 124, 0.6);
}
