body {
    margin: 0;
    overflow: hidden;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    padding-top: 50px;
}

body.windows {
    background: url("../assets/fond.webp") no-repeat center center fixed;
    background-size: cover;
    cursor: default;
    font-family: "Segoe UI", sans-serif;
    overflow: hidden; 
}

.ram-bar-container {
    width: 100%;
    height: 30px;
    background-color: #ccc;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    border-bottom: 2px solid #000;
}

.ram-bar.windowsusage {
    transition: width 0.5s ease-in-out;
}

.ram-bar.linuxusage {
    transition: width 2s ease-in-out;
}

.ram-bar {
    height: 100%;
    width: 98%;
    background-color: red;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.ram-label {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px black;
}

@keyframes shake {
    0% {
        transform: translate(1px, 1px) rotate(0deg);
    }
    10% {
        transform: translate(-1px, -2px) rotate(-1deg);
    }
    20% {
        transform: translate(-3px, 0px) rotate(1deg);
    }
    30% {
        transform: translate(3px, 2px) rotate(0deg);
    }
    40% {
        transform: translate(1px, -1px) rotate(1deg);
    }
    50% {
        transform: translate(-1px, 2px) rotate(-1deg);
    }
    60% {
        transform: translate(-3px, 1px) rotate(0deg);
    }
    70% {
        transform: translate(3px, 1px) rotate(-1deg);
    }
    80% {
        transform: translate(-1px, -1px) rotate(1deg);
    }
    90% {
        transform: translate(1px, 2px) rotate(0deg);
    }
    100% {
        transform: translate(1px, -2px) rotate(-1deg);
    }
}

/* Linux Theme (Good) */
body.linux {
    background: url("../assets/fond_linux.jpg") no-repeat center center fixed;
    background-size: cover;
    color: #ecf0f1;
    font-family: "Ubuntu", sans-serif;
    transition: all 1s ease;
    padding-top: 30px; /* Space for top bar */
}

body.linux .ram-bar-container {
    top: 30px; /* Push down below top bar */
    background: rgba(52, 73, 94, 0.8) !important;
}

body.linux .ram-bar {
    width: 10%;
    background-color: #27ae60;
    animation: none;
}

/* Linux Top Bar */
.linux-top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: grid;
    grid-template-columns: 1fr auto 1fr; /* Left, Center (auto), Right */
    align-items: center;
    padding: 0 15px;
    box-sizing: border-box;
    z-index: 2000;
    font-size: 14px;
    font-weight: 500;
}

.linux-top-bar .left-menu {
    cursor: pointer;
    justify-self: start;
}

.linux-top-bar .clock {
    position: static; /* Remove absolute positioning */
    transform: none;
    justify-self: center;
    font-weight: bold;
}

.linux-top-bar .right-menu {
    display: flex;
    gap: 15px;
    justify-self: end;
}

/* Linux Bottom Dock/Taskbar */
.linux-taskbar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 20px; /* All corners rounded */
    padding: 15px;
    display: flex;
    gap: 10px;
    z-index: 1000;
    margin-bottom: 20px; /* Float */
}

.linux-taskbar-icon {
    width: 48px;
    height: 48px;
    transition: transform 0.2s;
    cursor: pointer;
}

.linux-taskbar-icon:hover {
    transform: scale(1.2) translateY(-5px);
}

.linux-taskbar-icon img {
    width: 100%;
    height: 100%;
}

.window {
    position: absolute;
    width: 800px;
    height: 600px;
    background: #fff;
    border: 1px solid #1883d7;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    resize: none; 
    overflow: visible; 
    min-width: 400px;
    min-height: 300px;
    animation: openWindow 0.2s ease-out;
}

body.linux .window {
    border: none;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    background-color: #2d2d2d; 
    overflow: hidden;
}

body.linux .window-header {
    background: #1e1e1e;
    color: #fff;
    padding: 12px 15px;
    border-bottom: 1px solid #333;
}

#text-editor-window {
    background: #1e1e1e;
    color: #fff;
    padding: 12px 15px;
    border-bottom: none;
}

body.linux .window-title {
    font-weight: 500;
    font-size: 14px;
}

body.linux .window-button {
    border-radius: 50%;
    width: 12px;
    height: 12px;
    margin-left: 8px;
    font-size: 0; 
    transition: transform 0.2s, opacity 0.2s;
}

