/* ============================================================
   SIDDHARTH_OS v1.0 — RETRO WORKSTATION STYLESHEET
   100% Original Windows-Inspired Retro Desktop Experience
   No Microsoft or proprietary assets used.
   ============================================================ */

/* ------------------------------------------------------------
   CORE DESKTOP & THEMES
   ------------------------------------------------------------ */
#retro-os-container {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
  flex-direction: column;
  background-color: #245edb;
  background-image: url('retro-wallpaper.jpg?v=2');
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, sans-serif;
  user-select: none;
  overflow: hidden;
}

#retro-os-container.active {
  display: flex;
}

/* Wallpaper variations */
#retro-os-container[data-wallpaper="bliss"] {
  background-image: url('retro-wallpaper.jpg?v=2');
  background-size: cover;
  background-position: center bottom;
}
#retro-os-container[data-wallpaper="teal"] {
  background-color: #008080;
  background-image: 
    radial-gradient(circle at 50% 50%, rgba(0, 160, 160, 0.25) 0%, transparent 80%),
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 100% 100%, 20px 20px, 20px 20px;
}
#retro-os-container[data-wallpaper="cyber"] {
  background-color: #1a1636;
  background-image: radial-gradient(circle at 50% 50%, #2f2560 0%, #100d24 85%);
}
#retro-os-container[data-wallpaper="charcoal"] {
  background-color: #23272e;
  background-image: radial-gradient(circle at 50% 50%, #323842 0%, #1a1d23 85%);
}

/* Dithering watermark */
.retro-desktop-watermark {
  position: absolute;
  bottom: 50px;
  right: 25px;
  font-family: monospace;
  font-size: 2.2rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.07);
  letter-spacing: 0.15em;
  pointer-events: none;
  text-transform: uppercase;
}

/* ------------------------------------------------------------
   CRT SCANLINE & PHOSPHOR GLOW EFFECT
   ------------------------------------------------------------ */
.retro-crt-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 100000;
  background: 
    linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
    radial-gradient(circle at center, transparent 65%, rgba(0, 0, 0, 0.4) 100%);
  background-size: 100% 3px, 100% 100%;
  opacity: 0.6;
  display: block;
}

.retro-crt-overlay.disabled {
  display: none !important;
}

/* ------------------------------------------------------------
   BIOS / BOOT POST SCREEN
   ------------------------------------------------------------ */
#retro-boot-screen {
  position: fixed;
  inset: 0;
  background: #000000;
  color: #c0c0c0;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.95rem;
  padding: 30px;
  z-index: 1000000;
  display: none;
  flex-direction: column;
  justify-content: flex-start;
  line-height: 1.6;
}

#retro-boot-screen.active {
  display: flex;
}

.boot-logo-ascii {
  color: #00e5ff;
  font-weight: 700;
  margin-bottom: 20px;
  white-space: pre;
  font-size: 0.8rem;
}

.boot-progress-bar {
  width: 320px;
  height: 18px;
  border: 2px solid #808080;
  margin-top: 15px;
  padding: 2px;
  display: flex;
}

.boot-progress-fill {
  height: 100%;
  background: #008080;
  width: 0%;
  transition: width 0.2s linear;
}

.boot-skip-hint {
  margin-top: auto;
  color: #808080;
  font-size: 0.8rem;
}

/* ------------------------------------------------------------
   SHUT DOWN SCREEN
   ------------------------------------------------------------ */
#retro-shutdown-screen {
  position: fixed;
  inset: 0;
  background: #000000;
  color: #ffb300;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  z-index: 1000000;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}

#retro-shutdown-screen.active {
  display: flex;
}

/* ------------------------------------------------------------
   DESKTOP ICON GRID
   ------------------------------------------------------------ */
.retro-desktop-area {
  flex: 1;
  position: relative;
  overflow: hidden;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, 85px);
  grid-auto-rows: 95px;
  grid-auto-flow: column;
  gap: 12px;
  align-content: start;
}

