:root {
    --bg-color: radial-gradient(#0f0f23, #111);
    --text-color: #CCCCCC;
    --prompt-color: #4aff82;
    --selection-bg: #1a4a1a;
    --glow-color: #4aff82;
}

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

body {
    font-family: "Source Code Pro", 'Share Tech Mono', monospace;
    background-color: var(--bg-color);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    font-weight: 300;
}

.terminal {
    width: 100%;
    height: 100vh;
    animation: colorPulse 5s infinite ease-in-out;
    background-image: var(--bg-color);
    box-shadow: 0 0 5vmin 1vmin #000 inset;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
}

.terminal::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(74, 255, 74, 0.1);
    animation: scanline 6s linear infinite;
    pointer-events: none;
}

.terminal::after {
    background-image: linear-gradient(
        transparent,
        transparent 2px,
        #2222227a
    );
    background-size: 4px 4px;
    bottom: 0;
    content: "";
    left: 0;
    pointer-events: none;
    position: absolute;
    right: 0;
    top: 0;
    z-index: 2;
}

.terminal-header {
    background-color: rgba(0, 40, 0, 0.6);
    padding: 8px;
    border-bottom: 1px solid var(--text-color);
}

.title {
    color: var(--text-color);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.terminal-content {
    padding: 16px;
    height: calc(100vh - 36px);
    overflow-y: auto;
    color: var(--text-color);
}

.input-line {
    display: flex;
    margin-top: 8px;
}

.prompt {
    color: var(--prompt-color);
    margin-right: 8px;
    text-shadow: 0 0 5px var(--glow-color);
}

.red {
    color: #ff4a83 !important;
    margin-right: 8px;
    text-shadow: 0 0 5px #ff4a4a !important;
}

.warning {
    color: #ff924a !important;
    margin-right: 8px;
    text-shadow: 0 0 5px #ff924a !important;
}

.blue {
    color: #4a94ff !important;
    margin-right: 8px;
    text-shadow: 0 0 5px #4a94ff !important;
}

#terminal-input {
    background: none;
    border: none;
    color: var(--text-color);
    font-family: inherit;
    font-size: inherit;
    flex-grow: 1;
    outline: none;
    font-weight: 300;
}

.output-line {
    margin-bottom: 8px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.output-line ul {
    list-style-type: none;
    padding-left: 16px;
}

.output-line li {
    position: relative;
    padding-left: 16px;
    margin-bottom: 4px;
}

.output-line li::before {
    content: ">";
    position: absolute;
    left: 0;
    color: var(--prompt-color);
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--text-color);
    border-radius: 4px;
    opacity: 0.5;
}

::selection {
    background: var(--selection-bg);
    color: var(--text-color);
}

/* Styles de l'écran de chargement */
.boot-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.boot-screen::after {
    background-image: linear-gradient(
        transparent,
        transparent 2px,
        #2222227a
    );
    background-size: 4px 4px;
    bottom: 0;
    content: "";
    left: 0;
    pointer-events: none;
    position: absolute;
    right: 0;
    top: 0;
}

.boot-content {
    width: 80%;
    max-width: 800px;
}

