/* --- BASIS & RESET --- */
body { margin: 0; padding: 0; width: 100vw; height: 100vh; overflow: hidden; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif; user-select: none; background-color: #333; }
.wallpaper-iframe { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; border: none; z-index: -1; pointer-events: none; filter: brightness(0.9); }

/* --- TOP BAR --- */
.top-bar-container { position: absolute; top: 0; left: 0; width: 100%; height: 36px; z-index: 2000; }
.glass-nav { height: 100%; }
.top-bar-content { display: flex; justify-content: space-between; align-items: center; padding: 0 20px; box-sizing: border-box; height: 100%; font-size: 13px; font-weight: 600; color: white; text-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.right { display: flex; align-items: center; height: 100%; }
.menu-item { margin: 0 8px; cursor: default; padding: 4px 8px; border-radius: 6px; }
.bold { font-weight: 700; }

/* --- WIDGETS --- */
.widget-sidebar { position: absolute; top: 56px; right: 20px; width: 220px; display: flex; flex-direction: column; gap: 20px; z-index: 1; transition: transform 0.3s ease; }
.widget-content { padding: 20px; text-align: center; color: white; text-shadow: 0 1px 2px rgba(0,0,0,0.8); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; font-size: 12px; margin-top: 10px; }
.calendar-day-head { font-weight: bold; color: white; }
.calendar-day { padding: 5px 0; border-radius: 6px; color: white; }
.today { background: #FF3B30; color: white; font-weight: bold; }

/* --- DESKTOP --- */
.desktop-container { position: absolute; top: 56px; left: 20px; bottom: 120px; display: flex; flex-direction: column; flex-wrap: wrap; align-content: flex-start; gap: 20px; z-index: 1; transition: opacity 0.3s; }
.desktop-item-pure { text-decoration: none; display: flex; flex-direction: column; align-items: center; width: 80px; }
.desktop-item-pure img { width: 48px; height: 48px; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); }
.icon-label { margin-top: 6px; color: white; font-size: 11px; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.9); text-align: center; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- DOCK --- */
.dock-container { position: absolute; bottom: 20px; left: 0; width: 100%; display: flex; justify-content: center; z-index: 100; pointer-events: none; }
.dock-wrapper { pointer-events: auto; display: flex; padding: 10px; border-radius: 24px; }
.dock-content { display: flex; gap: 12px; align-items: flex-end; }
.dock-item-link { text-decoration: none; position: relative; }
.dock-item-link .glass-icon { width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.dock-item-link::after { content: attr(data-title); position: absolute; top: -45px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.8); color: white; padding: 4px 8px; border-radius: 4px; font-size: 11px; opacity: 0; pointer-events: none; transition: 0.2s; white-space: nowrap; }
.dock-item-link:hover::after { opacity: 1; top: -55px; }

/* --- SETTINGS SIDEBAR --- */
.settings-sidebar {
    position: fixed !important;
    top: 0; right: -450px; width: 350px; height: 100vh;
    z-index: 5000; transition: right 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    border-left: 1px solid rgba(255,255,255,0.2);
    background: rgba(0,0,0,0.1); backdrop-filter: blur(20px);
}
.settings-sidebar.open { right: 0; }
.setting-inner { display: flex; flex-direction: column; align-items: center; justify-content: center; color: white; text-shadow: 0 1px 2px rgba(0,0,0,0.8); }
.setting-inner i { font-size: 24px; margin-bottom: 5px; }
.setting-inner span { font-size: 12px; font-weight: 600; }

/* --- MODI --- */
body.zen-mode .desktop-container { opacity: 0; pointer-events: none; }
body.no-widgets .widget-sidebar { transform: translateX(300px); }
body.performance-mode .glass-filter { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
body.performance-mode .settings-sidebar { background: rgba(0,0,0,0.8); }

/* --- WINDOWS --- */
.app-window { position: absolute !important; display: flex; flex-direction: column; z-index: 10; width: 500px; height: 400px; }
.window-inner { display: flex; flex-direction: column; height: 100%; width: 100%; }
.window-header { height: 36px; display: flex; align-items: center; padding: 0 14px; cursor: move; border-bottom: 1px solid rgba(255,255,255,0.1); }
.traffic-lights { display: flex; gap: 8px; margin-right: 15px; }
.traffic-lights span { width: 12px; height: 12px; border-radius: 50%; cursor: pointer; border: 1px solid rgba(0,0,0,0.1); }
.red { background: #FF5F56; } .yellow { background: #FFBD2E; } .green { background: #27C93F; }
.window-title { flex: 1; text-align: center; font-size: 13px; font-weight: 600; opacity: 0.9; pointer-events: none; color: white; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }
.app-content { padding: 20px; flex: 1; overflow: auto; position: relative; color: white; }

/* Modal & Apps */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.2); z-index: 2000; display: none; justify-content: center; align-items: center; backdrop-filter: blur(3px); }
.calc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; height: 100%; }
.calc-display { grid-column: span 4; background: rgba(0,0,0,0.3); border-radius: 8px; font-size: 32px; padding: 10px; text-align: right; margin-bottom: 10px; color: white; text-shadow: 0 1px 2px black;}
.calc-btn { border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.1); color: white; border-radius: 50%; font-size: 18px; cursor: pointer; }
.calc-btn:hover { background: rgba(255,255,255,0.3); }
.calc-btn.orange { background: #FF9F0A; border: none; }
.note-area { width: 100%; height: 100%; border: none; background: transparent; resize: none; outline: none; font-family: monospace; font-size: 14px; color: white; text-shadow: 0 1px 2px black; }
.note-area::placeholder { color: rgba(255,255,255,0.6); }
input[type="text"], input[type="password"] { background: rgba(255,255,255,0.9); border: none; color: black; }

/* PLANET DEFENSE GAME */
#planetCanvas {
    background: url('https://marclopezavila.github.io/planet-defense-game/img/space.jpg') no-repeat center center;
    background-size: cover;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    display: block;
    border-radius: 0 0 12px 12px;
}
#planetCanvas.playing {
    cursor: url('https://marclopezavila.github.io/planet-defense-game/img/aim_red.png') 17.5 17.5, auto !important;
}