/* ============================================
   WINDOWS CMD TERMINAL CLONE - STYLES CSS
   Responsive & Mobile-First
   ============================================ */

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

body {
    background: #1a1a1a;
    font-family: 'Consolas', 'Courier New', 'Lucida Console', monospace;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

/* ===== TERMINAL WRAPPER ===== */
.cmd-wrapper {
    width: 100%;
    max-width: 900px;
    height: 85vh;
    min-height: 400px;
    max-height: 700px;
    background: #0c0c0c;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    border: 1px solid #2a2a2a;
}

/* ===== TITLE BAR ===== */
.cmd-titlebar {
    background: #1f1f1f;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #333;
    user-select: none;
    flex-shrink: 0;
}

.cmd-title-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cmd-icon {
    width: 18px;
    height: 18px;
    background: #0c0c0c;
    border: 1px solid #555;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #fff;
    border-radius: 2px;
}

.cmd-title-text {
    font-size: 13px;
    color: #cccccc;
    font-weight: 400;
}

.cmd-title-btns {
    display: flex;
    gap: 2px;
}

.cmd-tbtn {
    width: 34px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #ccc;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s ease;
    font-family: 'Segoe UI', sans-serif;
}

.cmd-tbtn:hover {
    background: #333;
}

.cmd-tbtn.close:hover {
    background: #c42b1c;
    color: #fff;
}

/* ===== TERMINAL BODY ===== */
.cmd-body {
    flex: 1;
    padding: 6px 10px;
    overflow-y: auto;
    overflow-x: hidden;
    font-size: 14px;
    line-height: 1.5;
    color: #cccccc;
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* Scrollbar personnalisée */
.cmd-body::-webkit-scrollbar {
    width: 8px;
}

.cmd-body::-webkit-scrollbar-track {
    background: #0c0c0c;
}

.cmd-body::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

.cmd-body::-webkit-scrollbar-thumb:hover {
    background: #444;
}

/* ===== LIGNES DE TEXTE ===== */
.cmd-line {
    margin: 0;
    padding: 1px 0;
    word-wrap: break-word;
}

/* ===== LIGNE DE SAISIE ===== */
.cmd-prompt-line {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    margin-top: 2px;
}

.cmd-prompt {
    color: #cccccc;
    white-space: pre;
    user-select: none;
    font-size: 14px;
    line-height: 1.5;
    padding-right: 4px;
}

.cmd-input {
    background: transparent;
    border: none;
    outline: none;
    color: #cccccc;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    flex: 1;
    min-width: 60px;
    caret-color: transparent; /* Curseur personnalisé */
    padding: 0;
    margin: 0;
}

.cmd-cursor {
    display: inline-block;
    width: 8px;
    height: 16px;
    background: #cccccc;
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
    margin-left: 1px;
    flex-shrink: 0;
}

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

/* ===== COULEURS DE COMMANDES ===== */
.cmd-dir {
    color: #1db954;
}

.cmd-file {
    color: #cccccc;
}

.cmd-error {
    color: #ff6b6b;
}

.cmd-success {
    color: #4ecdc4;
}

.cmd-info {
    color: #74b9ff;
}

.cmd-warning {
    color: #f39c12;
}

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

    .cmd-wrapper {
        width: 100vw;
        height: 100vh;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
        border: none;
    }

    .cmd-titlebar {
        padding: 6px 10px;
    }

    .cmd-title-text {
        font-size: 12px;
    }

    .cmd-body {
        padding: 4px 8px;
        font-size: 13px;
    }

    .cmd-prompt {
        font-size: 13px;
    }

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

    .cmd-cursor {
        width: 7px;
        height: 14px;
    }

    .cmd-tbtn {
        width: 30px;
        height: 22px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .cmd-body {
        font-size: 12px;
        line-height: 1.4;
    }

    .cmd-prompt {
        font-size: 12px;
    }

    .cmd-input {
        font-size: 12px;
    }

    .cmd-cursor {
        width: 6px;
        height: 13px;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(2px); }
    to { opacity: 1; transform: translateY(0); }
}

.cmd-line {
    animation: fadeIn 0.1s ease-out;
}
