/* styles.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'MS Sans Serif', sans-serif;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

/* ===== SCÈNE 3D ===== */
#scene-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#threejs-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Écran de chargement */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-content h2 {
    font-size: 24px;
    margin-bottom: 20px;
    font-weight: normal;
}

.loading-bar {
    width: 300px;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    overflow: hidden;
    margin: 0 auto 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

#loading-progress {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    transition: width 0.3s ease;
    border-radius: 13px;
}

#loading-text {
    font-size: 18px;
    font-weight: bold;
}

/* ===== CONTENEUR WINDOWS 95 ===== */
#computer-screen-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

/* ===== MESSAGE ROTATION MOBILE ===== */
#rotate-device {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    z-index: 99999;
    justify-content: center;
    align-items: center;
}

.rotate-content {
    text-align: center;
    color: white;
    font-family: "Pixelated MS Sans Serif", Arial, sans-serif;
}

.rotate-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: rotateHint 2s ease-in-out infinite;
}

@keyframes rotateHint {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(90deg); }
}

.rotate-content p {
    font-size: 18px;
    text-shadow: 1px 1px 2px black;
}

/* Afficher le message en mode portrait sur mobile */
@media screen and (max-width: 768px) and (orientation: portrait) {
    #rotate-device {
        display: flex;
    }
    
    #computer-screen {
        display: none;
    }
}

#computer-screen-container.active {
    opacity: 1;
    pointer-events: all;
}

/* ===== ÉCRAN ===== */
#computer-screen {
    width: 100vw;
    height: 100vh;
    background: #000;
    overflow: hidden;
    position: relative;
}

/* Effet CRT vintage - Scanlines */
#computer-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(
            0deg,
            rgba(0, 0, 0, 0.15),
            rgba(0, 0, 0, 0.15) 1px,
            transparent 1px,
            transparent 2px
        );
    pointer-events: none;
    z-index: 10000;
    animation: scanlines 8s linear infinite;
}

@keyframes scanlines {
    0% { transform: translateY(0); }
    100% { transform: translateY(10px); }
}

/* Effet de courbure et vignette */
#computer-screen::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, 
        transparent 0%, 
        rgba(0, 0, 0, 0.3) 100%);
    pointer-events: none;
    z-index: 10001;
}

/* Flicker subtil */
@keyframes flicker {
    0% { opacity: 0.97; }
    50% { opacity: 1; }
    100% { opacity: 0.97; }
}

#desktop, #boot-screen {
    animation: flicker 0.15s infinite alternate;
}

/* Glow phosphore vert */
#computer-screen {
    box-shadow: inset 0 0 100px rgba(0, 255, 0, 0.05);
}

/* ===== ÉCRAN DE DÉMARRAGE ===== */
#boot-screen {
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
}

#boot-screen.hidden {
    display: none;
}

#boot-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: 30px;
}

#boot-logo img {
    max-width: 200px;
}

.boot-content {
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#boot-text {
    font-size: 16px;
    color: #fff;
}

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

/* ===== BUREAU ===== */
#desktop {
    width: 100%;
    height: 100%;
    background: #008080;
    position: relative;
    display: none;
}

#desktop.visible {
    display: block;
}

/* ===== ICÔNES DU BUREAU ===== */
.desktop-icon {
    position: absolute;
    width: 80px;
    text-align: center;
    cursor: pointer;
    color: white;
    text-shadow: 1px 1px 2px black;
    padding: 5px;
    user-select: none;
    -webkit-user-select: none;
}

.desktop-icon:hover {
    background: rgba(0, 0, 128, 0.3);
}

.desktop-icon.selected {
    background: rgba(0, 0, 128, 0.5);
}

