/* Contient l'intégralité du CSS de votre fichier d'origine */
:root {
    --grid-size: 100px; /* Taille pour la grille du bureau */
    --taskbar-height: 48px;
    --accent-color: #06b6d4; /* La couleur cyan par défaut */
    --accent-color-hover: #0891b2; 
}
@keyframes rainbow-flow {
    0%   { --accent-color: hsl(0, 80%, 80%); --accent-color-hover: hsl(0, 80%, 75%); }
    16%  { --accent-color: hsl(60, 80%, 80%); --accent-color-hover: hsl(60, 80%, 75%); }
    33%  { --accent-color: hsl(120, 80%, 80%); --accent-color-hover: hsl(120, 80%, 75%); }
    50%  { --accent-color: hsl(180, 80%, 80%); --accent-color-hover: hsl(180, 80%, 75%); }
    66%  { --accent-color: hsl(240, 80%, 80%); --accent-color-hover: hsl(240, 80%, 75%); }
    83%  { --accent-color: hsl(300, 80%, 80%); --accent-color-hover: hsl(300, 80%, 75%); }
    100% { --accent-color: hsl(360, 80%, 80%); --accent-color-hover: hsl(360, 80%, 75%); }
}
.rainbow-active {
    animation: rainbow-flow 10s linear infinite;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    user-select: none;
    transition: font-family 0.3s ease;
}
.desktop {
    background-image: url('https://i.ibb.co/Cs5hLtKm/backgroundpcuac.png');
    background-size: cover;
    background-position: center;
    width: 100vw;
    height: 100vh;
    transition: background-image 0.5s ease-in-out;
}
.window {
    min-width: 400px;
    min-height: 300px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border: 1px solid rgba(100, 100, 100, 0.5);
    resize: none; /* Désactiver le resize natif */
    display: flex;
    flex-direction: column;
}
.title-bar { cursor: move; }
.window.maximized {
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: calc(100vh - var(--taskbar-height)) !important;
    border-radius: 0;
    border: none;
}
.desktop-icon {
    cursor: pointer;
    width: var(--grid-size);
    height: var(--grid-size);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s;
}
.desktop-icon:hover { background-color: rgba(255, 255, 255, 0.1); }
.desktop-icon img { width: 48px; height: 48px; margin-bottom: 8px; pointer-events: none; }
.desktop-icon span { color: white; text-shadow: 1px 1px 3px rgba(0,0,0,0.7); font-size: 12px; pointer-events: none; }
.desktop-icon.dragging {
    opacity: 0.5;
    z-index: 9999;
}
/* NOUVEAU: Style pour les icônes sélectionnées */
.desktop-icon.selected {
    background-color: rgba(59, 130, 246, 0.5);
    border: 1px solid rgba(96, 165, 250, 0.8);
}
.drop-target {
    background-color: rgba(6, 182, 212, 0.3) !important;
    outline: 2px dashed var(--accent-color);
}