.boot-header {
    font-size: 24px;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.boot-copyright {
    font-size: 14px;
    margin-bottom: 40px;
    opacity: 0.8;
}

.boot-memory {
    margin-bottom: 30px;
}

.memory-check {
    margin: 10px 0;
    opacity: 0;
    transform: translateX(-20px);
}

.memory-check.active {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.5s ease;
}

.boot-progress {
    width: 100%;
    height: 20px;
    background: rgba(74, 255, 74, 0.1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 10px var(--glow-color);
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: var(--prompt-color);
    position: absolute;
    top: 0;
    left: 0;
    transition: width 0.5s ease;
}

@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

.memory-check {
    white-space: nowrap;
    overflow: hidden;
}

.memory-check.typing {
    animation: typewriter 1s steps(40, end);
}

.modal-container {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: 3;
    background: #00000080;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-container.hidden {
    display: none;
}

.modal {
    position: relative;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    background-image: var(--bg-color);
    z-index: 2;
    border: 2px solid var(--prompt-color);
    border-radius: 5px;
    padding: 40px 30px 30px 30px;
    overflow-y: auto;
    box-shadow: 0 0 20px rgba(74, 255, 130, 0.3);
}

.modal-content {
    color: var(--text-color);
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.6;
}

.modal-title {
    color: var(--prompt-color);
    font-size: 18px;
    margin-bottom: 15px;
    text-shadow: 0 0 5px var(--glow-color);
    font-weight: 700;
}

.modal p {
    color: var(--text-color);
}

.close {
    position: absolute;
    top: 3px;
    right: 10px;
    cursor: pointer;
    font-size: 20px;
    color: var(--text-color);
}

@media (max-width: 768px) {
    .terminal {
        width: 100%;
        height: 100vh;
        padding: 0;
    }

    .boot-content {
        width: 95%;
        padding: 10px;
    }

    .boot-header {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .boot-copyright {
        font-size: 12px;
        margin-bottom: 30px;
    }

    .terminal-header {
        padding: 6px;
    }

    .title {
        font-size: 12px;
    }

    .terminal-content {
        padding: 10px;
        font-size: 14px;
        padding-bottom: 65px;
    }

    .input-line {
        font-size: 14px;
    }

    #terminal-input {
        font-size: 14px;
        width: 100%;
    }

    .output-line {
        margin-bottom: 6px;
        line-height: 1.3;
        word-break: break-word;
    }

    .output-line ul {
        padding-left: 12px;
    }

    .output-line li {
        padding-left: 12px;
    }

    /* Ajustement pour les commandes avec des listes imbriquées */
    .output-line ul ul {
        padding-left: 8px;
    }

    /* Ajustement pour les dates et titres dans les commandes jobs et education */
    .output-line span.blue,
    .output-line span.warning {
        display: inline-block;
        margin-bottom: 4px;
    }

    /* Optimisation du tactile */
    input, button {
        font-size: 16px !important; /* Empêche le zoom sur iOS */
    }

    /* Amélioration de la lisibilité sur mobile */
    .memory-check {
        font-size: 12px;
        margin: 8px 0;
    }

    .boot-progress {
        height: 15px;
    }
}

@keyframes scanline {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(100vh);
    }
}

@keyframes glow {
    0% {
        text-shadow: 0 0 5px var(--glow-color);
    }
    50% {
        text-shadow: 0 0 10px var(--glow-color),
                     0 0 15px var(--glow-color);
    }
    100% {
        text-shadow: 0 0 5px var(--glow-color);
    }
}

/* Orientation paysage sur mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .boot-content {
        margin-top: 10px;
    }

    .terminal-content {
        height: calc(100vh - 30px);
    }

    .memory-check {
        margin: 5px 0;
    }
}

/* Très petits écrans */
@media (max-width: 320px) {
    .terminal-content {
        padding: 8px;
        font-size: 13px;
    }

    .input-line {
        font-size: 13px;
    }

    .boot-header {
        font-size: 16px;
    }

    .output-line ul {
        padding-left: 8px;
    }
}

@keyframes colorPulse {
    0%,
    100% {
        color: #cccccc;
    }
    48%,
    52% {
        color: #878787;
    }
    50% {
        color: #4a4a4a;
    }
}

@keyframes wave {
    0% {
        box-shadow: 0 -10vh 20vh #0c0;
        top: -100vh;
    }
    48%,
    52% {
        box-shadow: 0 -10vh 20vh #090;
    }
    50% {
        box-shadow: 0 -10vh 20vh #060;
    }
    100% {
        box-shadow: 0 -10vh 20vh #0c0;
        top: 200vh;
    }
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

@media screen and (max-width: 600px) {
    .Typewriter__wrapper{
        width: 360px !important;
        display: block;
    }
    .Typewriter__cursor {
        display: none;
    }
}