.retro-desktop-icon {
  width: 82px;
  height: 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px dotted transparent;
  padding: 4px;
  text-align: center;
  transition: background 0.1s ease;
  border-radius: 2px;
}

.retro-desktop-icon:hover {
  background: rgba(255, 255, 255, 0.15);
}

.retro-desktop-icon.selected {
  background: rgba(0, 0, 128, 0.6);
  border-color: #ffff00;
}

.retro-icon-img {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  filter: drop-shadow(1px 2px 0px rgba(0, 0, 0, 0.5));
}

.retro-icon-label {
  color: #ffffff;
  font-size: 0.75rem;
  margin-top: 5px;
  line-height: 1.2;
  text-shadow: 1px 1px 2px #000000, -1px -1px 2px #000000;
  word-break: break-word;
}

/* ------------------------------------------------------------
   BEVELED WINDOW MANAGER (Classic 3D Border Geometry)
   ------------------------------------------------------------ */
.retro-window {
  position: absolute;
  background: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  min-width: 280px;
  min-height: 200px;
  z-index: 100;
  transition: transform 0.15s ease-out, opacity 0.15s ease-out;
}

.retro-window.minimized {
  display: none !important;
}

.retro-window.maximized {
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: calc(100% - 34px) !important;
}

/* Title Bar */
.retro-titlebar {
  background: linear-gradient(90deg, #000080 0%, #1084d0 100%);
  color: #ffffff;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 0.84rem;
  letter-spacing: 0.03em;
  cursor: move;
  user-select: none;
}

.retro-window.inactive .retro-titlebar {
  background: linear-gradient(90deg, #808080 0%, #b5b5b5 100%);
  color: #c0c0c0;
}

.retro-titlebar-title {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.retro-titlebar-controls {
  display: flex;
  gap: 3px;
  margin-left: 8px;
}

.retro-btn-sys {
  width: 18px;
  height: 16px;
  background: #c0c0c0;
  border-top: 1.5px solid #ffffff;
  border-left: 1.5px solid #ffffff;
  border-right: 1.5px solid #404040;
  border-bottom: 1.5px solid #404040;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 900;
  color: #000000;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.retro-btn-sys:active {
  border-top: 1.5px solid #404040;
  border-left: 1.5px solid #404040;
  border-right: 1.5px solid #ffffff;
  border-bottom: 1.5px solid #ffffff;
  padding-top: 1px;
  padding-left: 1px;
}

/* Window Menu Bar (File, Edit, View, Help) */
.retro-menubar {
  background: #c0c0c0;
  border-bottom: 1px solid #808080;
  padding: 2px 6px;
  display: flex;
  gap: 12px;
  font-size: 0.8rem;
  color: #000000;
}

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

.retro-menu-item:hover {
  background: #000080;
  color: #ffffff;
}

.retro-win-body {
  flex: 1;
  background: #ffffff;
  border-top: 2px solid #404040;
  border-left: 2px solid #404040;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  margin: 4px;
  padding: 12px;
  overflow: auto;
  color: #000000;
  font-size: 0.86rem;
  scrollbar-width: thin;
  scrollbar-color: #808080 #c0c0c0;
}

.retro-win-body::-webkit-scrollbar, 
.retro-field-inset::-webkit-scrollbar {
  width: 14px;
  height: 14px;
}

.retro-win-body::-webkit-scrollbar-track, 
.retro-field-inset::-webkit-scrollbar-track {
  background: #c0c0c0;
  border: 1px solid #808080;
}

.retro-win-body::-webkit-scrollbar-thumb, 
.retro-field-inset::-webkit-scrollbar-thumb {
  background: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
}

.retro-win-body::-webkit-scrollbar-thumb:hover, 
.retro-field-inset::-webkit-scrollbar-thumb:hover {
  background: #d4d4d4;
}

.retro-win-body.gray-bg {
  background: #c0c0c0;
}

/* Status Bar at bottom of window */
.retro-statusbar {
  background: #c0c0c0;
  border-top: 1px solid #808080;
  padding: 3px 8px;
  font-size: 0.72rem;
  color: #404040;
  display: flex;
  justify-content: space-between;
}

/* ------------------------------------------------------------
   CLASSIC RETRO CONTROLS (Tabs, Buttons, Frames)
   ------------------------------------------------------------ */
.retro-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid #ffffff;
  margin-bottom: 10px;
}

.retro-tab {
  background: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #404040;
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: -2px;
}

.retro-tab.active {
  background: #c0c0c0;
  border-bottom: 2px solid #c0c0c0;
  font-weight: 700;
}

.retro-button {
  background: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
  color: #000000;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 14px;
  cursor: pointer;
}

.retro-button:active {
  border-top: 2px solid #404040;
  border-left: 2px solid #404040;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
}

/* Beveled Inset Field */
.retro-field-inset {
  background: #ffffff;
  border-top: 2px solid #404040;
  border-left: 2px solid #404040;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  padding: 6px;
}

/* ------------------------------------------------------------
   TASKBAR & SYSTEM TRAY
   ------------------------------------------------------------ */
.retro-taskbar {
  height: 34px;
  background: #c0c0c0;
  border-top: 2px solid #ffffff;
  display: flex;
  align-items: center;
  padding: 3px 4px;
  gap: 5px;
  z-index: 99999;
}

/* Start Button */
.retro-start-btn {
  background: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  color: #000000;
  cursor: pointer;
  height: 28px;
}

.retro-start-btn:active,
.retro-start-btn.active {
  border-top: 2px solid #404040;
  border-left: 2px solid #404040;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
}

.retro-start-logo {
  width: 16px;
  height: 16px;
  background: linear-gradient(135deg, #008080 50%, #00e5ff 50%);
  border: 1px solid #000000;
  display: inline-block;
}

/* Taskbar Windows Row */
.retro-taskbar-tasks {
  flex: 1;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  height: 100%;
}

.retro-task-btn {
  width: 140px;
  height: 26px;
  background: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 6px;
  font-size: 0.78rem;
  color: #000000;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.retro-task-btn.active {
  background: #d8d8d8;
  border-top: 2px solid #404040;
  border-left: 2px solid #404040;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  font-weight: 700;
}

/* System Tray */
.retro-tray {
  border-top: 2px solid #808080;
  border-left: 2px solid #808080;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  padding: 2px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 26px;
  font-size: 0.78rem;
  color: #000000;
}

.retro-tray-item {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

/* ------------------------------------------------------------
   START MENU
   ------------------------------------------------------------ */
.retro-start-menu {
  position: absolute;
  bottom: 34px;
  left: 2px;
  width: 220px;
  background: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
  box-shadow: 4px 4px 15px rgba(0, 0, 0, 0.5);
  display: none;
  flex-direction: column;
  z-index: 100000;
}

.retro-start-menu.open {
  display: flex;
}

.start-menu-sidebar {
  background: linear-gradient(180deg, #000080 0%, #1084d0 100%);
  color: #ffffff;
  width: 28px;
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  padding: 10px 4px;
}

.start-sidebar-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.15em;
}

.start-menu-items {
  margin-left: 28px;
  display: flex;
  flex-direction: column;
}

.start-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 0.85rem;
  color: #000000;
  cursor: pointer;
}

.start-menu-item:hover {
  background: #000080;
  color: #ffffff;
}

.start-menu-divider {
  height: 1px;
  background: #808080;
  border-bottom: 1px solid #ffffff;
  margin: 3px 6px;
}

/* ------------------------------------------------------------
   CONTEXT MENU (Right-click desktop)
   ------------------------------------------------------------ */
.retro-context-menu {
  position: absolute;
  width: 175px;
  background: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
  box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.4);
  display: none;
  flex-direction: column;
  z-index: 100001;
  font-size: 0.82rem;
}

.retro-context-menu.open {
  display: flex;
}

.ctx-item {
  padding: 6px 12px;
  cursor: pointer;
  color: #000000;
}

.ctx-item:hover {
  background: #000080;
  color: #ffffff;
}

/* ------------------------------------------------------------
   FLOATING LAUNCH TOGGLE BUTTON (MODERN SITE HUD)
   ------------------------------------------------------------ */
.retro-os-boot-btn {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 998;
  background: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  color: #000000;
  font-family: 'Space Grotesk', monospace;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.15s ease;
  user-select: none;
}

.retro-os-boot-btn:hover {
  transform: translateY(-2px);
  background: #d4d4d4;
}

.retro-os-boot-btn:active {
  border-top: 2px solid #404040;
  border-left: 2px solid #404040;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
}

.retro-os-boot-btn .os-flag-icon {
  width: 14px;
  height: 14px;
  background: #008080;
  border: 1px solid #000000;
  display: inline-block;
}

/* ------------------------------------------------------------
   SCREENSAVER (Bouncing Siddharth Text)
   ------------------------------------------------------------ */
#retro-screensaver {
  position: absolute;
  inset: 0;
  background: #000000;
  z-index: 200000;
  display: none;
  cursor: auto;
}

#retro-screensaver.active {
  display: block;
}