#taskbar {
    transition: background-color 0.3s, backdrop-filter 0.3s, border-color 0.3s;
}
.taskbar-default {
    background-color: rgba(20, 20, 30, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid rgba(255,255,255,0.1);
}
.taskbar-light {
     background-color: rgba(220, 220, 230, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid rgba(0,0,0,0.1);
}
.taskbar-dark {
     background-color: rgb(24, 24, 27);
     backdrop-filter: none;
     border-top: 1px solid rgba(255,255,255,0.2);
}

.taskbar-icon {
    height: 36px;
    width: 36px;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
    position: relative;
}
.taskbar-icon.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 2px;
    background-color: var(--accent-color);
}
#file-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    align-content: flex-start;
}
.file-item { height: 110px; }
.file-item.selected { background-color: rgba(59, 130, 246, 0.5) !important; }
.animate-shake { animation: shake 0.5s; }
@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); } 20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); } 40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* --- Verrouillage de l'orientation --- */
.orientation-lock { display: none; position: fixed; inset: 0; background-color: #000; color: white; z-index: 9999; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 2rem; }
@media screen and (orientation: portrait) and (max-width: 820px) {
    #desktop-wrapper, #login-screen { display: none !important; }
    .orientation-lock { display: flex; }
}
/* --- Fin Verrouillage --- */

/* Poignées de redimensionnement */
.resizer { position: absolute; background: transparent; }
.resizer.top-left { top: -5px; left: -5px; width: 10px; height: 10px; cursor: nwse-resize; }
.resizer.top-right { top: -5px; right: -5px; width: 10px; height: 10px; cursor: nesw-resize; }
.resizer.bottom-left { bottom: -5px; left: -5px; width: 10px; height: 10px; cursor: nesw-resize; }
.resizer.bottom-right { bottom: -5px; right: -5px; width: 10px; height: 10px; cursor: nwse-resize; }
.resizer.top { top: -5px; left: 5px; width: calc(100% - 10px); height: 10px; cursor: ns-resize; }
.resizer.bottom { bottom: -5px; left: 5px; width: calc(100% - 10px); height: 10px; cursor: ns-resize; }
.resizer.left { top: 5px; left: -5px; width: 10px; height: calc(100% - 10px); cursor: ew-resize; }
.resizer.right { top: 5px; right: -5px; width: 10px; height: calc(100% - 10px); cursor: ew-resize; }

/* Styles pour le chat de l'assistant */
.chat-message { padding: 8px 12px; border-radius: 18px; max-width: 80%; word-wrap: break-word; }
.user-message { background-color: var(--accent-color); color: white; align-self: flex-end; border-bottom-right-radius: 4px; }
.assistant-message { background-color: #374151; color: white; align-self: flex-start; border-bottom-left-radius: 4px; }
.assistant-message ul, .assistant-message ol { margin-left: 20px; margin-top: 8px; margin-bottom: 8px; }
.assistant-message ul { list-style-type: disc; } .assistant-message ol { list-style-type: decimal; }
.assistant-message pre { background-color: #1f2937; padding: 10px; border-radius: 6px; overflow-x: auto; margin-top: 8px; margin-bottom: 8px; white-space: pre-wrap; word-wrap: break-word; }
.assistant-message code { font-family: monospace; }
.assistant-message p { margin-bottom: 8px; } .assistant-message p:last-child { margin-bottom: 0; }

/* Styles pour la fenêtre des paramètres */
.settings-section-title { font-size: 1.125rem; font-weight: 600; border-bottom: 1px solid #4a5568; padding-bottom: 0.5rem; margin-bottom: 1rem; }
.wallpaper-thumbnail { border: 2px solid transparent; transition: border-color 0.2s; }
.wallpaper-thumbnail.selected { border-color: var(--accent-color); }
#accent-color-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
    gap: 0.75rem;
}
.color-swatch {
    width: 100%;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}
.color-swatch.selected {
    border-color: white;
}
@keyframes rainbow-border {
    0%,100% { border-color: #ffadad; } 16% { border-color: #ffd6a5; } 33% { border-color: #fdffb6; } 50% { border-color: #caffbf; } 66% { border-color: #9bf6ff; } 83% { border-color: #a0c4ff; }
}
.rainbow-swatch {
    background: linear-gradient(90deg, #ffadad, #ffd6a5, #fdffb6, #caffbf, #9bf6ff, #a0c4ff, #bdb2ff, #ffadad);
    background-size: 200% 200%;
    animation: rainbow-swatch-anim 8s ease infinite;
}
.rainbow-swatch.selected {
    animation: rainbow-border 4s linear infinite;
}
@keyframes rainbow-swatch-anim { 
    0%{background-position:0% 50%}
    50%{background-position:100% 50%}
    100%{background-position:0% 50%}
}

/* Effet de survol pour la barre latérale de l'explorateur */
.sidebar-item {
    position: relative;
    z-index: 1; 
}
.sidebar-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--accent-color);
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    border-radius: 0.25rem;
    z-index: -1;
}
.sidebar-item:hover::before {
    opacity: 0.5;
}

/* --- Styles Email --- */
.email-list-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}
.email-list-item.selected {
     background-color: var(--accent-color) !important;
     color: black;
}
.email-list-item.selected .text-gray-400 {
    color: #333;
}
 .email-list-item .font-bold {
     font-weight: 800; /* Extra-bold for unread */
 }
 .email-list-item.read .font-bold {
     font-weight: 500; /* Medium for read */
 }

/* --- Keypad --- */
#keypad-modal {
     z-index: 9000;
}
.keypad {
    width: 300px;
}
#keypad-display {
    letter-spacing: 0.5em;
}
.keypad-btn {
    transition: background-color 0.2s;
}
@keyframes keypad-shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}
.keypad-shake {
  animation: keypad-shake 0.5s;
}