body.linux .window-button.close {
    background-color: #ff5f56;
}

body.linux .window-button.maximize-btn {
    background-color: #27c93f;
}

body.linux .window-button:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

body.linux .window-button:active {
    transform: scale(0.95);
    filter: brightness(0.9);
}

body.linux .window-button::before {
    content: "";
}

.resizer {
    position: absolute;
    width: 10px;
    height: 10px;
    background: transparent;
    z-index: 101;
}

.resizer.top-left {
    top: -5px;
    left: -5px;
    cursor: nwse-resize;
}

.resizer.top-right {
    top: -5px;
    right: -5px;
    cursor: nesw-resize;
}

.resizer.bottom-left {
    bottom: -5px;
    left: -5px;
    cursor: nesw-resize;
}

.resizer.bottom-right {
    bottom: -5px;
    right: -5px;
    cursor: nwse-resize;
}

.resizer.top {
    top: -5px;
    left: 5px;
    right: 5px;
    width: auto;
    cursor: ns-resize;
}

.resizer.bottom {
    bottom: -5px;
    left: 5px;
    right: 5px;
    width: auto;
    cursor: ns-resize;
}

.resizer.left {
    left: -5px;
    top: 5px;
    bottom: 5px;
    height: auto;
    cursor: ew-resize;
}

.resizer.right {
    right: -5px;
    top: 5px;
    bottom: 5px;
    height: auto;
    cursor: ew-resize;
}

.window-header {
    background: #fff;
    color: #000;
    padding: 8px 12px;
    cursor: grab;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    user-select: none;
}

.window-title {
    font-weight: normal;
}

.window-controls {
    display: flex;
}

.window-button {
    width: 46px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    font-family: "Segoe MDL2 Assets", sans-serif;
    font-size: 10px;
}

.window-button:hover {
    background: #e5e5e5;
}

.window-button.close:hover {
    background: #e81123;
    color: white;
}

.window-content {
    flex-grow: 1;
    background: #fff;
    overflow: auto;
    position: relative;
    overflow: auto;
    scrollbar-width: none;
}

.window-content::-webkit-scrollbar {
    display: none;
}

.window-content iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.taskbar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50px;
    background: rgba(16, 16, 16, 0.95);
    display: flex;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.start-button {
    width: 48px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

.start-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.search-bar {
    width: 300px;
    height: 100%;
    background: #fff;
    display: flex;
    align-items: center;
    padding: 0 10px;
    color: #666;
    font-size: 13px;
    margin-right: 10px;
}

.search-bar i {
    margin-right: 10px;
}

.taskbar-icon {
    width: 48px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.taskbar-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

.taskbar-icon.active {
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 2px solid #76b9ed;
}

.taskbar-icon img {
    width: 24px;
    height: 24px;
}

.taskbar-right {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    padding-right: 10px;
    padding-left: 10px;
    color: #fff;
    font-size: 14px;
    height: 100%;
    cursor: default;
}

.taskbar-right:hover {
    background: rgba(255, 255, 255, 0.1);
}

@keyframes openWindow {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.containerAllApps {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 10px;
    height: calc(100vh - 120px);
    flex-wrap: wrap;
    align-content: flex-start;
}

.desktop-icon {
    width: 96px;
    text-align: center;
    margin: 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    text-shadow: 1px 1px 2px black;
    vertical-align: top;
}

.desktop-icon div {
    margin-top: 5px;
    font-size: 14px;
    line-height: 1.2;
    word-wrap: break-word;
    width: 100%;
}

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

#terminal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black;
    color: #0f0;
    font-family: monospace;
    padding: 20px;
    z-index: 9999;
}

.desktop-icon.locked {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: auto;
    position: relative;
}

.desktop-icon.unlocked {
    opacity: 1;
    cursor: pointer;
    position: relative;
}

.desktop-icon.unlocked .icone {
    background-image: url("../assets/unlocked.png");
}
.desktop-icon.locked .icone {
    background-image: url("../assets/locked.png");
}

.icone {
    width: 30px;
    height: 30px;
    position: absolute;
    bottom: 20px;
    right: -5px;
    z-index: 10;
    background-size: cover;
}
