/* ===== Root & Resets ===== */
:root {
  --taskbar-h: 40px;
  --font-body: 'Courier New', monospace;
  
  /* Classic Theme Colors */
  --desktop-bg: #008080;
  --desktop-pattern: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 0, 0, 0.03) 2px, rgba(0, 0, 0, 0.03) 4px);
  --boot-bg: #000080;
  --boot-progress: linear-gradient(90deg, #00ff00, #008000);
  
  /* Window Colors */
  --window-bg: #c0c0c0;
  --window-content-bg: white;
  --window-border-light: #fff;
  --window-border-dark: #000;
  --window-titlebar: linear-gradient(90deg, #000080, #1084d0);
  --window-text: #000;
  --window-text-light: #c0c0c0;
  
  /* Button Colors */
  --btn-bg: #c0c0c0;
  --btn-border-light: #fff;
  --btn-border-dark: #000;
  --btn-active-bg: #c0c0c0;
  
  /* Taskbar Colors */
  --taskbar-bg: #c0c0c0;
  --taskbar-border: #fff;
  --taskbar-button-bg: #c0c0c0;
  --taskbar-button-active: #000080;
  --clock-bg: #e0e0e0;
  --clock-border: 2px inset #c0c0c0;
  
  /* Special Elements */
  --highlight-bg: #ffff66;
  --highlight-text: #000;
  --dotted-border: #000;
  --tab-active-bg: #fff;
  
  /* Effects */
  --window-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  --border-radius: 0px;
}

/* Modern Theme - Windows Vista Aero Glass */

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

body {
  font-family: var(--font-body, 'Courier New', monospace);
  height: 100vh;
  overflow: hidden;
  background: var(--desktop-bg);
  position: relative;
  transition: all 0.3s ease;
}

body:not(.modern-theme) {
  background-image: var(--desktop-pattern);
}

/* ===== Boot Screen ===== */
.boot-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--boot-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease-out;
  /* Performance optimizations */
  backface-visibility: hidden;
  transform: translateZ(0);
  will-change: opacity;
}

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

.boot-content {
  text-align: center;
  color: white;
}

.boot-logo {
  margin-bottom: 60px;
}

.boot-icon {
  font-size: 80px;
  margin-bottom: 20px;
  animation: pulse 2s infinite;
}

.boot-logo h1 {
  font-size: 36px;
  margin-bottom: 10px;
  color: white;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.boot-version {
  font-size: 14px;
  color: var(--window-text-light);
}

.boot-progress {
  width: 300px;
  margin: 0 auto;
}

.progress-bar {
  width: 100%;
  height: 20px;
  background: var(--window-bg);
  border: 2px solid var(--window-border-light);
  margin-bottom: 15px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--boot-progress);
  width: 0%;
  transition: width 0.1s ease;
}

.boot-text {
  color: var(--window-text-light);
  font-size: 14px;
  font-family: 'Courier New', monospace;
}

@keyframes pulse {
  0%, 50%, 100% { transform: scale(1); }
  25%, 75% { transform: scale(1.05); }
}

/* ===== Desktop ===== */
.desktop {
  width: 100%;
  height: calc(100% - var(--taskbar-h));
  position: relative;
  padding: 20px;
}

/* Modern theme: lay out desktop icons on a tidy grid (no absolute offsets) */

/* Classic theme: 2-column grid with wider columns for label wrapping */
body:not(.modern-theme) .desktop {
  display: grid;
  grid-template-columns: repeat(2, 140px);  /* Wider columns for wrapped text */
  grid-auto-rows: max-content;
  gap: 18px 24px;
  align-content: start;
  justify-content: start;
}

/* ===== Icons ===== */
.icon {
  position: absolute;
  width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px;
  cursor: pointer;
  border: 2px solid transparent;
  /* Performance optimizations */
  contain: layout paint;
  will-change: transform;
}

/* Wider icons in classic mode to accommodate longer text */
body:not(.modern-theme) .icon {
  position: static !important;    /* participate in grid flow */
  top: auto !important;
  left: auto !important;
  width: 140px !important;        /* Match column width */
  padding: 8px 5px !important;
  min-height: 90px !important;    /* Slightly taller for wrapped text */
  margin: 0 !important;           /* spacing handled by grid gap */
  display: block !important;      /* simple block layout */
  text-align: center !important; /* center contents */
}

/* In modern theme, let icons flow in the grid and normalize size */

.icon:hover {
  background: rgba(0, 0, 128, 0.3);
  border: 2px dotted #fff;
}

.icon.selected {
  background: rgba(0, 0, 128, 0.5);
  border: 2px dotted #fff;
}

.icon-image {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
  pointer-events: none;
}

/* Bigger icons and text in classic mode only */
body:not(.modern-theme) .icon-image {
  width: 40px;
  height: 40px;
  display: inline-block !important;
  margin: 0 auto 5px auto !important;
}

body:not(.modern-theme) .icon .icon-label {
  /* Force block-level behavior for proper width */
  display: block !important;
  /* Take full available width of parent (140px - padding) */
  width: calc(100% - 10px) !important;
  /* Set max width to prevent overflow */
  max-width: 130px !important;
  /* Small padding for text breathing room */
  padding: 2px !important;
  margin: 0 5px !important;          /* add margin to center */
  /* Slightly smaller font for better fit */
  font-size: 11px !important;
  /* CRITICAL: Allow text wrapping */
  white-space: normal !important;
  /* Proper line height for wrapped text */
  line-height: 1.3 !important;
  /* Auto height to accommodate wrapped text */
  height: auto !important;
  min-height: auto !important;
  /* Enable word breaking for long words */
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  word-break: break-word !important;
  /* Visible overflow */
  overflow: visible !important;
  /* No text truncation */
  text-overflow: clip !important;
  /* Center align text */
  text-align: center !important;
  /* Include padding in width calculation */
  box-sizing: border-box !important;
  /* Remove any flex properties that might be inherited */
  flex: none !important;
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
/* Position relative for proper flow */
  position: relative !important;
}

/* ULTRA-SPECIFIC: Force classic mode labels to display properly */
body:not(.modern-theme) .desktop .icon span.icon-label {
  display: block !important;
  width: 130px !important;  /* Fixed width slightly less than icon */
  max-width: 130px !important;
  white-space: normal !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  text-overflow: clip !important;
  overflow: visible !important;
  line-height: 1.3 !important;
  height: auto !important;
  min-height: 1em !important;
  font-size: 11px !important;
  text-align: center !important;
  margin: 0 auto !important;
  padding: 2px 0 !important;
  box-sizing: border-box !important;
  position: relative !important;
  z-index: 1 !important;
}

/* Modern icon swap: hide retro pixel icons and show vector set */
.icon .icon-modern { display: none; width: 32px; height: 32px; }

.icon-label {
  color: white;
  text-shadow: 1px 1px 1px black;
  font-size: 11px;
  text-align: center;
  pointer-events: none;
  /* Default for classic: allow wrapping */
  max-width: none;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  /* Ensure labels are block-level by default in classic */
  display: inline-block;
  width: auto;
}

/* Improve label readability on modern desktop */

/* CRITICAL FIX: Override modern theme for classic mode labels - MUST come after modern theme rules */
body:not(.modern-theme) .icon-label {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  display: block !important;
  width: 130px !important;        /* Wider to fit in 140px column */
  max-width: 130px !important;
}