.screensaver-text {
  position: absolute;
  font-family: 'Space Grotesk', monospace;
  font-size: 2.2rem;
  font-weight: 800;
  color: #00e5ff;
  text-shadow: 0 0 10px #00e5ff;
  user-select: none;
  white-space: nowrap;
}

/* ------------------------------------------------------------
   MINESWEEPER RETRO GAME APP
   ------------------------------------------------------------ */
.minesweeper-frame {
  background: #c0c0c0;
  padding: 6px;
  display: inline-block;
}

.ms-header {
  border-top: 2px solid #808080;
  border-left: 2px solid #808080;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  padding: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.ms-counter {
  background: #000000;
  color: #ff0000;
  font-family: 'Courier New', monospace;
  font-size: 1.2rem;
  font-weight: 900;
  padding: 2px 6px;
  letter-spacing: 0.1em;
}

.ms-smiley {
  width: 26px;
  height: 26px;
  background: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #808080;
  border-bottom: 2px solid #808080;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.ms-grid {
  border-top: 3px solid #808080;
  border-left: 3px solid #808080;
  border-right: 3px solid #ffffff;
  border-bottom: 3px solid #ffffff;
  display: grid;
  grid-template-columns: repeat(9, 22px);
  grid-template-rows: repeat(9, 22px);
  gap: 0;
}

