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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    background: linear-gradient(45deg, #1e3c72, #2a5298);
    height: 100vh;
}

#desktop {
    width: 100vw;
    height: 100vh;
    position: relative;
}

/* Barre de tâches */
#taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.taskbar-left, .taskbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

#start-btn {
    background: #0078d4;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

#start-btn:hover {
    background: #106ebe;
}

#clock {
    color: white;
    font-size: 12px;
}

#system-status {
    color: #ff6b6b;
    font-size: 12px;
    font-weight: bold;
}

/* Bureau */
#desktop-area {
    width: 100%;
    height: calc(100vh - 40px);
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, 100px);
    grid-template-rows: repeat(auto-fit, 120px);
    gap: 20px;
    align-content: start;
}

/* Icônes du bureau */
.desktop-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 100px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    padding: 10px;
}

.desktop-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.desktop-icon img {
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
}

.desktop-icon span {
    color: white;
    font-size: 11px;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    word-wrap: break-word;
    max-width: 100%;
}

/* Fenêtres */
.window {
    position: fixed;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    min-width: 400px;
    min-height: 300px;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 100;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    overflow: hidden;
    resize: both;
    border: 2px solid #ddd;
}

.window:focus-within {
    border-color: #2196f3;
    z-index: 101;
}

/* Tailles spécifiques pour chaque fenêtre */
#folder-window {
    width: 800px;
    height: 600px;
}

#settings-window {
    width: 500px;
    height: 400px;
}

#terminal-window {
    width: 700px;
    height: 450px;
}

#game-window {
    width: 850px;
    height: 500px;
}

#file-editor {
    width: 600px;
    height: 500px;
}

/* Styles pour le déplacement des fenêtres */
.window.dragging {
    opacity: 0.9;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.window.dragging .window-header {
    background: #d0d0d0;
}

/* Indicateur de redimensionnement */
.window::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 15px;
    height: 15px;
    background: linear-gradient(-45deg, transparent 30%, #ccc 30%, #ccc 50%, transparent 50%);
    cursor: se-resize;
    pointer-events: none;
}

.window.hidden {
    display: none;
}

.window-header {
    background: #f0f0f0;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
    font-weight: bold;
    cursor: move;
    user-select: none;
}

.window-header:hover {
    background: #e8e8e8;
}

.close-btn {
    background: #ff5f57;
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: #ff3b30;
}

.window-content {
    padding: 20px;
    height: calc(100% - 60px); /* Hauteur totale - header */
    overflow-y: auto;
    box-sizing: border-box;
}

/* Erreur du jeu */
#game-error {
    text-align: center;
    padding: 40px;
}

#game-error h3 {
    color: #d32f2f;
    margin-bottom: 15px;
    font-size: 18px;
}

#game-error p {
    margin-bottom: 10px;
    color: #666;
}

#retry-game {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 15px;
}

#retry-game:hover {
    background: #ff5252;
}

/* Explorateur de fichiers */
.explorer-toolbar {
    background: #f0f0f0;
    padding: 8px;
    border-bottom: 1px solid #ccc;
    display: flex;
    align-items: center;
    gap: 10px;
}

.explorer-toolbar button {
    padding: 4px 8px;
    background: #fff;
    border: 1px solid #ccc;
    cursor: pointer;
    border-radius: 3px;
}

.explorer-toolbar button:disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

#current-path {
    font-family: monospace;
    background: #fff;
    padding: 4px 8px;
    border: 1px solid #ccc;
    flex-grow: 1;
    border-radius: 3px;
}

.explorer-content {
    display: flex;
    height: calc(100% - 40px); /* Hauteur totale - toolbar */
    min-height: 300px;
}

.folder-tree {
    width: 200px;
    background: #f9f9f9;
    border-right: 1px solid #ccc;
    overflow-y: auto;
    padding: 5px;
}

.tree-item {
    display: block;
    padding: 4px 8px;
    cursor: pointer;
    user-select: none;
    border-radius: 3px;
    margin-bottom: 2px;
}

.tree-item:hover {
    background-color: #e3f2fd;
}

.tree-item.selected {
    background-color: #2196f3;
    color: white;
}

.tree-children {
    margin-left: 15px;
}

.tree-children.hidden {
    display: none;
}

.folder-icon {
    margin-right: 5px;
}

.file-view {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
    background: white;
}

/* Liste de fichiers */
.file-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.file-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    text-align: center;
}

.file-item:hover {
    background: #e3f2fd;
}

.file-icon {
    font-size: 32px;
}

.file-item span:last-child {
    font-size: 12px;
    word-wrap: break-word;
    max-width: 100%;
}

/* Paramètres */
.settings-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.settings-panel h3 {
    color: #333;
    border-bottom: 2px solid #0078d4;
    padding-bottom: 5px;
}

.settings-panel label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-weight: bold;
}

.settings-panel select,
.settings-panel input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

#apply-settings {
    background: #0078d4;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    align-self: flex-start;
}

#apply-settings:hover {
    background: #106ebe;
}

/* Section multijoueur */
.multiplayer-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 2px solid #ddd;
}

#connect-multiplayer {
    background: #4caf50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

#connect-multiplayer:hover {
    background: #45a049;
}

#connection-status {
    padding: 8px;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
}

.status-disconnected {
    background: #ffebee;
    color: #c62828;
}

.status-connecting {
    background: #fff3e0;
    color: #ef6c00;
}

.status-connected {
    background: #e8f5e8;
    color: #2e7d32;
}

/* Terminal */
#terminal-output {
    background: #000;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    padding: 15px;
    height: 300px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.4;
    white-space: pre-wrap;
}

#terminal-input-line {
    background: #000;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    padding: 10px 15px;
    display: flex;
    align-items: center;
}

#terminal-prompt {
    color: #00ff00;
    margin-right: 5px;
}

#terminal-input {
    background: transparent;
    border: none;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    outline: none;
    flex: 1;
}

/* Éditeur de fichiers */
#file-content {
    width: 100%;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    border: 1px solid #ddd;
    padding: 10px;
    resize: vertical;
}

.editor-buttons {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.editor-buttons button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

#save-file {
    background: #4caf50;
    color: white;
}

#save-file:hover {
    background: #45a049;
}

#cancel-edit {
    background: #f44336;
    color: white;
}

#cancel-edit:hover {
    background: #da190b;
}

/* Message de succès */
#success-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    max-width: 500px;
}

#success-message.hidden {
    display: none;
}

#success-message h2 {
    margin-bottom: 20px;
    font-size: 28px;
}

#success-message p {
    margin-bottom: 15px;
    font-size: 16px;
    line-height: 1.5;
}

/* Canvas du jeu Pong */
#pong-canvas {
    border: 2px solid #333;
    background: #000;
    display: block;
    margin: 0 auto;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.window:not(.hidden) {
    animation: fadeIn 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .window {
        min-width: 90vw;
        min-height: 80vh;
    }
    
    #desktop-area {
        grid-template-columns: repeat(auto-fit, 80px);
        gap: 15px;
    }
    
    .desktop-icon {
        width: 70px;
        height: 90px;
    }
} 