/* Reset et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "MS Sans Serif", Tahoma, sans-serif;
    font-size: 11px;
    overflow: hidden;
    background: #008080;
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
}

/* Bureau */
.desktop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #008080;
}

/* Icônes du bureau */
.desktop-icons {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    pointer-events: auto;
}

.desktop-icon { position: relative; }

/* Empêche les pertes de focus liées aux clics en bord de menu */
.start-menu, .submenu { pointer-events: auto; }

.desktop-icon {
    width: 75px;
    text-align: center;
    cursor: pointer;
    padding: 5px;
    border: 1px solid transparent;
}

.desktop-icon:hover {
    background: rgba(0, 0, 128, 0.3);
    border: 1px dotted #fff;
}

.desktop-icon.selected {
    background: rgba(0, 0, 128, 0.5);
    border: 1px dotted #fff;
}

.icon-image {
    width: 32px;
    height: 32px;
    margin: 0 auto 5px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.icon-label {
    color: #fff;
    font-size: 11px;
    text-shadow: 1px 1px 1px #000;
    word-wrap: break-word;
}

/* Icônes principales du bureau - Importées depuis icons.css */

/* Toutes les icônes sont maintenant dans icons.css */

/* Barre des tâches */
.taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 35px;
    background: #c0c0c0;
    border-top: 2px solid #fff;
    display: flex;
    align-items: center;
    z-index: 9999;
}