/* ===== Windows ===== */
.window {
  position: absolute;
  background: var(--window-bg);
  border: 2px solid;
  border-color: var(--window-border-light) var(--window-border-dark) var(--window-border-dark) var(--window-border-light);
  box-shadow: var(--window-shadow);
  display: none;
  min-width: 360px;
  min-height: 260px;
  border-radius: var(--border-radius);
  transition: transform 0.2s ease, opacity 0.2s ease;
  /* Performance optimizations */
  will-change: transform, opacity;
  transform: translate3d(0, 0, 0);
  contain: layout style paint;
  content-visibility: auto;
}

/* Vista Aero Glass effect - stronger blur and saturation */

.window.active {
  display: block;
  z-index: 100;
}

.window-header {
  background: var(--window-titlebar);
  color: white;
  padding: 3px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  cursor: move;
  position: relative;
}

/* Vista glass titlebar - taller with stronger gradient */

/* Vista's prominent glossy reflection on titlebar */

.window-title {
  font-size: 12px;
  font-weight: bold;
  padding-left: 3px;
}

/* Ensure title text is visible in modern theme */

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

.window-button {
  width: 16px;
  height: 14px;
  background: var(--btn-bg);
  border: 1px solid;
  border-color: var(--btn-border-light) var(--btn-border-dark) var(--btn-border-dark) var(--btn-border-light);
  font-size: 10px;
  border-radius: calc(var(--border-radius) / 2);
}

/* Vista glass window buttons - more square with slight rounding */


  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
}

.window-button:active {
  border-color: var(--btn-border-dark) var(--btn-border-light) var(--btn-border-light) var(--btn-border-dark);
  background: var(--btn-active-bg);
}

/* ===== Performance States ===== */
.window.dragging {
  will-change: transform;
  pointer-events: none;
  transform: translate3d(var(--drag-x, 0), var(--drag-y, 0), 0);
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .window {
    transition: none;
  }
  
  .boot-screen {
    transition: none;
  }
  
  .icon {
    transition: none;
  }
}

/* Print optimization - hide interactive elements */
@media print {
  .boot-screen,
  .taskbar,
  .window-controls,
  .tv-remote,
  #start-menu {
    display: none !important;
  }
  
  .window {
    position: static !important;
    box-shadow: none !important;
    border: 1px solid #000 !important;
    page-break-inside: avoid;
  }
}

.window-content {
  padding: 10px;
  height: calc(100% - 25px);
  overflow: auto;
  background: var(--window-content-bg);
  border: 2px inset var(--window-bg);
  margin: 2px;
  /* Prevent bottom content from being obscured by the fixed taskbar */
  padding-bottom: calc(10px + var(--taskbar-h));
  border-radius: 0 0 var(--border-radius) var(--border-radius);
  color: var(--window-text);
}

/* ===== Folder & Files ===== */
.folder-content {
  display: grid;
  grid-template-columns: repeat(auto-fill, 150px);
  gap: 20px;
  padding: 10px;
}

.file-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px;
  cursor: pointer;
  border: 2px solid transparent;
  position: relative; /* allow overlay badges */
}

.file-icon .icon-label {
  color: black !important;
  text-shadow: none;
  font-size: 11px;
  text-align: center;
  word-wrap: break-word;
  white-space: normal;
  max-width: 130px;
  line-height: 1.2;
  overflow-wrap: break-word;
}

/* Ensure articles window file names are always black and readable */
#articles-window .file-icon .icon-label {
  color: black !important;
  text-shadow: none !important;
}

.file-icon:hover {
  background: rgba(0, 0, 128, 0.1);
  border: 2px dotted #000;
}

/* External link badge for file-like items that open a link */
.file-icon.external-link::after {
  content: '↗';
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 12px;
  line-height: 1;
  background: #ffff66; /* high-contrast */
  color: #000;
  border: 1px solid #000;
  border-radius: 2px;
  padding: 1px 2px;
  z-index: 2;          /* ensure it sits above SVG */
  pointer-events: none; /* never intercept clicks */
}

/* ===== Articles ===== */
.article-content {
  font-family: Georgia, serif;
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto;
}

.article-content h1 {
  color: #000080;
  border-bottom: 2px solid #000080;
  padding-bottom: 10px;
  margin-bottom: 20px;
}

.article-content h2 {
  color: #000080;
  margin-top: 30px;
  margin-bottom: 15px;
  font-size: 18px;
}

.article-content h3 {
  color: #000080;
  margin-top: 25px;
  margin-bottom: 12px;
  font-size: 16px;
}

.article-content p {
  margin-bottom: 15px;
}

/* ===== Notepad ===== */
.notepad {
  font-family: 'Courier New', monospace;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.5;
}

/* ===== Contact ===== */
.contact h3 {
  color: #000080;
  margin-bottom: 20px;
}

.contact p {
  margin-bottom: 12px;
}

.contact hr {
  margin: 16px 0;
}

.muted {
  font-style: italic;
  opacity: 0.8;
}

/* ===== Projects ===== */
.projects h3 {
  color: #000080;
  margin-bottom: 16px;
}

.project {
  border: 1px solid #000;
  padding: 15px;
  margin-bottom: 15px;
  background: #f0f0f0;
}

/* ===== Interviews ===== */
.interviews-content {
  font-family: Georgia, serif;
  line-height: 1.6;
}

.interviews-content h2 {
  color: #000080;
  border-bottom: 2px solid #000080;
  padding-bottom: 10px;
  margin-bottom: 20px;
}

.interviews-content h3 {
  color: #000080;
  margin: 30px 0 20px 0;
}