.icon-image {
    width: 48px;
    height: 48px;
    margin: 0 auto 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.icon-image img {
    display: block;
    width: 48px;
    height: 48px;
}

.icon-label {
    font-size: 11px;
    font-family: "Pixelated MS Sans Serif", Arial, sans-serif;
}

/* ===== FENÊTRES ===== */
.window {
    position: absolute;
    min-width: 300px;
    display: none;
}

.window .title-bar {
    cursor: move;
}

.window.visible {
    display: block;
}

/* Styles pour la fenêtre maximisée */
.window.maximized {
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: calc(100% - 40px) !important; /* Moins la barre des tâches */
    transform: none !important; /* Annule le centrage de la fenêtre de bienvenue */
}

/* Quand maximisé, on ne peut pas drag */
.window.maximized .title-bar {
    cursor: default;
}

/* z-index géré dynamiquement par windowManager.js */

.window-body {
    padding: 15px;
    /* Increased to fit more content when CV window is taller */
    max-height: 600px;
    overflow-y: auto;
    /* Taille de police et interlignage spécifiques pour la fenêtre CV */
    font-size: 16px;
    line-height: 1.6;
    color: #111;
}

/* Styles ciblés pour améliorer lisibilité du CV uniquement */
#cv-window .window-body h2 {
    font-size: 48px;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

#cv-window .window-body h3 {
    font-size: 28px;
    margin-top: 6px;
}

#cv-window .window-body h4 {
    font-size: 18px;
    margin-top: 12px;
}

#cv-window .window-body hr {
    margin: 20px 0;
    border: none;
    border-top: 1px solid rgba(0,0,0,0.15);
}

/* CV Header avec photo */
.cv-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.cv-info {
    flex: 1;
}

.cv-photo {
    flex-shrink: 0;
    margin-left: 20px;
    width: 150px;
    height: 150px;
    background-size: cover;
    background-position: center;
    border: 2px solid #000;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: none;
    -webkit-user-drag: none;
}

.window-body h2 {
    margin-bottom: 10px;
}

.window-body h3 {
    margin-top: 10px;
}

.window-body p {
    margin: 10px 0;
    line-height: 1.4;
}

.window-body ul {
    margin: 10px 0 10px 20px;
}

.window-body li {
    margin: 5px 0;
}

/* ===== BARRE DES TÂCHES ===== */
#taskbar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: #c0c0c0;
    border-top: 2px solid white;
    display: none; /* Caché par défaut pendant le boot */
    align-items: center;
    padding: 2px;
    z-index: 2000;
}

#taskbar.visible {
    display: flex;
}

#start-button {
    height: 32px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    user-select: none;
    -webkit-user-select: none;
}

#taskbar-buttons {
    display: flex;
    gap: 2px;
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    margin: 0 5px;
    align-items: center;
}

#taskbar-buttons::-webkit-scrollbar {
    height: 0;
}

.taskbar-button {
    height: 28px;
    min-width: 120px;
    max-width: 160px;
    padding: 0 8px;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.taskbar-button.active {
    border-style: inset;
}

#sound-toggle {
    margin-left: auto;
    border: 2px inset #dfdfdf;
    width: 24px;
    height: 24px;
    background: #c0c0c0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#clock {
    border: 2px inset #dfdfdf;
    padding: 4px 8px;
    font-size: 12px;
    flex-shrink: 0;
}

/* ===== MENU DÉMARRER ===== */
#start-menu {
    position: absolute;
    bottom: 40px;
    left: 2px;
    width: 200px;
    background: #c0c0c0;
    border: 2px outset #dfdfdf;
    display: none;
    z-index: 3000;
}

#start-menu.visible {
    display: block;
}

.start-menu-item {
    padding: 8px 30px 8px 40px;
    cursor: pointer;
    position: relative;
}

.start-menu-item:hover {
    background: #000080;
    color: white;
}

.start-menu-separator {
    height: 2px;
    background: #808080;
    margin: 2px 0;
}

/* ===== STYLES SUPPLÉMENTAIRES ===== */
.title-bar-controls button:last-child:active {
    background: red;
}

.field-row {
    margin: 10px 0;
}

.field-row label {
    display: inline-block;
    width: 80px;
}

.field-row input,
.field-row textarea {
    width: calc(100% - 90px);
}

