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

/* ── THEME VARIABLES ─────────────────────────────────── */
:root {
  --accent:         #f472b6;
  --accent-rgb:     244, 114, 182;
  --accent-light:   #f9a8d4;
  --accent-lighter: #f9d0e8;
  --bg-rgb:         5,  5,  16;
  --panel-rgb:      7,  6,  18;
  --statusbar-rgb:  10, 8,  20;
  --titlebar-rgb:   18, 10, 28;
}

body {
  font-family: 'Courier New', monospace;
  background: rgb(var(--bg-rgb));
  color: #e0e0e0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── WALLPAPER LAYER ─────────────────────────────────── */
.wallpaper {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.04);
  filter: blur(2px) saturate(1.05);
}

canvas#stars {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1;
}

/* ── STATUS BAR ─────────────────────────────────────── */
#statusbar {
  position: relative;
  z-index: 100;
  height: 28px;
  background: rgba(var(--statusbar-rgb), 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.18);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 12px;
  color: #aaa;
  user-select: none;
}

#statusbar .left  { display: flex; align-items: center; gap: 18px; min-width: 0; overflow: hidden; }
#statusbar .right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }

.sb-logo { color: var(--accent); font-weight: 700; font-size: 13px; letter-spacing: 1px; white-space: nowrap; flex-shrink: 0; }
.sb-menu { cursor: default; transition: color .15s; }
.sb-menu:hover { color: var(--accent); }

.sb-icon { font-size: 13px; opacity: 0.75; }
#clock { font-size: 12px; color: #ccc; min-width: 160px; text-align: right; }

#sb-taskbar {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
}
.sb-task-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  height: 20px;
  border-radius: 4px;
  font-size: 11px;
  font-family: 'Courier New', monospace;
  color: #ccc;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s;
  white-space: nowrap;
}
.sb-task-btn:hover {
  background: rgba(255,255,255,0.07);
}
.sb-task-btn.focused {
  border-color: rgba(var(--accent-rgb), 0.45);
  color: var(--accent-light);
}
.sb-task-btn.dimmed {
  opacity: 0.35;
}

@media (max-width: 480px) {
  #clock { min-width: 0; }
}

/* ── DESKTOP ─────────────────────────────────────────── */
#desktop {
  flex: 1;
  position: relative;
  z-index: 10;
}

/* ── TERMINAL WINDOW ─────────────────────────────────── */
#terminal {
  position: absolute;
  width: 700px;
  height: 500px;
  display: flex;
  flex-direction: column;
  background: rgba(var(--panel-rgb), 0.93);
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: 11px;
  box-shadow:
    0 0 0 1px rgba(var(--accent-rgb), 0.06),
    0 0 45px rgba(var(--accent-rgb), 0.12),
    0 24px 64px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
  transition: box-shadow .3s, opacity .2s, transform .2s;
}
#terminal.hidden {
  opacity: 0;
  transform: scale(0.95) translateY(8px);
  pointer-events: none;
}
.maximized {
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 0 !important;
  resize: none;
}
#terminal:hover {
  box-shadow:
    0 0 0 1px rgba(var(--accent-rgb), 0.1),
    0 0 60px rgba(var(--accent-rgb), 0.18),
    0 24px 64px rgba(0, 0, 0, 0.7);
}

/* Title bar */
#titlebar {
  height: 36px;
  background: rgba(var(--titlebar-rgb), 0.98);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.12);
  cursor: grab;
  user-select: none;
}
#titlebar:active { cursor: grabbing; }
.dot { width: 12px; height: 12px; border-radius: 50%; cursor: pointer; transition: filter .2s; }
.dot:hover { filter: brightness(1.3); }
.dot.red    { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green  { background: #28c840; }
#titlebar-label {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: rgba(var(--accent-rgb), 0.55);
  margin-right: 40px;
}

/* Terminal output */
#terminal-body {
  padding: 16px 18px;
  flex: 1;
  min-height: 120px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.65;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--accent-rgb), 0.25) transparent;
}
#terminal-body::-webkit-scrollbar { width: 4px; }
#terminal-body::-webkit-scrollbar-thumb { background: rgba(var(--accent-rgb), 0.25); border-radius: 2px; }