/* --- User Profile Popup --- */
#user-profile-popup {
    bottom: calc(var(--taskbar-height) + 10px);
    left: 10px;
    width: 250px;
    z-index: 50;
    transition: opacity 0.2s, transform 0.2s;
}

/* --- Notepad Styles --- */
.markdown-preview img { max-width: 100%; height: auto; border-radius: .375rem; }
.markdown-preview h1, .markdown-preview h2, .markdown-preview h3 { border-bottom: 1px solid #4a5568; padding-bottom: .3em; margin-bottom: .5em; margin-top: 1em; }
.markdown-preview h1 { font-size: 1.8em; } .markdown-preview h2 { font-size: 1.5em; } .markdown-preview h3 { font-size: 1.2em; }
.markdown-preview p { margin-bottom: 1em; }
.markdown-preview a { color: var(--accent-color); text-decoration: underline; }
.markdown-preview ul, .markdown-preview ol { margin-left: 1.5rem; margin-bottom: 1em; list-style-position: inside;}
.markdown-preview ul { list-style-type: disc; } .markdown-preview ol { list-style-type: decimal; }
.markdown-preview blockquote { border-left: 4px solid #4a5568; padding-left: 1rem; margin-left: 0; color: #a0aec0; }
.markdown-preview pre { background-color: #1a202c; padding: 1rem; border-radius: .375rem; overflow-x: auto; margin-bottom: 1em; }
.markdown-preview code { font-family: 'Roboto Mono', monospace; background-color: #2d3748; padding: .125rem .25rem; border-radius: .25rem; }
.markdown-preview pre code { background-color: transparent; padding: 0; }
.markdown-preview table { width: 100%; border-collapse: collapse; margin-bottom: 1em; }
.markdown-preview th, .markdown-preview td { border: 1px solid #4a5568; padding: .5rem; }
.markdown-preview th { background-color: #2d3748; }

.toolbar-btn {
    background: none;
    border: 1px solid transparent;
    color: #d1d5db;
    padding: 4px 8px;
    border-radius: 4px;
}
.toolbar-btn:hover {
    background-color: #4b5563;
    border-color: #6b7280;
}
.toolbar-separator {
    width: 1px;
    background-color: #4b5563;
    margin: 4px 8px;
}
/* Hide color input default UI */
input[type="color"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background-color: transparent;
    border: none;
    cursor: pointer;
}
input[type="color"]::-webkit-color-swatch {
    border-radius: 50%;
    border: 2px solid #d1d5db;
}
input[type="color"]::-moz-color-swatch {
    border-radius: 50%;
    border: 2px solid #d1d5db;
}

/* NOUVEAU: Menu Contextuel */
.context-menu-item {
    padding: 8px 16px;
    cursor: pointer;
}
.context-menu-item:hover {
    background-color: var(--accent-color);
}
.context-menu-separator {
    height: 1px;
    background-color: #4a5568;
    margin: 4px 0;
}
.context-menu-item.disabled {
    color: #6b7280;
    cursor: not-allowed;
}
.context-menu-item.disabled:hover {
    background-color: transparent;
}
