/* ==========================================================================
   WINDOWS XP LUNA BLUE DESIGN SYSTEM - JAI SHARMA EDITION
   ========================================================================== */

:root {
  /* Classic XP Colors */
  --xp-blue-primary: #0058ee;
  --xp-blue-light: #288eff;
  --xp-blue-dark: #0036a6;
  
  --xp-taskbar-height: 40px; /* Taller taskbar as requested */
  --xp-taskbar-bg: linear-gradient(to bottom, #1f6be2 0%, #2062d4 12%, #1852c0 49%, #0c3eab 50%, #154cbd 85%, #1857d4 100%);
  --xp-start-btn-bg: linear-gradient(to bottom, #388638 0%, #46a046 20%, #358735 50%, #246e24 100%);
  --xp-start-btn-hover: linear-gradient(to bottom, #44a544 0%, #52bf52 20%, #40a040 50%, #2d822d 100%);
  
  --xp-window-bg: #ece9d8;
  --xp-window-border: #0055ea;
  --xp-inset-border: #7f9db9;
  --xp-text-color: #000000;
  
  --xp-font: 'Tahoma', 'Segoe UI', 'Inter', -apple-system, sans-serif;
  --xp-mono: 'Fira Code', 'Courier New', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

body, html {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  font-family: var(--xp-font);
  font-size: 12px;
  color: var(--xp-text-color);
  background-color: #000;
}

/* ==========================================================================
   1. XP BOOT / LOADING SCREEN
   ========================================================================== */
.boot-screen {
  position: fixed;
  inset: 0;
  background-color: #000000;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  transition: opacity 0.6s ease-out;
}

.boot-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.boot-logo {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 25px;
}

.xp-flag {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  width: 52px;
  height: 52px;
  transform: skewY(-5deg);
}

.xp-flag span {
  border-radius: 2px;
}

.flag-red { background: #f25022; }
.flag-green { background: #7fba00; }
.flag-blue { background: #00a4ef; }
.flag-yellow { background: #ffb900; }

.logo-text {
  display: flex;
  flex-direction: column;
}

.ms-text {
  font-size: 15px;
  color: #aaaaaa;
  letter-spacing: 1px;
  font-weight: 500;
}

.xp-text {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1;
  font-family: 'Space Grotesk', var(--xp-font);
}

.xp-edition {
  color: #f25022;
  font-size: 30px;
  margin-left: 6px;
  font-style: italic;
}

.boot-edition {
  font-size: 14px;
  color: #6C8CFF;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 35px;
  font-weight: 600;
}

.boot-loader {
  width: 200px;
  height: 18px;
  border: 2px solid #555555;
  border-radius: 3px;
  padding: 2px;
  overflow: hidden;
  background: #111;
  position: relative;
}

.loader-bar {
  display: flex;
  gap: 3px;
  width: 50px;
  height: 100%;
  position: absolute;
  animation: xpLoader 2.2s infinite ease-in-out;
}

.loader-block {
  flex: 1;
  background: linear-gradient(to bottom, #2ee02e, #148014);
  border-radius: 1px;
  box-shadow: 0 0 5px #2ee02e;
}

@keyframes xpLoader {
  0% { left: -50px; }
  100% { left: 210px; }
}

.boot-start-btn {
  margin-top: 40px;
  background: linear-gradient(to bottom, #2b7af0, #0d51be);
  color: white;
  border: 2px solid #5fa2ff;
  border-radius: 4px;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 88, 238, 0.6);
  transition: all 0.2s;
}

.boot-start-btn:hover {
  transform: scale(1.05);
  background: linear-gradient(to bottom, #3b8aff, #1d61ce);
}

/* ==========================================================================
   2. DESKTOP & WALLPAPER
   ========================================================================== */
.xp-desktop {
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;

  /* --------------------------------------------------------------------
     WINDOWS XP "BLISS" WALLPAPER
     --------------------------------------------------------------------
     Layer 1 is the real photo. Drop a file at  assets/bliss.jpg  and it is
     used automatically. If that file is absent the browser simply skips the
     layer and the hand-built CSS recreation underneath shows through, so the
     desktop always looks right.
     -------------------------------------------------------------------- */
  background-color: #3f7fd0;
  background-image:
    /* 1. the real Bliss photo (optional) */
    url('../assets/bliss.jpg'),

    /* 2. the rolling green hill — hard edge at the horizon, no feathering */
    radial-gradient(ellipse 124% 80% at 40% 128%,
      #9ed64a 0%, #7cbf38 22%, #5aa227 46%, #3d7d1b 68%, #2a5e12 80%, #24520f 86%, rgba(36, 82, 15, 0) 86.5%),

    /* 3. cloud bank — solid cores with a short falloff so they read as
          defined clouds rather than a blurred wash */
    radial-gradient(ellipse 22% 8%  at 74% 19%, rgba(255,255,255,1) 0%, rgba(255,255,255,.98) 38%, rgba(255,255,255,0) 62%),
    radial-gradient(ellipse 15% 6%  at 61% 13%, rgba(255,255,255,1) 0%, rgba(255,255,255,.95) 40%, rgba(255,255,255,0) 64%),
    radial-gradient(ellipse 24% 5%  at 23% 25%, rgba(255,255,255,.98) 0%, rgba(255,255,255,.9) 36%, rgba(255,255,255,0) 60%),
    radial-gradient(ellipse 12% 4%  at 43% 33%, rgba(255,255,255,.92) 0%, rgba(255,255,255,.82) 38%, rgba(255,255,255,0) 62%),
    radial-gradient(ellipse 27% 5%  at 88% 38%, rgba(255,255,255,.85) 0%, rgba(255,255,255,.72) 36%, rgba(255,255,255,0) 60%),

    /* 4. the sky */
    linear-gradient(to bottom,
      #1d55b5 0%, #2f72cc 18%, #4c94e0 36%, #7cb8ee 54%, #aed4f5 68%, #d5e9f9 78%, #e8f2fb 100%);

  background-size: cover, cover, cover, cover, cover, cover, cover, cover;
  background-position: center center;
  background-repeat: no-repeat;
}

/* Interactive grass canvas — above the wallpaper, below icons & windows */
.grass-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.desktop-icons-grid {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 16px;
  padding: 16px;
  height: calc(100vh - var(--xp-taskbar-height) - 10px);
  width: max-content;
  position: relative;
  z-index: 10;
}

/* Right-anchored desktop icons (Contact, CLI) for a clean split layout */
.desktop-icons-right {
  position: absolute;
  top: 0;
  right: 0;
  left: auto;
  align-content: flex-start;
  align-items: center;
}

.desktop-icon {
  width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.1s;
}

.desktop-icon:hover {
  background: rgba(255, 255, 255, 0.25);
  outline: 1px dotted rgba(255, 255, 255, 0.8);
}

.desktop-icon.selected {
  background: rgba(11, 93, 209, 0.6);
  outline: 1px dotted #ffffff;
}

.icon-img-wrapper {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  margin-bottom: 5px;
  filter: drop-shadow(2px 3px 4px rgba(0,0,0,0.6));
}

.icon-label {
  color: #ffffff;
  font-size: 11px;
  font-weight: 500;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.9), 0 0 4px rgba(0, 0, 0, 0.8);
  line-height: 1.25;
  word-break: break-word;
  padding: 2px 4px;
  border-radius: 2px;
}

.windows-container {
  position: absolute;
  inset: 0 0 var(--xp-taskbar-height) 0;
  pointer-events: none;
  z-index: 20;
}

.window-frame {
  pointer-events: auto;
}

/* ==========================================================================
   3. WINDOW FRAME STYLING
   ========================================================================== */
.window-frame {
  position: absolute;
  background-color: var(--xp-window-bg);
  border: 3px solid var(--xp-window-border);
  border-radius: 8px 8px 3px 3px;
  box-shadow: 4px 6px 24px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 340px;
  min-height: 220px;
  transition: transform 0.05s ease-out;
}

.window-frame.active {
  border-color: #0055ea;
}

.window-frame.inactive {
  border-color: #7f9db9;
  box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.3);
}

.window-titlebar {
  height: 32px;
  background: linear-gradient(to bottom, #0058ee 0%, #3593ff 4%, #288eff 18%, #0058ee 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 0 10px;
  cursor: move;
  border-bottom: 1px solid #00227b;
}

.window-frame.inactive .window-titlebar {
  background: linear-gradient(to bottom, #7697ca 0%, #95b3de 18%, #7697ca 100%);
}

.titlebar-text {
  color: #ffffff;
  font-weight: bold;
  font-size: 13px;
  text-shadow: 1px 1px 1px #001659;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.titlebar-icon {
  font-size: 14px;
}

.window-controls {
  display: flex;
  gap: 4px;
}

.win-btn {
  width: 22px;
  height: 22px;
  border-radius: 3px;
  border: 1px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  color: white;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
}

.win-btn.minimize {
  background: linear-gradient(to bottom, #2b7af0, #0a4ab8);
}
.win-btn.maximize {
  background: linear-gradient(to bottom, #2b7af0, #0a4ab8);
}
.win-btn.close {
  background: linear-gradient(to bottom, #e1654c, #c01e00);
}

.win-btn:hover {
  filter: brightness(1.25);
}

.window-menubar {
  height: 25px;
  background: #ece9d8;
  border-bottom: 1px solid #d0ccb8;
  display: flex;
  align-items: center;
  padding: 0 6px;
  gap: 14px;
  font-size: 11px;
}

.menu-item {
  cursor: pointer;
  padding: 2px 6px;
}

.menu-item:hover {
  background: #316ac5;
  color: white;
}

.window-body {
  flex: 1;
  overflow: auto;
  padding: 14px;
  background: #ffffff;
  border: 1px solid var(--xp-inset-border);
  margin: 3px;
  border-radius: 2px;
  position: relative;
}

.window-statusbar {
  height: 24px;
  background: #ece9d8;
  border-top: 1px solid #d0ccb8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  font-size: 11px;
  color: #444;
}

.resize-handle {
  width: 16px;
  height: 16px;
  position: absolute;
  right: 0;
  bottom: 0;
  cursor: se-resize;
  background: linear-gradient(135deg, transparent 50%, #7f9db9 50%);
}

/* ==========================================================================
   4. XP TASKBAR & START MENU (TALLER 40px TASKBAR)
   ========================================================================== */
.xp-taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--xp-taskbar-height);
  background: var(--xp-taskbar-bg);
  z-index: 99999;
  display: flex;
  align-items: center;
  border-top: 1px solid #3c8dff;
  box-shadow: 0 -2px 6px rgba(0,0,0,0.5);
}

.start-button {
  height: var(--xp-taskbar-height);
  padding: 0 20px 0 12px;
  background: var(--xp-start-btn-bg);
  border: none;
  border-radius: 0 12px 12px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 2px 0 6px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.4);
  transition: background 0.1s;
}

.start-button:hover {
  background: var(--xp-start-btn-hover);
}

.start-flag {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  width: 18px;
  height: 18px;
  transform: skewY(-5deg);
}

.start-flag span { border-radius: 1px; }

.start-text {
  color: #ffffff;
  font-weight: 900;
  font-style: italic;
  font-size: 17px;
  text-shadow: 1px 1px 2px #0a400a;
}

.taskbar-apps {
  flex: 1;
  display: flex;
  gap: 6px;
  padding: 0 10px;
  overflow-x: auto;
}

.taskbar-tab {
  height: 30px;
  min-width: 150px;
  max-width: 220px;
  background: linear-gradient(to bottom, #3c8df5, #1d61c6);
  border: 1px solid #0d3b8c;
  border-radius: 4px;
  color: white;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3);
}

.taskbar-tab.active {
  background: linear-gradient(to bottom, #1e52b7, #133a87);
  box-shadow: inset 1px 1px 3px rgba(0,0,0,0.6);
  border-color: #051b47;
}

.taskbar-tab .tab-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.system-tray {
  height: var(--xp-taskbar-height);
  background: linear-gradient(to bottom, #0f8eed, #0a62ab);
  border-left: 1px solid #084880;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 10px;
  color: white;
  box-shadow: inset 1px 0 2px rgba(0,0,0,0.3);
}

.tray-btn {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 13px;
  padding: 3px 6px;
  border-radius: 3px;
}

.tray-btn:hover {
  background: rgba(255,255,255,0.2);
}

.contact-quick-btn {
  background: linear-gradient(to bottom, #3c8df5, #1d61c6);
  border: 1px solid #0d3b8c;
  font-weight: bold;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
}

.contact-quick-btn:hover {
  filter: brightness(1.12);
}

.tray-clock {
  font-size: 12px;
  font-weight: bold;
  padding-left: 6px;
}

/* START MENU PANEL */
.start-menu {
  position: fixed;
  bottom: var(--xp-taskbar-height);
  left: 0;
  width: 400px;
  background: #ffffff;
  border: 2px solid #0058ee;
  border-radius: 8px 8px 0 0;
  box-shadow: 4px 4px 24px rgba(0,0,0,0.6);
  z-index: 99998;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.start-menu.hidden {
  display: none;
}

.start-menu-header {
  height: 58px;
  background: linear-gradient(to bottom, #0058ee 0%, #3593ff 12%, #0046cd 100%);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  color: white;
  border-bottom: 2px solid #ff8c00;
}

.user-avatar {
  width: 42px;
  height: 42px;
  background: #ffffff;
  border: 2px solid #ffffff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.user-name-info {
  display: flex;
  flex-direction: column;
}

.user-display-name {
  font-weight: bold;
  font-size: 15px;
  text-shadow: 1px 1px 1px #001659;
}

.user-sub-title {
  font-size: 11px;
  color: #cce0ff;
}

.start-menu-body {
  display: flex;
  /* Grows with the number of pinned items instead of clipping them, but never
     taller than the screen. Add entries in main.js without touching this. */
  height: auto;
  min-height: 360px;
  max-height: calc(100vh - var(--xp-taskbar-height) - 110px);
}

.start-left-panel {
  flex: 1.2;
  background: #ffffff;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-right: 1px solid #b5b5b5;
  overflow-y: auto;
}

.start-right-panel {
  flex: 1;
  background: #d3e5fa;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-left: 1px solid #ffffff;
  overflow-y: auto;
}

.start-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 4px;
  cursor: pointer;
  color: #000;
  font-size: 11px;
}

.start-item:hover {
  background: #316ac5;
  color: white;
}

.start-item:hover .item-icon {
  color: white !important;
}

.start-item.bold span {
  font-weight: bold;
}

.item-icon {
  font-size: 18px;
  width: 22px;
  text-align: center;
}

.item-icon.blue { color: #0058ee; }
.item-icon.yellow { color: #e6a100; }
.item-icon.orange { color: #ff6600; }
.item-icon.purple { color: #8a2be2; }
.item-icon.green { color: #2e8b57; }
.item-icon.dark { color: #333333; }
.item-icon.gold { color: #d4af37; }

.start-divider {
  height: 1px;
  background: #a0a0a0;
  margin: 4px 0;
}

.highlight-item {
  background: #ffe6a3;
  border: 1px solid #ffa500;
  font-weight: bold;
}

.start-menu-footer {
  height: 42px;
  background: linear-gradient(to bottom, #0058ee, #0036a6);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 0 14px;
}

.footer-btn {
  background: linear-gradient(to bottom, #3c8df5, #1d61c6);
  border: 1px solid #0d3b8c;
  color: white;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-btn.shutdown-btn {
  background: linear-gradient(to bottom, #e1654c, #c01e00);
  border-color: #7e1200;
}

.footer-btn:hover {
  filter: brightness(1.15);
}

/* SHUTDOWN SCREEN */
.shutdown-screen {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: grayscale(1);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.shutdown-screen.hidden { display: none; }

.shutdown-box {
  background: #004080;
  border: 3px solid #0066cc;
  padding: 30px 40px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}

.shutdown-box h2 {
  margin-bottom: 10px;
}

.shutdown-box p {
  color: #cce0ff;
  margin-bottom: 20px;
}

/* GENERAL XP UI COMPONENTS */
.xp-btn {
  background: linear-gradient(to bottom, #ffffff 0%, #ece9d8 100%);
  border: 1px solid #003c74;
  border-radius: 3px;
  padding: 5px 16px;
  font-family: var(--xp-font);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: inset -1px -1px 1px #808080, inset 1px 1px 1px #ffffff;
}

.xp-btn:hover {
  border-color: #e59700;
  box-shadow: 0 0 4px #ffc73c;
}

.xp-btn.primary {
  background: linear-gradient(to bottom, #2b7af0, #0a4ab8);
  color: white;
  border-color: #00227b;
}

/* ==========================================================================
   DESKTOP WIDGETS (modern glass — clock + notifications)
   ========================================================================== */
.desktop-widgets {
  position: absolute;
  top: 236px;
  right: 26px;
  width: 320px;
  max-height: calc(100vh - 236px - 56px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 6;
  pointer-events: none;            /* only the cards are interactive */
}

.widget {
  pointer-events: auto;
  background: rgba(10, 26, 56, 0.55);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.38);
  color: #fff;
  padding: 18px 20px;
}

/* Clock widget */
.wclock-row { display: flex; align-items: baseline; gap: 8px; }

.wclock-time {
  font-size: 54px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -1px;
  font-family: 'Space Grotesk', sans-serif;
}

.wclock-ampm { font-size: 18px; font-weight: 600; color: #b7ccff; }

.wclock-date { font-size: 14px; color: #e6eeff; margin-top: 6px; font-weight: 500; }

.wclock-loc {
  font-size: 11.5px;
  color: #9fb6e6;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Notifications widget */
.widget-notif { padding-bottom: 10px; }

.wnotif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #eaf1ff;
}

.wnotif-head i { margin-right: 6px; color: #ffd166; }

.wnotif-count {
  background: #ff5a5f;
  color: #fff;
  font-size: 11px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.wnotif-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
}

.wnotif-item {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 8px;
  border-radius: 11px;
  cursor: pointer;
  transition: background 0.12s;
}

.wnotif-item:hover { background: rgba(255, 255, 255, 0.12); }

.wnotif-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
}

.wnotif-body { min-width: 0; }

.wnotif-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 7px;
}

.wnotif-tag {
  font-size: 9px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.2);
  color: #d9e6ff;
  padding: 1px 6px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: .3px;
}

.wnotif-sub {
  font-size: 11px;
  color: #c3d3f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Hide widgets on small screens to avoid crowding */
@media (max-width: 900px) {
  .desktop-widgets { display: none; }
}