/* Typography */
.prompt  { color: var(--accent); }
.cmd-txt { color: var(--accent-lighter); }
.output  { color: #9090a8; }
.accent  { color: var(--accent); }
.muted   { color: #444; }
.good    { color: #4ade80; }
.bad     { color: #f87171; }
.tlink   { color: var(--accent-light); text-decoration: underline; cursor: pointer; }
.tlink:hover { color: #fff; }

.section-head { color: var(--accent); margin-bottom: 10px; }
.proj { margin-bottom: 12px; }
.proj-name { color: var(--accent-light); }
.stag { color: var(--accent); margin-right: 8px; }

/* Input line */
#input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px 14px;
  border-top: 1px solid rgba(var(--accent-rgb), 0.1);
}
#input-prompt { color: var(--accent); font-size: 13px; white-space: nowrap; flex-shrink: 0; }
#cmd-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #e8e8f0;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  caret-color: var(--accent);
}

/* Subtle nebula glow in background */
body::before {
  content: '';
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 300px;
  background: radial-gradient(ellipse, rgba(var(--accent-rgb), 0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 2;
}

/* ── FILE EXPLORER WINDOW ────────────────────────────── */
.fe-win {
  position: absolute;
  width: 560px;
  display: flex;
  flex-direction: column;
  background: rgba(var(--panel-rgb), 0.93);
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: 11px;
  box-shadow:
    0 0 0 1px rgba(var(--accent-rgb), 0.06),
    0 0 45px rgba(var(--accent-rgb), 0.12),
    0 24px 64px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
  transition: box-shadow .3s;
  font-family: 'Courier New', monospace;
}
.fe-win:hover {
  box-shadow:
    0 0 0 1px rgba(var(--accent-rgb), 0.1),
    0 0 60px rgba(var(--accent-rgb), 0.18),
    0 24px 64px rgba(0, 0, 0, 0.7);
}
.fe-titlebar {
  height: 36px;
  background: rgba(var(--titlebar-rgb), 0.98);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.12);
  cursor: grab;
  user-select: none;
}
.fe-titlebar:active { cursor: grabbing; }
.fe-title {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: rgba(var(--accent-rgb), 0.55);
  margin-right: 40px;
}
.fe-body {
  display: flex;
  flex: 1;
  min-height: 100px;
}
.fe-sidebar {
  width: 130px;
  border-right: 1px solid rgba(var(--accent-rgb), 0.1);
  padding: 10px 0;
  font-size: 12px;
  flex-shrink: 0;
}
.fe-sb-item {
  padding: 7px 14px;
  color: #666;
  cursor: default;
  transition: color .15s, background .15s;
}
.fe-sb-item:hover { color: #aaa; background: rgba(var(--accent-rgb), 0.04); }
.fe-sb-item.active { color: var(--accent); background: rgba(var(--accent-rgb), 0.08); }
.fe-grid {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--accent-rgb), 0.25) transparent;
}
.fe-grid::-webkit-scrollbar { width: 4px; }
.fe-grid::-webkit-scrollbar-thumb { background: rgba(var(--accent-rgb), 0.25); border-radius: 2px; }
.fe-item {
  width: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 4px;
  border-radius: 6px;
  cursor: default;
  transition: background .15s;
  font-size: 26px;
}
.fe-item:hover { background: rgba(var(--accent-rgb), 0.08); }
.fe-item span {
  font-size: 10px;
  color: #666;
  text-align: center;
  word-break: break-all;
  line-height: 1.3;
}
.fe-item:hover span { color: var(--accent-light); }

/* ── TEXT VIEWER WINDOW ──────────────────────────────── */
.tv-body {
  flex: 1;
  padding: 16px 18px;
  min-height: 200px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.65;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--accent-rgb), 0.25) transparent;
}
.tv-body::-webkit-scrollbar { width: 4px; }
.tv-body::-webkit-scrollbar-thumb { background: rgba(var(--accent-rgb), 0.25); border-radius: 2px; }
.tv-content {
  color: #9090a8;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'Courier New', monospace;
}

/* ── MEDIA PLAYER WINDOW ─────────────────────────────── */
.media-body {
  flex: 1;
  display: flex;
  background: #000;
  min-height: 200px;
}
.media-body iframe {
  width: 100%; height: 100%; border: none;
}

/* ── PHOTO VIEWER WINDOW ─────────────────────────────── */
.photo-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  padding: 12px;
  min-height: 200px;
}
.photo-body img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

/* ── RESIZE HANDLE ───────────────────────────────────── */
.resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
  z-index: 10;
}
.resize-handle::before,
.resize-handle::after {
  content: '';
  position: absolute;
  background: rgba(var(--accent-rgb), 0.35);
  border-radius: 1px;
  transition: background .15s;
}
.resize-handle::before {
  right: 3px; bottom: 7px;
  width: 10px; height: 1.5px;
  transform: rotate(45deg);
  transform-origin: right center;
}
.resize-handle::after {
  right: 3px; bottom: 3px;
  width: 6px; height: 1.5px;
  transform: rotate(45deg);
  transform-origin: right center;
}
.resize-handle:hover::before,
.resize-handle:hover::after { background: rgba(var(--accent-rgb), 0.9); }