.interview-grid {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.interview-item {
  border: 2px solid #000;
  background: #f8f8f8;
  padding: 20px;
}

.interview-item h4 {
  color: #000080;
  margin-bottom: 10px;
  font-size: 16px;
}

.interview-description {
  margin-bottom: 15px;
  font-style: italic;
}

.interview-date {
  margin-bottom: 15px;
  font-size: 12px;
  color: #666;
}

.embed-container {
  width: 100%;
  max-width: 100%;
}

.embed-container iframe {
  width: 100%;
  border: 2px inset #c0c0c0;
  height: 85px; /* Further reduced height for Spotify embeds */
}

.embed-container iframe[src*="youtube"] {
  height: 315px; /* Standard height for YouTube embeds */
}


/* Responsive adjustments for embeds */
@media (max-width: 768px) {
  .embed-container iframe {
    height: 200px;
  }
}

/* Respect users who prefer reduced motion and avoid heavy GPU effects */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ===== Minesweeper Game ===== */
.minesweeper-game {
  padding: 10px;
  background: #c0c0c0;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #c0c0c0;
  border: 2px inset #c0c0c0;
  padding: 8px;
  margin-bottom: 10px;
}

.mine-counter, .timer {
  background: #000;
  color: #ff0000;
  font-family: 'Courier New', monospace;
  font-weight: bold;
  font-size: 16px;
  padding: 4px 8px;
  border: 2px inset #c0c0c0;
  min-width: 40px;
  text-align: center;
}

.smiley-face {
  font-size: 24px;
  background: #c0c0c0;
  border: 2px outset #c0c0c0;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.smiley-face:active {
  border: 2px inset #c0c0c0;
}

.game-board {
  display: grid;
  grid-template-columns: repeat(14, 22px);
  grid-template-rows: repeat(10, 22px);
  gap: 1px;
  background: #808080;
  border: 2px inset #c0c0c0;
  padding: 4px;
  margin-bottom: 10px;
}

.mine-cell {
  width: 22px;
  height: 22px;
  background: #c0c0c0;
  border: 2px outset #c0c0c0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: 'Courier New', monospace;
  font-weight: bold;
  font-size: 11px;
  user-select: none;
}

.mine-cell.revealed {
  border: 1px solid #808080;
  background: #e0e0e0;
}

.mine-cell.flagged {
  background: #c0c0c0;
}

.mine-cell.flagged::after {
  content: '🚩';
  font-size: 12px;
}

.mine-cell.mine.revealed {
  background: #ff0000;
}

.mine-cell.mine.revealed::after {
  content: '💣';
  font-size: 12px;
}

.mine-cell.number-1 { color: #0000ff; }
.mine-cell.number-2 { color: #008000; }
.mine-cell.number-3 { color: #ff0000; }
.mine-cell.number-4 { color: #000080; }
.mine-cell.number-5 { color: #800000; }
.mine-cell.number-6 { color: #008080; }
.mine-cell.number-7 { color: #000000; }
.mine-cell.number-8 { color: #808080; }

.game-instructions {
  background: #f0f0f0;
  border: 2px inset #c0c0c0;
  padding: 10px;
  font-size: 11px;
}

.game-instructions p {
  margin: 4px 0;
}

/* ===== Start Menu ===== */
.start-menu {
  position: fixed;
  bottom: 42px;
  left: 4px;
  width: 200px;
  background: #c0c0c0;
  border: 2px outset #c0c0c0;
  display: none;
  z-index: 10000;
  box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.start-menu.show {
  display: block;
}

.start-menu-header {
  background: linear-gradient(90deg, #000080, #0000ff);
  color: white;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #808080;
}

.start-logo {
  font-size: 24px;
}

.start-title {
  font-weight: bold;
  font-size: 12px;
  line-height: 1.2;
}

.start-menu-items {
  padding: 2px 0;
}

.start-item {
  display: flex;
  align-items: center;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 11px;
  gap: 8px;
  position: relative;
}

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

.start-icon {
  width: 16px;
  font-size: 12px;
  text-align: center;
}

.start-label {
  flex: 1;
}

.start-arrow {
  font-size: 8px;
  color: #000;
}

.start-item:hover .start-arrow {
  color: white;
}

.start-separator {
  height: 1px;
  background: #808080;
  margin: 2px 8px;
  border-bottom: 1px solid #fff;
}

.start-submenu {
  position: fixed;
  bottom: 42px;
  left: 206px;
  width: 180px;
  background: #c0c0c0;
  border: 2px outset #c0c0c0;
  display: none;
  z-index: 10001;
  box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  padding: 2px 0;
}

.start-submenu.show {
  display: block;
}

/* ===== System Info ===== */
.system-info {
  text-align: center;
  padding: 20px;
}

.system-logo {
  font-size: 48px;
  margin-bottom: 10px;
}

.system-info h2 {
  color: #000080;
  margin-bottom: 15px;
}

.system-info p {
  margin: 8px 0;
  font-size: 12px;
}

.system-info ul {
  text-align: left;
  margin: 10px 0;
  padding-left: 20px;
}

.system-info li {
  margin: 5px 0;
  font-size: 12px;
}

.system-info hr {
  margin: 15px 0;
  border: none;
  border-top: 1px solid #808080;
  border-bottom: 1px solid #fff;
}

/* ===== Taskbar ===== */
.taskbar{
  position: fixed;
  /* Use explicit offsets for wider browser compatibility (fallback for inset) */
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: var(--taskbar-h);
  background: var(--taskbar-bg);
  border-top: 2px solid var(--taskbar-border);
  display: flex;
  align-items: center;
  padding: 4px;
  gap: 5px;
  z-index: 2147483647;            /* sit above everything */
  pointer-events: auto;
  transform: translateZ(0);       /* create its own stacking context */
}

.desktop{ height: calc(100% - var(--taskbar-h)); }

/* Windows Vista Aero glass taskbar - stronger blur and saturation */

/* Vista's prominent glossy reflection for taskbar */
/* Windows Vista orb start button - larger with pearl effect */

/* Vista's prominent pearl/glossy overlay on orb */




/* Hide text in modern theme - orb is icon only */

/* Vista desktop icons - subtle glass effect on hover */




/* Modern icon images with gradient overlays and Windows 7 colors */

/* Windows 7 style icons now have built-in gradients and colors */

/* Modern file icons in articles window */


/* Vista glossy clock - more prominent glass effect */


/* Vista taskbar buttons - more glass effect */




/* Vista start menu styling - stronger glass effect */

/* Vista start menu header - vibrant gradient */









/* Start menu items padding and spacing */

/* Vista's prominent glossy overlay for the entire start menu */

/* Vista submenu styling - stronger glass effect */

/* Modern start menu icons - replace emoji with modern symbols */

.start-button {
  min-height: calc(var(--taskbar-h) - 8px);
  padding: 0 14px;
  background: linear-gradient(180deg, #f4fbf4 0%, #d2e8d2 55%, #b6d3b6 100%);
  border: 2px solid;
  border-color: var(--btn-border-light) var(--btn-border-dark) var(--btn-border-dark) var(--btn-border-light);
  font-weight: 700;
  font-size: 12px;
  color: #0a4d16;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.start-button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: #008000;
  font-size: 14px;
  font-weight: 700;
}

.start-button-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
}

.start-button-label {
  display: inline-block;
  line-height: 1;
}

.start-button:active,
.start-button.active {
  border-color: var(--btn-border-dark) var(--btn-border-light) var(--btn-border-light) var(--btn-border-dark);
  background: linear-gradient(180deg, #9fcb9f 0%, #77b277 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
  color: #06380f;
}

.taskbar-windows .task-button {
  padding: 4px 8px;
  background: var(--taskbar-button-bg);
  border: 2px solid;
  border-color: var(--btn-border-light) var(--btn-border-dark) var(--btn-border-dark) var(--btn-border-light);
  font-size: 11px;
  cursor: pointer;
  max-width: 150px;
  overflow: hidden;
  border-radius: var(--border-radius);
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 4px;
}

.taskbar-windows .task-button.active {
  background: var(--taskbar-button-active);
  border-color: var(--btn-border-dark) var(--btn-border-light) var(--btn-border-light) var(--btn-border-dark);
  font-weight: bold;
  color: white;
}

.clock {
  margin-left: auto;
  padding: 4px 8px;
  background: var(--clock-bg);
  border: var(--clock-border);
  font-size: 11px;
  font-family: 'Courier New', monospace;
  border-radius: var(--border-radius);
  color: var(--window-text);
}

/* iOS safe-area nicety */
@supports (bottom: env(safe-area-inset-bottom)) {
  .taskbar{
    padding-bottom: max(4px, env(safe-area-inset-bottom));
  }
}

/* ===== Scrollbars ===== */
.window-content::-webkit-scrollbar {
  width: 16px;
}

.window-content::-webkit-scrollbar-track {
  background: #c0c0c0;
  border: 1px solid #000;
}

.window-content::-webkit-scrollbar-thumb {
  background: #c0c0c0;
  border: 2px solid;
  border-color: #fff #000 #000 #fff;
}

.window-content::-webkit-scrollbar-button {
  background: #c0c0c0;
  border: 2px solid;
  border-color: #fff #000 #000 #fff;
  height: 16px;
}

/* ===== Mobile Responsive Design ===== */
@media screen and (max-width: 768px) {
  /* Enhanced mobile boot screen transition */
  .boot-screen {
    transition: opacity 0.8s cubic-bezier(0.4, 0.0, 0.2, 1), 
                transform 0.8s cubic-bezier(0.4, 0.0, 0.2, 1);
  }
  
  .boot-screen.fade-out {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
  }

  /* Mobile Desktop Layout */
  .desktop {
    padding: 10px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Lighter glass effect on mobile for performance */

  /* Mobile-Friendly Desktop Icons */
  .icon {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100%;
    max-width: 140px;
    padding: 15px 10px;
    margin-bottom: 10px;
    border-radius: 4px;
    background: rgba(0, 0, 128, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
    text-align: center; /* ensure label text centers under icons */
  }

  .icon:hover, .icon:active {
    background: rgba(0, 0, 128, 0.3);
    border: 2px solid #fff;
    transform: scale(1.02);
  }

  .icon.selected {
    background: rgba(0, 0, 128, 0.4);
    border: 2px solid #fff;
  }

  .icon-image {
    width: 40px;
    height: 40px;
  }

  .icon-label {
    font-size: 12px;
    font-weight: bold;
    text-shadow: 2px 2px 2px rgba(0, 0, 0, 0.8);
    white-space: normal;
    word-wrap: break-word;
    max-width: 120px;
    line-height: 1.3;
    display: block;
    margin: 0 auto; /* center the label block within the icon */
    text-align: center;
  }

  /* Classic desktop tiles need full-width containers so labels stay centered */
  body:not(.modern-theme) .icon {
    width: 100% !important;
    max-width: 140px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  body:not(.modern-theme) .desktop .icon span.icon-label {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Mobile Desktop Grid Layout */
  .desktop {
    display: grid;
    /* Default mobile grid for non-classic themes */
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    align-content: start;
    justify-items: center; /* center icons within their grid tracks */
  }

  /* Classic theme on mobile: keep fixed-width tiles and center the grid */
  body:not(.modern-theme) .desktop {
    /* Ensure this overrides the earlier classic desktop rule */
    grid-template-columns: repeat(auto-fit, 140px) !important;
    justify-content: center !important;   /* center the columns within viewport */
    justify-items: center !important;     /* center items within their tracks */
  }

  /* Mobile Window Management */
  .window {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    /* Use viewport-height minus taskbar; corrected below for dynamic/safe-area */
    height: calc(100vh - var(--taskbar-h)) !important;
    border-radius: 0;
    min-width: unset;
    min-height: unset;
    /* Keep windows below the fixed taskbar */
    z-index: 1000;
  }

  .window.active {
    display: block;
  }

  /* Mobile Window Header */
  .window-header {
    padding: 8px;
    touch-action: none;
    cursor: default;
  }

  .window-title {
    font-size: 14px;
    font-weight: bold;
  }

  .window-controls {
    gap: 8px;
  }

  .window-button {
    width: 32px;
    height: 28px;
    font-size: 14px;
    touch-action: manipulation;
  }

  /* Mobile Window Content */
  .window-content {
    height: calc(100% - 40px);
    padding: 15px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    /* Fix scrolling at the end of content - add extra space for start menu */
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
  }

  /* Use dynamic viewport units when supported (address bar collapse on mobile browsers) */
  @supports (height: 100dvh) {
    .window { height: calc(100dvh - var(--taskbar-h)) !important; }
  }

  /* Respect iOS safe area for both the window and inner scroll padding */
  @supports (bottom: env(safe-area-inset-bottom)) {
    .window { height: calc(100vh - var(--taskbar-h) - env(safe-area-inset-bottom)); }
    .window-content { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
  }

  /* Mobile-Friendly File Icons */
  .folder-content {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    padding: 5px;
  }

  .file-icon {
    padding: 12px 8px;
    border-radius: 4px;
    min-height: 80px;
  }

  .file-icon .icon-image {
    width: 28px;
    height: 32px;
  }

  .file-icon .icon-label {
    font-size: 11px;
    line-height: 1.2;
    max-width: 100px;
  }

  /* Mobile Taskbar */
  .taskbar {
    height: 50px;
    padding: 8px;
    gap: 8px;
  }

  /* Modern theme mobile taskbar overrides */

  /* Performance mode for low-end devices or when GPU acceleration is limited */
  @media (max-resolution: 150dpi) and (max-width: 768px), 
         (pointer: coarse) and (hover: none) and (max-width: 480px) {
    
    
  }

  .start-button {
    padding: 8px 12px;
    font-size: 12px;
    min-width: 60px;
  }

  /* Modern theme mobile overrides - ensure start button is visible and touchable */

  /* Show text in modern theme on mobile */



  .taskbar-windows {
    display: none; /* Hide task buttons on mobile - use start menu instead */
  }

  .clock {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: bold;
  }

  /* Modern theme mobile clock overrides */

  /* Mobile Start Menu */
  .start-menu {
    bottom: 58px;
    left: 8px;
    right: 8px;
    width: auto;
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
  }

  /* Modern theme mobile start menu overrides */





  .start-menu-header {
    padding: 12px;
  }

  .start-title {
    font-size: 14px;
  }

  .start-item {
    padding: 12px 16px;
    font-size: 13px;
    touch-action: manipulation;
  }

  .start-icon {
    width: 20px;
    font-size: 16px;
  }

  /* Mobile Submenus */
  .start-submenu {
    position: fixed;
    bottom: 58px;
    left: 8px;
    right: 8px;
    width: auto;
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
  }

  /* Modern theme mobile submenu overrides */

  /* Mobile-Specific App Adjustments */
  
  /* Mobile Minesweeper */
  .game-board {
    grid-template-columns: repeat(10, 28px);
    grid-template-rows: repeat(8, 28px);
    justify-content: center;
  }

  .mine-cell {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .game-header {
    padding: 12px;
    margin-bottom: 15px;
  }

  .mine-counter, .timer {
    font-size: 18px;
    padding: 6px 10px;
    min-width: 50px;
  }

  .smiley-face {
    width: 45px;
    height: 45px;
    font-size: 28px;
  }

  /* Mobile Music Player */
  .music-tabs {
    flex-wrap: wrap;
    margin-bottom: 10px;
  }

  .tab-btn {
    flex: 1;
    min-width: 120px;
    padding: 12px 8px;
    font-size: 12px;
    text-align: center;
  }

  .player-controls {
    padding: 12px;
    margin-bottom: 12px;
  }

  .now-playing-section {
    flex-direction: column;
    text-align: center;
    gap: 10px;
    margin-bottom: 12px;
  }

  .album-art {
    width: 80px;
    height: 80px;
    align-self: center;
  }

  .track-title {
    font-size: 14px;
  }

  .track-artist {
    font-size: 13px;
  }

  .player-buttons {
    gap: 15px;
    margin-bottom: 12px;
  }

  .player-btn {
    width: 45px;
    height: 35px;
    font-size: 14px;
  }

  .play-btn {
    width: 55px;
    font-size: 16px;
  }

  /* Mobile Library */
  .books-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .book-item {
    padding: 15px;
  }

  .book-cover {
    width: 60px;
    height: 80px;
    font-size: 24px;
  }

  .book-title {
    font-size: 13px;
    line-height: 1.3;
  }

  .book-author {
    font-size: 12px;
  }

  /* Mobile Albums Grid */
  .albums-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .album-item {
    padding: 12px;
    gap: 12px;
  }

  .album-cover {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }

  /* Mobile Projects */
  .project {
    padding: 15px;
    margin-bottom: 12px;
  }

  /* Mobile Interviews */
  .interview-grid {
    gap: 20px;
  }

  .interview-item {
    padding: 15px;
  }

  .interview-item h4 {
    font-size: 15px;
    margin-bottom: 8px;
  }

  .interview-description {
    font-size: 13px;
    line-height: 1.4;
  }

  /* Mobile Embeds */
  .embed-container iframe {
    height: 200px;
  }

  .embed-container iframe[src*="youtube"] {
    height: 200px;
  }

  .embed-container iframe[src*="spotify"] {
    height: 85px;
  }

  /* Fix Spotify embeds in interviews window on mobile */
  #interviews-window .embed-container iframe[src*="spotify"] {
    height: 85px;
    min-height: 85px;
    max-width: 100%;
    border-radius: 12px;
  }

  /* Mobile About/Contact */
  .notepad {
    font-size: 12px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
  }

  /* Mobile Articles - ensure extra bottom spacing */
  .article-content {
    padding-bottom: 40px;
  }

  /* Mobile System Info */
  .system-info {
    padding: 20px 15px;
  }

  .system-logo {
    font-size: 40px;
  }

  .system-info h2 {
    font-size: 18px;
  }

  .system-info p {
    font-size: 13px;
    line-height: 1.4;
  }

  .system-info ul {
    padding-left: 15px;
  }

  .system-info li {
    font-size: 13px;
    line-height: 1.3;
    margin: 8px 0;
  }

  /* Mobile Newsletter */
  .newsletter {
    padding: 15px !important;
  }

  #newsletter-form input {
    padding: 10px !important;
    font-size: 14px !important;
  }

  .connect-btn {
    padding: 10px 15px !important;
    font-size: 13px !important;
    min-width: 80px;
  }

  /* Mobile Private Window */
  #private-login-form {
    flex-direction: column !important;
    gap: 12px !important;
    align-items: stretch !important;
  }

  #private-password {
    padding: 10px !important;
    font-size: 14px !important;
  }

  /* Hide scrollbars on mobile for cleaner look */
  .window-content::-webkit-scrollbar {
    width: 6px;
  }

  .window-content::-webkit-scrollbar-thumb {
    background: #999;
    border-radius: 3px;
    border: none;
  }

  .window-content::-webkit-scrollbar-track {
    background: transparent;
    border: none;
  }

  .window-content::-webkit-scrollbar-button {
    display: none;
  }

  /* Touch improvements */
  .window-button:active,
  .start-button:active,
  .player-btn:active,
  .tab-btn:active,
  .connect-btn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
  }
}

/* Tablet responsive design */
@media screen and (min-width: 769px) and (max-width: 1024px) {
  /* Modern theme tablet overrides */

  /* Show text in modern theme on tablet */



  /* Modern theme tablet start menu overrides */

}

/* Extra small mobile devices */
@media screen and (max-width: 480px) {
  .desktop {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
    justify-items: center; /* center icons within their grid tracks */
  }

  /* Classic theme on very small screens: keep tiles centered */
  body:not(.modern-theme) .desktop {
    grid-template-columns: repeat(auto-fit, 120px) !important;
    justify-content: center !important;
    justify-items: center !important;
  }

  .icon {
    max-width: 120px;
    padding: 12px 8px;
  }

  body:not(.modern-theme) .icon {
    max-width: 120px !important;
  }

  body:not(.modern-theme) .desktop .icon span.icon-label {
    max-width: 100% !important;
  }

  .icon-image {
    width: 36px;
    height: 36px;
  }

  .icon-label {
    font-size: 11px;
  }

  .window-content {
    padding: 12px;
  }

  .notepad {
    font-size: 11px;
  }

  .start-menu {
    left: 4px;
    right: 4px;
  }

  .start-submenu {
    left: 4px;
    right: 4px;
  }
}

/* Landscape mobile orientation */
@media screen and (max-width: 768px) and (orientation: landscape) {
  .desktop {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    justify-items: center; /* center icons within their grid tracks */
  }

  .icon {
    max-width: 100px;
    padding: 8px 6px;
  }

  .icon-image {
    width: 32px;
    height: 32px;
  }

  .icon-label {
    font-size: 10px;
  }
}

/* ===== Music Player Styles ===== */
.music-player {
  padding: 15px;
}

/* Classic theme music player - traditional style */
.player-controls {
  background: #c0c0c0;
  border: 2px inset #c0c0c0;
  padding: 15px;
  margin-bottom: 15px;
}

/* Modern theme music player - glassmorphism style */

.now-playing-section {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

/* Classic theme album art - traditional style */
.album-art {
  width: 80px;
  height: 80px;
  border: 2px inset #c0c0c0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e0e0e0;
  overflow: hidden;
}

/* Modern theme album art - glassmorphism style */

.album-placeholder {
  font-size: 32px;
  color: white;
}

.track-info {
  flex: 1;
}

.track-title {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 6px;
  color: #2d3748;
}

.track-artist {
  color: #718096;
  font-size: 13px;
  font-weight: 500;
}

.player-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
}

/* Classic theme player buttons - Windows 95 style */
.player-btn {
  width: 32px;
  height: 32px;
  background: #c0c0c0;
  border: 2px outset #c0c0c0;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
}

.player-btn:active {
  border: 2px inset #c0c0c0;
}

/* Modern theme player buttons - glassmorphism style */


/* Modern theme hover effects only */

/* Classic theme play button - larger traditional button */
.play-btn {
  width: 40px;
  height: 40px;
  font-size: 18px;
  background: #c0c0c0;
  border: 2px outset #c0c0c0;
  color: #000;
}

.play-btn:active {
  border: 2px inset #c0c0c0;
}

/* Modern theme play button - glassmorphism style */



.connect-section {
  text-align: center;
}

/* Classic theme connect button - traditional Windows button */
.connect-btn {
  background: #c0c0c0;
  color: #000;
  border: 2px outset #c0c0c0;
  padding: 8px 16px;
  cursor: pointer;
  margin-bottom: 12px;
  font-size: 11px;
}

.connect-btn:active {
  border: 2px inset #c0c0c0;
}

/* Modern theme connect button - glassmorphism style */



.connection-status {
  font-size: 11px;
  color: #666;
}

.favorite-albums h3 {
  margin-bottom: 10px;
  padding-left: 5px;
}

.albums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.songs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

/* Classic theme album item - Windows 95 style */
.album-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #c0c0c0;
  border: 2px inset #c0c0c0;
  cursor: pointer;
  min-height: 60px;
}

.album-item:active {
  border: 2px outset #c0c0c0;
}

/* Modern theme album item - glassmorphism style */



/* Classic theme album cover - simple Windows style */
.album-cover {
  width: 50px;
  height: 50px;
  border: 2px inset #c0c0c0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #c0c0c0;
  font-size: 18px;
  color: #000;
  flex-shrink: 0;
}

/* Modern theme album cover - glassmorphism style */

/* Classic theme album name - Windows 95 typography */
.album-name {
  font-size: 12px;
  font-weight: normal;
  color: #000;
  line-height: 1.3;
}

/* Modern theme album name - modern typography */

/* Classic theme song item - Windows 95 style (matches album-item) */
.song-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #c0c0c0;
  border: 2px inset #c0c0c0;
  cursor: pointer;
  min-height: 60px;
}

.song-item:active {
  border: 2px outset #c0c0c0;
}

/* Modern theme song item - glassmorphism style (matches album-item) */



/* Classic theme song cover - simple Windows style (matches album-cover) */
.song-cover {
  width: 50px;
  height: 50px;
  border: 2px inset #c0c0c0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #c0c0c0;
  font-size: 18px;
  color: #000;
  flex-shrink: 0;
}

/* Modern theme song cover - glassmorphism style (matches album-cover) */

/* Classic theme song name - Windows 95 typography (matches album-name) */
.song-name {
  font-size: 12px;
  font-weight: normal;
  color: #000;
  line-height: 1.3;
}

/* Modern theme song name - modern typography (matches album-name) */

/* Song details container */
.song-details {
  flex: 1;
}

/* Classic theme song artist - Windows 95 typography */
.song-artist {
  font-size: 10px;
  color: #000;
  font-weight: normal;
  margin-bottom: 2px;
}

/* Modern theme song artist - modern typography */

/* Classic theme song description - Windows 95 typography */
.song-description {
  font-size: 9px;
  color: #000;
  font-weight: normal;
}

/* Modern theme song description - modern typography */

/* Song cover images - classic theme */
.song-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Modern theme song cover images */

/* ===== Library Styles ===== */
.library-content {
  padding: 10px;
}


/* Classic theme library tabs - Windows 95 tab style */
.library-tabs {
  display: flex;
  margin-bottom: 15px;
  gap: 0;
  background: #c0c0c0;
  border-bottom: 2px solid #808080;
  padding: 0;
}

/* Modern theme library tabs - glassmorphism style */

/* Classic theme tab buttons - Windows 95 tab style */
.tab-btn {
  padding: 6px 16px;
  background: #c0c0c0;
  border: 2px outset #c0c0c0;
  border-bottom: none;
  cursor: pointer;
  font-size: 11px;
  color: #000;
  margin-right: 2px;
}

.tab-btn.active {
  background: #c0c0c0;
  border: 2px inset #c0c0c0;
  border-bottom: 2px solid #c0c0c0;
  position: relative;
  z-index: 1;
}

.tab-btn:active {
  border: 2px inset #c0c0c0;
}

/* Modern theme tab buttons - glassmorphism style */




.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* Classic theme book item - Windows 95 style */
.book-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: #c0c0c0;
  border: 2px inset #c0c0c0;
  cursor: pointer;
  min-height: 80px;
}

.book-item:active {
  border: 2px outset #c0c0c0;
}

/* Modern theme book item - glassmorphism style */



/* Classic theme book cover - simple Windows style */
.book-cover {
  width: 60px;
  height: 75px;
  border: 2px inset #c0c0c0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #c0c0c0;
  font-size: 22px;
  flex-shrink: 0;
  overflow: hidden;
  color: #000;
}

/* Modern theme book cover - glassmorphism style */

.book-details {
  flex: 1;
}

/* Classic theme book details - Windows 95 typography */
.book-title {
  font-weight: normal;
  font-size: 12px;
  margin-bottom: 5px;
  line-height: 1.3;
  color: #000;
}

.book-author {
  color: #000;
  font-size: 11px;
  margin-bottom: 10px;
  font-weight: normal;
}

/* Modern theme book details - modern typography */


/* Classic theme book rating - simple Windows style */
.book-rating {
  color: #000;
  font-size: 11px;
  font-weight: normal;
}

/* Modern theme book rating - modern style */

/* Classic theme reading progress - compact spacing */
.reading-progress {
  margin-top: 10px;
}

/* Modern theme reading progress - modern spacing */

/* Classic theme progress bar - Windows 95 style */
.progress-bar {
  width: 100%;
  height: 6px;
  background: #808080;
  border: 1px inset #c0c0c0;
  margin-bottom: 5px;
  overflow: hidden;
}

/* Modern theme progress bar - modern style */

/* Classic theme progress fill - simple Windows style */
.progress-fill {
  height: 100%;
  background: #000080;
  transition: width 0.3s ease;
}

/* Modern theme progress fill - gradient style */

/* Classic theme progress text - Windows 95 typography */
.progress-text {
  font-size: 11px;
  color: #000;
  font-weight: normal;
}

/* Modern theme progress text - modern typography */

/* ===== Weather App Styles ===== */
.weather-app {
  padding: 12px;
  font-family: var(--font-body);
}

/* Weather header with location and refresh button */
.weather-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #808080;
}

/* Location info section */
.location-info {
  flex: 1;
}

.location-name {
  font-size: 13px;
  font-weight: bold;
  color: var(--window-text);
  margin-bottom: 2px;
}

.last-updated {
  font-size: 10px;
  color: #666;
}

/* Refresh button */
.refresh-btn {
  background: var(--btn-bg);
  border: 2px outset var(--btn-bg);
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font-body);
}

.refresh-btn:hover {
  background: #e0e0e0;
}

.refresh-btn:active {
  border: 2px inset var(--btn-bg);
  background: #a0a0a0;
}

/* Current weather main display */
.weather-main {
  text-align: center;
  margin-bottom: 12px;
}

.weather-icon {
  font-size: 48px;
  margin-bottom: 8px;
}

.temperature {
  font-size: 32px;
  font-weight: bold;
  color: var(--window-text);
  margin-bottom: 4px;
}

.weather-description {
  font-size: 12px;
  color: #666;
  text-transform: capitalize;
  margin-bottom: 8px;
}

/* Weather details grid */
.weather-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
  padding: 8px;
  background: #f0f0f0;
  border: 1px inset #c0c0c0;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}

.detail-label {
  color: #666;
}

.detail-value {
  font-weight: bold;
  color: var(--window-text);
}

/* Loading state */
.weather-loading {
  text-align: center;
  padding: 20px;
}

.loading-text {
  font-size: 12px;
  color: #666;
  margin-bottom: 8px;
}

.loading-spinner {
  font-size: 18px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Error state */
.weather-error {
  text-align: center;
  padding: 20px;
}

.error-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.error-text {
  font-size: 11px;
  color: #666;
  margin-bottom: 12px;
  line-height: 1.4;
}

.retry-btn {
  background: var(--btn-bg);
  border: 2px outset var(--btn-bg);
  padding: 6px 12px;
  font-size: 11px;
  cursor: pointer;
  font-family: var(--font-body);
}

.retry-btn:hover {
  background: #e0e0e0;
}

.retry-btn:active {
  border: 2px inset var(--btn-bg);
  background: #a0a0a0;
}

/* Demo note styling */
.weather-note {
  font-size: 10px;
  color: #666;
  margin-top: 8px;
  padding: 4px;
  background: #f0f0f0;
  border-radius: 3px;
  text-align: center;
  line-height: 1.3;
}

/* Modern theme weather styles */















/* Mobile weather adjustments */
@media (max-width: 768px) {
  .weather-details {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  
  .weather-icon {
    font-size: 36px;
  }
  
  .temperature {
    font-size: 24px;
  }
}

/* ===== Responsive Utilities ===== */
.mobile-only {
  display: none;
}

.desktop-only {
  display: block;
}

@media screen and (max-width: 768px) {
  .mobile-only {
    display: block;
  }
  
  .desktop-only {
    display: none;
  }
}

/* ===== TV Remote Theme Switcher ===== */
.tv-remote {
  position: fixed;
  bottom: 60px;
  right: 20px;
  z-index: 1000;
  cursor: pointer;
  user-select: none;
  transition: all 0.3s ease;
}

.tv-remote:hover {
  transform: translateY(-2px);
}

.remote-body {
  width: 60px;
  height: 140px;
  background: linear-gradient(145deg, #2d3748, #1a202c);
  border-radius: 8px;
  border: 2px solid #4a5568;
  box-shadow: 
    0 6px 20px rgba(0, 0, 0, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.1),
    inset 0 -2px 0 rgba(0, 0, 0, 0.2);
  padding: 8px;
  position: relative;
}

.remote-screen {
  width: 100%;
  height: 20px;
  background: #000;
  border-radius: 4px;
  border: 1px inset #333;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.channel-display {
  color: #00ff00;
  font-family: 'Courier New', monospace;
  font-size: 10px;
  font-weight: bold;
  text-shadow: 0 0 3px #00ff00;
}

.remote-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.power-btn {
  width: 100%;
  height: 20px;
  background: linear-gradient(145deg, #e53e3e, #c53030);
  border-radius: 10px;
  border: 1px solid #742a2a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.channel-btns {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ch-up, .ch-down {
  width: 100%;
  height: 15px;
  background: linear-gradient(145deg, #4a5568, #2d3748);
  border-radius: 4px;
  border: 1px solid #718096;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: white;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.remote-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  margin-top: 4px;
}

.remote-btn {
  width: 100%;
  height: 12px;
  background: linear-gradient(145deg, #4a5568, #2d3748);
  border-radius: 2px;
  border: 1px solid #718096;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  color: white;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.remote-label {
  text-align: center;
  margin-top: 6px;
  color: white;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  font-size: 9px;
  font-weight: bold;
}

/* Modern theme styling for remote */




/* Remote button hover effects */
.tv-remote:hover .power-btn {
  background: linear-gradient(145deg, #f56565, #e53e3e);
  box-shadow: 0 0 10px rgba(229, 62, 62, 0.4);
}

.tv-remote:hover .ch-up,
.tv-remote:hover .ch-down,
.tv-remote:hover .remote-btn {
  background: linear-gradient(145deg, #718096, #4a5568);
}

/* Channel switching animation */
.channel-display.switching {
  animation: channelSwitch 0.8s ease-in-out;
}

@keyframes channelSwitch {
  0%, 100% { opacity: 1; transform: scale(1); }
  20% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 0.1; transform: scale(1.2); color: #ff6b6b; }
  80% { opacity: 0.7; transform: scale(0.9); }
}

/* Mobile responsive */
@media screen and (max-width: 768px) {
  .tv-remote {
    bottom: 70px;
    right: 15px;
    transform: scale(0.9);
  }
  
}

/* ===== Channel Switching Overlay ===== */
.channel-switch-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  z-index: 2147483649; /* above taskbar */
  display: flex;              /* always in flow; control via opacity */
  align-items: center;
  justify-content: center;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 300ms ease, visibility 300ms ease;
}

.channel-switch-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  animation: channelSwitchFade 1.2s ease-in-out;
}

.tv-static {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(255, 255, 255, 0.03) 2px,
      rgba(255, 255, 255, 0.03) 4px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 2px,
      rgba(255, 255, 255, 0.03) 2px,
      rgba(255, 255, 255, 0.03) 4px
    );
  opacity: 0;
  animation: staticNoise 0.1s infinite;
}

.channel-switch-overlay.active .tv-static {
  animation: staticNoise 0.05s infinite, staticFade 1.2s ease-in-out;
}

.channel-info {
  text-align: center;
  color: white;
  z-index: 2;
  transform: scale(0);
  animation: channelInfoPop 1.2s ease-out 0.3s forwards;
}

.channel-number {
  font-family: 'Courier New', monospace;
  font-size: 120px;
  font-weight: bold;
  margin-bottom: 20px;
  text-shadow: 
    0 0 20px #fff,
    0 0 40px #fff,
    0 0 60px #fff;
  opacity: 0;
  animation: channelFlicker 1.2s ease-out 0.2s forwards;
}

.channel-name {
  font-family: 'Courier New', monospace;
  font-size: 32px;
  font-weight: bold;
  letter-spacing: 8px;
  margin-bottom: 40px;
  opacity: 0;
  animation: channelNameSlide 1.2s ease-out 0.5s forwards;
}

.tv-bars {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 30px;
  opacity: 0;
  animation: tvBarsAppear 1.2s ease-out 0.7s forwards;
}

.color-bar {
  width: 60px;
  height: 40px;
  margin: 0 2px;
}

.color-bar.red { background: #ff0000; }
.color-bar.yellow { background: #ffff00; }
.color-bar.green { background: #00ff00; }
.color-bar.cyan { background: #00ffff; }
.color-bar.blue { background: #0000ff; }
.color-bar.magenta { background: #ff00ff; }

/* Channel Switch Animations */
@keyframes channelSwitchFade {
  0% { opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes staticNoise {
  0% { 
    opacity: 0.8;
    background-position: 0px 0px, 0px 0px;
  }
  25% { 
    opacity: 0.4;
    background-position: 1px 1px, -1px 0px;
  }
  50% { 
    opacity: 0.9;
    background-position: -1px 1px, 1px -1px;
  }
  75% { 
    opacity: 0.3;
    background-position: 0px -1px, -1px 1px;
  }
  100% { 
    opacity: 0.6;
    background-position: 1px 0px, 0px -1px;
  }
}

@keyframes staticFade {
  0% { opacity: 0.8; }
  30% { opacity: 1; }
  70% { opacity: 0.6; }
  100% { opacity: 0; }
}

@keyframes channelInfoPop {
  0% { 
    transform: scale(0);
    opacity: 0;
  }
  60% { 
    transform: scale(1.1);
    opacity: 0.8;
  }
  100% { 
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes channelFlicker {
  0% { 
    opacity: 0;
    text-shadow: none;
  }
  20% { 
    opacity: 0.3;
    text-shadow: 0 0 10px #fff;
  }
  40% { 
    opacity: 0.1;
    text-shadow: 0 0 5px #fff;
  }
  60% { 
    opacity: 0.7;
    text-shadow: 0 0 30px #fff, 0 0 50px #fff;
  }
  80% { 
    opacity: 0.4;
    text-shadow: 0 0 15px #fff;
  }
  100% { 
    opacity: 1;
    text-shadow: 
      0 0 20px #fff,
      0 0 40px #fff,
      0 0 60px #fff;
  }
}

@keyframes channelNameSlide {
  0% { 
    opacity: 0;
    transform: translateY(30px);
    letter-spacing: 2px;
  }
  100% { 
    opacity: 1;
    transform: translateY(0);
    letter-spacing: 8px;
  }
}

@keyframes tvBarsAppear {
  0% { 
    opacity: 0;
    transform: scaleY(0);
  }
  100% { 
    opacity: 1;
    transform: scaleY(1);
  }
}

/* Mobile responsive for overlay */
@media screen and (max-width: 768px) {
  .channel-switch-overlay {
    width: 100vw;
    height: 100vh;
    /* Ensure overlay is above everything on mobile */
    z-index: 2147483649;
  }
  
  .channel-info {
    padding: 20px;
  }
  
  .channel-number {
    font-size: 80px;
  }
  
  .channel-name {
    font-size: 20px;
    letter-spacing: 4px;
  }
  
  .color-bar {
    width: 40px;
    height: 30px;
  }
  
  /* Use dynamic viewport units for mobile when supported */
  @supports (height: 100dvh) {
    .channel-switch-overlay {
      height: 100dvh;
    }
  }
}

/* ===================================================
   WINDOWS 7 AERO THEME OVERRIDES
   Surgical improvements to match authentic Win7 Aero
   ================================================== */

/* === Win7 Aero variables === */
:root {
  --aero-base: rgba(20, 32, 48, 0.72);      /* deep cool blue-gray glass */
  --aero-tint: rgba(64, 140, 220, 0.18);    /* cyan tint wash */
  --aero-glow: rgba(120, 200, 255, 0.55);   /* cyan bloom for hovers/active */
  --aero-top-line: rgba(255,255,255,0.65);  /* 1px top highlight */
  --aero-inner: rgba(255,255,255,0.22);     /* subtle inner gloss */
  --aero-sep-light: rgba(255,255,255,0.35);
  --aero-sep-dark: rgba(0,0,0,0.22);
  --text-on-glass: #fff;
  --shadow-on-glass: rgba(0,0,0,0.6);
  --win7-green: #33aa33;                    /* task progress */
}

/* --- Taskbar: deeper, bluer, less "milky" --- */

/* Remove big glossy cap; Win7 glass is subtler */

/* --- Task button: glassy, no lift; separators --- */




/* Vertical separators between groups */

/* Optional: Win7-style green progress overlay */

/* --- Start orb: stronger rim & cyan glow, no scale --- */

/* --- Start menu: two-pane look with divider glow --- */


/* --- Clock: no glossy pill; just text with subtle shadow --- */

/* --- Desktop icon selection: pale azure fill + glow, no stroke --- */


/* --- Tone down general motion (Win7 is calmer) --- */

/* ===================================================
   EMAIL CLIENT STYLES
   Classic Outlook Express interface
   ================================================== */

.email-client {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 11px;
}

/* Email Toolbar */
.email-toolbar {
  background: linear-gradient(180deg, #f0f0f0 0%, #d8d8d8 100%);
  border-bottom: 1px solid #c0c0c0;
  padding: 4px 8px;
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.toolbar-btn {
  background: linear-gradient(180deg, #f5f5f5 0%, #e5e5e5 100%);
  border: 1px solid #a0a0a0;
  border-radius: 2px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: not-allowed;
  color: #666;
}

.toolbar-btn:hover:not([disabled]) {
  background: linear-gradient(180deg, #f8f8f8 0%, #e8e8e8 100%);
}

/* Email Layout */
.email-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Email Sidebar */
.email-sidebar {
  width: 180px;
  background: #f8f8f8;
  border-right: 1px solid #c0c0c0;
  flex-shrink: 0;
  overflow-y: auto;
}

.folder-tree {
  padding: 8px;
}

.folder-item {
  padding: 3px 8px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 11px;
  user-select: none;
}

.folder-item:hover {
  background: #e3f2fd;
}

.folder-item.selected {
  background: #1976d2;
  color: white;
}

.folder-indent {
  margin-left: 16px;
}

/* Email Main Area */
.email-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Email List */
.email-list {
  height: 140px;
  border-bottom: 1px solid #c0c0c0;
  overflow-y: auto;
  background: white;
  flex-shrink: 0;
}

.email-header {
  background: linear-gradient(180deg, #f0f0f0 0%, #d8d8d8 100%);
  border-bottom: 1px solid #c0c0c0;
  display: grid;
  grid-template-columns: 120px 1fr 80px;
  padding: 4px;
  font-weight: bold;
  font-size: 11px;
  position: sticky;
  top: 0;
}

.email-item {
  display: grid;
  grid-template-columns: 120px 1fr 80px;
  padding: 4px;
  border-bottom: 1px solid #eeeeee;
  cursor: pointer;
  font-size: 11px;
}

.email-item:hover {
  background: #f0f8ff;
}

.email-item.selected {
  background: #1976d2;
  color: white;
}

.email-item.unread {
  font-weight: bold;
}

.unread-icon {
  color: #1976d2;
  font-size: 8px;
  margin-right: 4px;
}

.email-item.selected .unread-icon {
  color: white;
}

.email-col-from,
.email-col-subject,
.email-col-received {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 8px;
}

/* Email Preview */
.email-preview {
  flex: 1;
  background: white;
  overflow-y: auto;
  padding: 0;
}

.email-preview-header {
  background: #f8f8f8;
  border-bottom: 1px solid #e0e0e0;
  padding: 12px 16px;
  font-size: 11px;
  line-height: 1.4;
}

.email-preview-header > div {
  margin-bottom: 3px;
}

.email-preview-body {
  padding: 16px;
  line-height: 1.6;
  font-size: 12px;
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
}

.email-preview-body h3 {
  color: #1976d2;
  font-size: 16px;
  margin: 0 0 12px 0;
  font-weight: 600;
}

.email-preview-body h4 {
  color: #333;
  font-size: 13px;
  margin: 16px 0 8px 0;
  font-weight: 600;
}

.email-preview-body p {
  margin: 0 0 12px 0;
  color: #333;
}

.email-preview-body ul {
  margin: 0 0 12px 0;
  padding-left: 20px;
}

.email-preview-body li {
  margin-bottom: 6px;
  color: #333;
}

.email-preview-body strong {
  color: #1976d2;
  font-weight: 600;
}

.email-preview-body hr {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 16px 0;
}

/* Modern theme email adjustments */








/* ===================================================
   PERFORMANCE OPTIMIZATIONS
   Quick improvements for better rendering performance
   ================================================== */

/* Optimize transitions to only animate necessary properties */
.window, .taskbar, .start-menu {
  transition-property: transform, opacity;
  transition-timing-function: cubic-bezier(0.23, 1, 0.32, 1);
}

/* Optimize icon hover effects */
.icon:hover {
  transition-duration: 0.15s;
  transition-property: transform;
}

/* Optimize task button animations */
.task-button {
  transition-property: background-color, transform, box-shadow;
  transition-duration: 0.12s;
}

/* Reduce reflows with efficient transforms */
@media (hover: hover) {
  .window-button:hover,
  .start-button:hover {
    transform: translate3d(0, -1px, 0) scale(1.02);
  }
}

/* Performance-first media query for reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .window {
    will-change: auto;
  }

}

/* Optimize scrolling performance */
.window-content {
  contain: layout style;
  overflow-anchor: none;
}

/* GPU acceleration for frequently animated elements */
.boot-icon,
.minesweeper-cell,
.album-cover,
.book-cover {
  transform: translate3d(0, 0, 0);
  will-change: auto;
}
