* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    background: #008080;
    background: linear-gradient(135deg, #1e88e5 0%, #0d47a1 100%);
}

.desktop {
    height: calc(100vh - 40px);
    padding: 20px;
    position: relative;
    overflow: auto;
}

/* Desktop Icons */
.desktop-icon {
    width: 80px;
    text-align: center;
    cursor: pointer;
    position: absolute;
    user-select: none;
    padding: 5px;
}

.desktop-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

.desktop-icon.selected {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.desktop-icon img {
    width: 48px;
    height: 48px;
    margin-bottom: 5px;
    pointer-events: none;
}

.desktop-icon span {
    display: block;
    color: white;
    font-size: 11px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    word-wrap: break-word;
    pointer-events: none;
}

/* Fenster */
.window {
    position: absolute;
    display: flex;
    flex-direction: column;
    z-index: 10;
    min-width: 400px;
    min-height: 300px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.window.active {
    z-index: 100;
}

/* Fenster Header */
.window-header {
    display: flex;
    height: 40px;
    cursor: move;
    user-select: none;
    position: relative;
    background: linear-gradient(180deg, #5ba4e5 0%, #3d8fd1 50%, #2b7bbf 100%);
    border: 2px solid #1a5a8a;
    border-bottom: 3px solid #0d3a5f;
    border-radius: 8px 8px 0 0;
    padding: 0 10px;
    align-items: center;
}

.window-header-left {
    display: none;
}

.window-header-middle {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 10px;
}

.window-header-right {
    display: none;
}

.window-title {
    font-size: 14px;
    font-weight: 600;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    flex: 1;
}

.window-controls {
    display: flex;
    align-items: center;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.window-controls button {
    width: 50px;
    height: 28px;
    border: none;
    background: linear-gradient(180deg, #e74c3c 0%, #c0392b 100%);
    border: 2px solid #a93226;
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.window-controls button:hover {
    background: linear-gradient(180deg, #ec7063 0%, #cb4335 100%);
}

.window-controls button:active {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.window-controls button::before {
    content: '×';
    color: white;
    font-size: 24px;
    font-weight: bold;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    line-height: 1;
}

/* Fenster Hauptbereich */
.window-content {
    flex: 1;
    background: white;
    overflow: auto;
    border: 2px solid #1a5a8a;
    border-top: none;
    border-radius: 0 0 8px 8px;
    position: relative;
}

/* Media Content (für Audio/Video) */
.window-content > div {
    padding: 15px;
}

/* Folder Content */
.folder-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 20px;
    padding: 10px;
}

.folder-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    border-radius: 4px;
}

.folder-item:hover {
    background: rgba(0, 120, 215, 0.1);
}

.folder-item img {
    width: 48px;
    height: 48px;
    margin-bottom: 5px;
}

.folder-item span {
    font-size: 12px;
    text-align: center;
    word-wrap: break-word;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border: 2px solid #0078d7;
    width: 90%;
    max-width: 400px;
    margin: 0 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background: #0078d7;
    color: white;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 14px;
    font-weight: 600;
}

.close-modal {
    cursor: pointer;
    font-size: 20px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 20px;
}

.modal-body p {
    margin-bottom: 15px;
}

.modal-body input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    margin-bottom: 15px;
    font-size: 14px;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-buttons button {
    padding: 6px 20px;
    border: 1px solid #0078d7;
    background: #0078d7;
    color: white;
    cursor: pointer;
    font-size: 14px;
}

.modal-buttons button:hover {
    background: #005a9e;
}

.modal-buttons button:last-child {
    background: white;
    color: #333;
}

.modal-buttons button:last-child:hover {
    background: #f0f0f0;
}

/* Taskleiste */
.taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    padding: 0 10px;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.3);
}

.start-button {
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    color: white;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    border-radius: 2px;
}

.start-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.taskbar-items {
    flex: 1;
    display: flex;
    gap: 5px;
    margin-left: 10px;
}

.taskbar-item {
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    color: white;
    font-size: 12px;
    border-radius: 2px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.taskbar-item:hover {
    background: rgba(255, 255, 255, 0.2);
}

.taskbar-item.active {
    background: rgba(255, 255, 255, 0.3);
}

.system-tray {
    margin-left: auto;
    color: white;
    font-size: 12px;
    padding: 0 10px;
}

/* Resize Handle */
.resize-handle {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 20px;
    height: 20px;
    cursor: nwse-resize;
}

/* Responsive Design */
@media (max-width: 768px) {
    .desktop {
        padding: 10px;
    }
    
    .desktop-icon {
        width: 70px;
        position: relative !important;
        display: inline-block;
        margin: 5px;
    }
    
    .desktop-icon img {
        width: 40px;
        height: 40px;
    }
    
    .desktop-icon span {
        font-size: 10px;
    }
    
    .window {
        width: 100% !important;
        height: calc(100vh - 100px) !important;
        min-width: 100% !important;
        max-width: 100% !important;
        left: 0 !important;
        top: 0 !important;
        margin: 10px 0;
    }
    
    .window-header {
        height: 35px;
        font-size: 12px;
    }
    
    .taskbar {
        height: 35px;
        font-size: 11px;
    }
    
    .taskbar-item {
        padding: 5px 8px;
        font-size: 11px;
    }
    
    .folder-content {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 15px;
    }
    
    .folder-item {
        font-size: 10px;
    }
    
    .folder-item img {
        width: 40px;
        height: 40px;
    }
    
    /* Modal responsive */
    .modal-content {
        width: 95%;
        margin: 0 10px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .modal-body input {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .desktop {
        padding: 5px;
    }
    
    .desktop-icon {
        width: 60px;
        margin: 3px;
    }
    
    .desktop-icon img {
        width: 35px;
        height: 35px;
    }
    
    .desktop-icon span {
        font-size: 9px;
    }
    
    .window {
        height: calc(100vh - 80px) !important;
    }
    
    .window-header {
        height: 30px;
        font-size: 11px;
    }
    
    .taskbar {
        height: 30px;
    }
    
    .folder-content {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 10px;
    }
    
    .folder-item img {
        width: 35px;
        height: 35px;
    }
    
    /* Touch-freundliche Buttons */
    .window-controls button {
        width: 35px;
        height: 25px;
    }
    
    .close-btn {
        background-size: 16px;
    }
    
    /* Modal für kleine Bildschirme */
    .modal-content {
        width: 95%;
        max-width: 320px;
        margin: 0 10px;
    }
    
    .modal-header {
        padding: 6px 10px;
    }
    
    .modal-title {
        font-size: 12px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .modal-body p {
        font-size: 13px;
        margin-bottom: 12px;
    }
    
    .modal-body input {
        padding: 10px 8px;
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .modal-buttons button {
        padding: 8px 16px;
        font-size: 13px;
        min-width: 70px;
    }
}

/* Viewport Meta für bessere Mobile-Darstellung */
@media (hover: none) and (pointer: coarse) {
    /* Touch-Geräte */
    .desktop-icon:hover {
        background: none;
    }
    
    .desktop-icon:active {
        background: rgba(255, 255, 255, 0.2);
    }
    
    .folder-item:hover {
        background: none;
    }
    
    .folder-item:active {
        background: rgba(0, 120, 215, 0.3);
    }
    
    .taskbar-item:hover {
        background: none;
    }
    
    .taskbar-item:active {
        background: rgba(255, 255, 255, 0.2);
    }
}