.ms-cell {
  width: 22px;
  height: 22px;
  background: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #808080;
  border-bottom: 2px solid #808080;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

.ms-cell.revealed {
  border: 1px solid #7b7b7b;
  border-top: none;
  border-left: none;
  background: #c0c0c0;
}

/* ------------------------------------------------------------
   ALT+TAB SWITCHER OVERLAY
   ------------------------------------------------------------ */
.retro-alttab-modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
  padding: 16px;
  box-shadow: 4px 4px 20px rgba(0, 0, 0, 0.6);
  z-index: 100005;
  display: none;
  flex-direction: column;
  gap: 12px;
  min-width: 300px;
}

.retro-alttab-modal.open {
  display: flex;
}

.alttab-icons-row {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.alttab-card {
  padding: 8px;
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.alttab-card.focused {
  border: 2px dotted #000080;
  background: #dcdcdc;
}

/* ------------------------------------------------------------
   MOBILE RETRO OS ADAPTATION
   ------------------------------------------------------------ */
@media (max-width: 768px) {
  .retro-desktop-area {
    grid-template-columns: repeat(auto-fill, 75px);
    grid-auto-rows: 85px;
    gap: 8px;
  }

  .retro-window {
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: calc(100% - 34px) !important;
    border: none;
  }

  .retro-btn-sys.minimize,
  .retro-btn-sys.maximize {
    display: none;
  }

  .retro-os-boot-btn {
    bottom: 75px;
    left: 16px;
    padding: 6px 10px;
    font-size: 0.75rem;
  }
}
