/* Core resets */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

/* --- Theme Variations --- */
body.bg-dark {
  background: #1e1e2e;
  color: #cdd6f4;
}

body.bg-sunset {
  background: linear-gradient(135deg, #2b1055, #7597de);
  color: #ffffff;
}

body.bg-cyber {
  background: #050505;
  color: #00ff66;
  font-family: 'Courier New', Courier, monospace;
}

/* --- Panel / Topbar --- */
#panel {
  height: 38px;
  background: rgba(15, 15, 23, 0.75);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 9999;
  position: relative;
}

.panel-left, .panel-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.os-logo {
  font-weight: 700;
  font-size: 0.95rem;
  margin-right: 8px;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: inherit;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s ease;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

#clock-widget {
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.9;
}

/* --- Desktop & Icons --- */
#desktop {
  position: relative;
  width: 100%;
  height: calc(100vh - 38px);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: flex-start;
}

.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 70px;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  user-select: none;
}

.desktop-icon:hover {
  background: rgba(255, 255, 255, 0.15);
}

.icon-img {
  font-size: 2rem;
}

.desktop-icon span {
  font-size: 0.75rem;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* --- Window Styling --- */
.window {
  position: absolute;
  width: 320px;
  min-height: 210px;
  background: #181825;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Default position setup */
#about-app { top: 60px; left: 120px; }
#notes-app { top: 120px; left: 470px; }
#theme-app { top: 220px; left: 220px; }

.window-header {
  background: #11111b;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: grab;
  user-select: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.window-header:active {
  cursor: grabbing;
}

.title {
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.85;
}

.close-btn {
  background: #f38ba8;
  color: #11111b;
  border: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  background: #ff5555;
}

.window-body {
  padding: 16px;
  flex: 1;
}

textarea {
  width: 100%;
  height: 120px;
  background: #11111b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: inherit;
  padding: 10px;
  border-radius: 6px;
  resize: none;
  outline: none;
  font-family: inherit;
}

.section-label {
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.theme-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.theme-choice {
  background: #232334;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: inherit;
  padding: 8px 12px;
  border-radius: 6px;
  text-align: left;
  cursor: pointer;
  font-size: 0.85rem;
  transition: transform 0.1s ease;
}

.theme-choice:hover {
  background: #313244;
  transform: translateX(3px);
}

/* --- Special Cyber / Matrix Adjustments --- */
body.bg-cyber .window {
  background: #0a0a0a;
  border: 1px solid #00ff66;
  box-shadow: 0 0 15px rgba(0, 255, 102, 0.25);
}

body.bg-cyber .window-header {
  background: #002200;
  border-bottom: 1px solid #00ff66;
}

body.bg-cyber textarea {
  background: #000;
  border: 1px solid #00ff66;
  color: #00ff66;
}

body.bg-cyber .theme-choice {
  background: #001100;
  border: 1px solid #00ff66;
  color: #00ff66;
}