/* ==========================================================================
   LibreAir OS - Styles
   Rétro 90s Design System
   ========================================================================== */

[x-cloak] { display: none !important; }

body { 
    background-color: #008080;
    overflow: hidden; 
    user-select: none;
}

/* Bordures Rétro 90s */
.window-border {
    background: #c0c0c0;
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-right: 2px solid #000000;
    border-bottom: 2px solid #000000;
    box-shadow: 1px 1px 0px #808080 inset, -1px -1px 0px #808080 inset;
}

.window-header {
    background: linear-gradient(90deg, #000080, #1084d0);
    color: white;
    font-weight: bold;
    padding: 2px 4px;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    box-sizing: border-box !important;
    min-height: 20px;
}

.window-header .window-title {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    min-width: 0 !important;
    font-size: 11px !important;
    font-family: Tahoma, "MS Sans Serif", sans-serif;
}



.window-header .window-buttons {
    display: flex !important;
    gap: 2px !important;
    flex-shrink: 0 !important;
}

/* Boutons OS */
.btn-os {
    background: #c0c0c0;
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-right: 2px solid #000000;
    border-bottom: 2px solid #000000;
    padding: 2px 10px;
    font-weight: bold;
    color: black;
    cursor: pointer;
}

.btn-os:active {
    border-top: 2px solid #000000;
    border-left: 2px solid #000000;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    padding: 3px 9px 1px 11px; 
}

.btn-os:disabled {
    color: #808080;
    text-shadow: 1px 1px 0px #ffffff;
}

/* Champ enfoncé */
.inset-border {
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    background: white;
}

/* Scanlines CRT */
.scanlines::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 9999;
    background-size: 100% 4px, 6px 100%;
    pointer-events: none;
}

/* Icônes de bureau */
.desktop-icon {
    position: absolute;
    width: 80px;
    text-align: center;
    cursor: pointer;
    padding: 5px;
    border: 1px dotted transparent;
}
.desktop-icon:hover { background: rgba(255,255,255,0.1); }
.desktop-icon.selected {
    background: #000080;
    border: 1px dotted #ffffff;
}
.desktop-icon.selected .icon-text {
    color: white;
    background: #000080;
}
.icon-text {
    color: white;
    font-size: 12px;
    text-shadow: 1px 1px 0 #000;
    margin-top: 5px;
    padding: 2px;
    display: inline-block;
    line-height: 1.2;
}

/* Avatar du compagnon */
.companion-avatar { animation: float 3s ease-in-out infinite; }
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0px); }
}

/* Indicateur de frappe */
.typing-indicator span {
    display: inline-block;
    width: 5px; height: 5px;
    background-color: #333;
    border-radius: 50%; margin: 0 2px;
    animation: bounce 1.4s infinite ease-in-out both;
}
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Radio buttons rétro */
input[type="radio"] {
    appearance: none;
    width: 14px; height: 14px;
    background: white;
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    border-radius: 50%;
    outline: none;
    position: relative;
    cursor: pointer;
}
input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 6px; height: 6px;
    background: black;
    border-radius: 50%;
}

/* ==========================================================================
   IMPRESSION ULTRA PRO
   ========================================================================== */
.print-document, .print-logbook-document { display: none; }

@media print {
    @page { margin: 8mm 10mm; size: A4; }
    
    /* Masquer entièrement l'OS interactif et le quadrillage de l'écran */
    #app-interface, .scanlines::before {
        display: none !important;
    }
    
    html, body { 
        background: white !important; 
        overflow: visible !important; 
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .print-document, .print-logbook-document { 
        box-sizing: border-box !important;
        color: black !important; 
        font-family: 'Outfit', sans-serif !important;
    }
    
    /* Mode Fiche de Lecture */
    body.print-report-mode .print-document {
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        height: 100% !important;
        width: 100% !important;
    }
    body.print-report-mode .print-logbook-document {
        display: none !important;
    }
    
    /* Mode Carnet de Lectures */
    body.print-logbook-mode .print-logbook-document {
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        height: 100% !important;
        width: 100% !important;
    }
    body.print-logbook-mode .print-document {
        display: none !important;
    }
    
    .print-header { border-bottom: 2px solid #333; padding-bottom: 8px; margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; }
    .print-title { font-size: 18pt; font-weight: 850; letter-spacing: -0.03em; }
    .print-meta { font-size: 10pt; color: #555; }
    .print-section { margin-bottom: 18px; }
    .print-section-title { font-size: 11pt; font-weight: bold; background: #f4f2ee; padding: 4px 8px; margin-bottom: 8px; border-left: 3px solid #8db693; }
    .print-summary { font-size: 10pt; line-height: 1.5; font-style: italic; border-left: 3px solid #ccc; padding-left: 10px; }
    .print-verdict { text-align: center; font-size: 13pt; font-weight: 900; border: 2px solid black; padding: 6px 12px; width: fit-content; margin: 15px auto; text-transform: uppercase; }
}

/* Flash d'Allumage physique de TV CRT (Ligne horizontale blanche) */
.crt-line-flash {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 3px;
    background: white;
    box-shadow: 0 0 10px white;
    z-index: 10002;
    transform: scaleX(0);
    animation: crt-flash-anim 0.5s ease-out both;
}

@keyframes crt-flash-anim {
    0% {
        transform: scaleX(0) scaleY(1);
        opacity: 1;
    }
    50% {
        transform: scaleX(1) scaleY(1);
        opacity: 1;
    }
    80% {
        transform: scaleX(1) scaleY(4);
        opacity: 0.8;
    }
    100% {
        transform: scaleX(1) scaleY(0);
        opacity: 0;
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}