/* Bouton Démarrer */
.start-button {
    height: 30px;
    padding: 0 8px;
    margin: 2px;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #fff #000 #000 #fff;
    font-weight: bold;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.start-button:active {
    border-color: #000 #fff #fff #000;
}

.start-icon {
    width: 20px;
    height: 20px;
    background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABGklEQVQ4ja2UMU7DMBSG378BqU3blLZQKAiJBbGwMDKyMDKyMDKyMLKwMLKwsLCwsLCwICEGBgYGBjp0oFDaNE3TJm4+C4ljxzkHCf7pJP//nm35TQD4zwUAgiBAEAQIggBBECAIAvh+AL8fwO8H8P0Avh/A9wP4fgDfD+B5Pp7Pp3i+XsXL7S7enlPx/piJzDwXubwQhYKQxReTZYmyQlkhrJBVyRJlibJEWSIsEZYIS4QlwpIUlmZpluZpluYMrY1hGCJNU4RhiDiOEccx4jhGFEWIoghhGCKKIoRhiCiKEIYhwjBEGIaI45g0TTFbmZht2xzb5ti2zbFtm23bnMPhYHu9HtvtNlutFmu1Gmu1Gms2m2y329xsNr/u+w/wC3wZXU+mMM0HAAAAAElFTkSuQmCC') no-repeat center;
    background-size: contain;
}

.start-text {
    font-family: Tahoma, sans-serif;
}

/* Zone des programmes ouverts */
.taskbar-programs {
    flex: 1;
    display: flex;
    gap: 2px;
    margin: 0 5px;
}

.taskbar-button {
    height: 28px;
    padding: 0 10px;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #fff #000 #000 #fff;
    font-size: 11px;
    cursor: pointer;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
}

.taskbar-button.active {
    background: #dfdfdf;
    border-color: #000 #fff #fff #000;
    font-weight: bold;
}

.taskbar-button:active {
    border-color: #000 #fff #fff #000;
}

/* Horloge système */
.system-tray {
    padding: 0 10px;
    height: 28px;
    margin: 2px;
    border: 2px solid;
    border-color: #808080 #fff #fff #808080;
    display: flex;
    align-items: center;
}

.clock {
    font-size: 11px;
    font-family: "MS Sans Serif", Tahoma, sans-serif;
}

/* Menu Démarrer */
.start-menu {
    position: fixed;
    bottom: 35px;
    left: 0;
    width: 200px;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #fff #000 #000 #fff;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    display: flex;
    z-index: 10000;
}

.start-menu-sidebar {
    width: 25px;
    background: #808080;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 5px 0;
    color: #c0c0c0;
    font-weight: bold;
    font-size: 18px;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.start-menu-items {
    flex: 1;
    padding: 2px;
}

.menu-item {
    padding: 8px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    position: relative;
}

.menu-item:hover {
    background: #000080;
    color: #fff;
}

.menu-arrow {
    position: absolute;
    right: 5px;
}

.menu-separator {
    height: 2px;
    background: #808080;
    border-top: 1px solid #fff;
    margin: 2px 0;
}

/* Sous-menus */
.submenu {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #fff #000 #000 #fff;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    min-width: 150px;
    padding: 2px;
}

.submenu .menu-item {
    padding: 8px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.submenu .menu-item:hover {
    background: #000080;
    color: #fff;
}

/* Fenêtres */
.window {
    position: absolute;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #fff #000 #000 #fff;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.window.active {
    z-index: 2000;
}

.window.maximized {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 35px !important;
    width: auto !important;
    height: auto !important;
}

.window-header {
    height: 20px;
    background: #000080;
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 2px;
    cursor: move;
    user-select: none;
}

.window.inactive .window-header {
    background: #808080;
}

.window-icon {
    width: 16px;
    height: 16px;
    margin-right: 5px;
}

.window-title {
    flex: 1;
    font-weight: bold;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.window-controls {
    display: flex;
    gap: 2px;
}

.window-btn {
    width: 16px;
    height: 14px;
    background: #c0c0c0;
    border: 1px solid;
    border-color: #fff #000 #000 #fff;
    font-size: 10px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.window-btn:active {
    border-color: #000 #fff #fff #000;
}

.minimize-btn {
    font-weight: bold;
}

.maximize-btn {
    font-size: 11px;
}

.close-btn {
    font-weight: bold;
}

.window-menu-bar {
    background: #c0c0c0;
    border-bottom: 1px solid #808080;
    padding: 2px;
    display: flex;
    gap: 10px;
}

.menu-bar-item {
    padding: 2px 5px;
    cursor: pointer;
}

.menu-bar-item:hover {
    background: #000080;
    color: #fff;
}

.window-content {
    flex: 1;
    overflow: auto;
    background: #fff;
    border: 2px solid;
    border-color: #808080 #fff #fff #808080;
    margin: 2px;
}

.window-status-bar {
    height: 20px;
    background: #c0c0c0;
    border-top: 1px solid #fff;
    padding: 2px 5px;
    font-size: 11px;
    display: flex;
    align-items: center;
}

/* Redimensionnement des fenêtres */
.window-resize-handle {
    position: absolute;
    background: transparent;
}

.resize-n { top: -5px; left: 5px; right: 5px; height: 10px; cursor: n-resize; }
.resize-s { bottom: -5px; left: 5px; right: 5px; height: 10px; cursor: s-resize; }
.resize-e { right: -5px; top: 5px; bottom: 5px; width: 10px; cursor: e-resize; }
.resize-w { left: -5px; top: 5px; bottom: 5px; width: 10px; cursor: w-resize; }
.resize-ne { top: -5px; right: -5px; width: 10px; height: 10px; cursor: ne-resize; }
.resize-nw { top: -5px; left: -5px; width: 10px; height: 10px; cursor: nw-resize; }
.resize-se { bottom: -5px; right: -5px; width: 10px; height: 10px; cursor: se-resize; }
.resize-sw { bottom: -5px; left: -5px; width: 10px; height: 10px; cursor: sw-resize; }

/* Scrollbars */
::-webkit-scrollbar {
    width: 16px;
    height: 16px;
}

::-webkit-scrollbar-track {
    background: #c0c0c0;
}

::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #fff #000 #000 #fff;
}

::-webkit-scrollbar-thumb:active {
    border-color: #000 #fff #fff #000;
}

::-webkit-scrollbar-button {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #fff #000 #000 #fff;
}

::-webkit-scrollbar-button:active {
    border-color: #000 #fff #fff #000;
}

/* (les icônes sont chargées via <link> dans index.html) */

/* Styles spécifiques aux applications */
.file-explorer {
    display: flex;
    height: 100%;
}

.file-explorer-sidebar {
    width: 150px;
    background: #fff;
    border-right: 1px solid #808080;
    padding: 10px;
}

.file-explorer-content {
    flex: 1;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-content: flex-start;
}

.file-item {
    width: 80px;
    text-align: center;
    cursor: pointer;
    padding: 5px;
}

.file-item:hover {
    background: rgba(0, 0, 128, 0.1);
}

.file-item.selected {
    background: rgba(0, 0, 128, 0.3);
}

.file-icon {
    width: 32px;
    height: 32px;
    margin: 0 auto 5px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.file-name {
    font-size: 11px;
    word-wrap: break-word;
}

/* Classes utilitaires */
.hidden {
    display: none !important;
}

/* Styles pour iframe */
body {
    min-width: 800px;
    min-height: 600px;
    /* pas de transform ici pour éviter les décalages de souris dans une iframe */
}
