/* ============================================================
   main.css — Foundation styles for Melanie OS-themed personal site
   All theme-specific visual overrides go in winme.css / winvista.css / win8.css.
   ============================================================ */

/* ===========================================
   1. CSS RESET / NORMALIZE
   =========================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background: #000;
  color: #fff;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: normal;
  font-size: inherit;
}

ul, ol {
  list-style: none;
}

a {
  text-decoration: none;
  color: inherit;
}

img, svg {
  display: block;
  max-width: 100%;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

button {
  cursor: pointer;
}

/* WCAG: Visible focus outline for keyboard navigation only */
:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px #000; /* High contrast inner/outer */
  border-radius: 2px;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* ===========================================
   2. UTILITY CLASSES
   =========================================== */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.no-select {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.no-drag {
  -webkit-user-drag: none;
  user-select: none;
}

/* ===========================================
   3. BOOTLOADER STYLES
   =========================================== */

/* --- Bootloader container --- */
#bootloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  background: #000;
}

/* --- Generic boot phase --- */
.boot-phase {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ----- 3a. BIOS POST Screen ----- */
#bios-screen {
  align-items: flex-start;
  justify-content: flex-start;
  padding: 30px 40px;
  background: #000;
}

#bios-text {
  font-family: 'Courier New', 'Lucida Console', monospace;
  font-size: 14px;
  line-height: 1.6;
  color: #33ff33;
  white-space: pre-wrap;
  text-shadow: 0 0 4px rgba(51, 255, 51, 0.5);
}

#bios-text .bios-line {
  display: block;
  opacity: 0;
  animation: biosLineAppear 0.05s forwards;
}

@keyframes biosLineAppear {
  to { opacity: 1; }
}

/* Cursor blink at the end of BIOS text */
#bios-text::after {
  content: '█';
  animation: biosCursorBlink 0.5s step-end infinite;
}

@keyframes biosCursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ----- 3b. Boot Menu ----- */
#boot-menu {
  background: #000;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.boot-menu-frame {
  width: 100%;
  max-width: 700px;
  padding: 0 20px;
}

.boot-menu-header {
  font-family: 'Segoe UI', Tahoma, sans-serif;
  font-size: 18px;
  color: #fff;
  margin-bottom: 6px;
  font-weight: normal;
  letter-spacing: 0.02em;
}

.boot-menu-rule {
  width: 100%;
  height: 1px;
  background: #808080;
  margin-bottom: 16px;
}

.boot-menu-subheader {
  font-family: 'Segoe UI', Tahoma, sans-serif;
  font-size: 14px;
  color: #bbb;
  margin-bottom: 16px;
}

.boot-menu-divider {
  width: 100%;
  height: 1px;
  background: #404040;
  margin: 16px 0;
}

.boot-options {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.boot-option {
  font-family: 'Segoe UI', Tahoma, sans-serif;
  font-size: 14px;
  color: #ccc;
  padding: 6px 12px;
  cursor: pointer;
  outline: none;
  border: 1px solid transparent;
  transition: none;
}

.boot-option:hover {
  background: #0050a0;
  color: #fff;
}

.boot-option.selected {
  background: #0050a0;
  color: #fff;
  border-color: #77aadd;
}

.boot-option:focus-visible {
  border-color: #77aadd;
}

.boot-menu-footer {
  font-family: 'Segoe UI', Tahoma, sans-serif;
  font-size: 12px;
  color: #999;
  line-height: 1.6;
}

.boot-menu-footer kbd {
  display: inline-block;
  padding: 1px 5px;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  font-size: 11px;
  background: #333;
  border: 1px solid #555;
  border-radius: 2px;
  color: #ddd;
}

.boot-about-btn {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #333;
  color: #fff;
  border: 1px solid #555;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  font-size: 18px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 10001;
}

.boot-about-btn:hover {
  background: #555;
  border-color: #777;
}

.boot-modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10002;
}

.boot-modal.hidden {
  display: none !important;
}

.boot-modal-content {
  background: #111;
  border: 1px solid #444;
  width: 90%;
  max-width: 600px;
  max-height: 80%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.boot-modal-header {
  padding: 12px 16px;
  border-bottom: 1px solid #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1a1a1a;
}

.boot-modal-header h2 {
  font-family: 'Segoe UI', Tahoma, sans-serif;
  font-size: 16px;
  color: #fff;
  margin: 0;
}

.boot-modal-close {
  background: transparent;
  border: none;
  color: #aaa;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.boot-modal-close:hover {
  color: #fff;
}

.boot-modal-body {
  padding: 20px;
  overflow-y: auto;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #ccc;
  flex: 1;
}

.boot-modal-footer {
  padding: 12px 16px;
  border-top: 1px solid #333;
  background: #1a1a1a;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  font-size: 11px;
  color: #888;
  line-height: 1.4;
  text-align: center;
}

/* ----- 3c. OS Loading Screens (shared) ----- */
#os-loading {
  background: #000;
}

.loading-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: #000;
}

/* ----- 3c-i. Melanie OS ME Loading ----- */
.loading-winme {
  background: #000;
}

.winme-boot-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin-bottom: 40px;
}

.winme-boot-flower {
  width: 80px;
  height: 80px;
  transform: perspective(200px) rotateY(-10deg) skewY(-3deg);
}

.winme-boot-text {
  text-align: center;
  font-family: 'Segoe UI', Arial, sans-serif;
  color: #fff;
}

.winme-ms {
  font-size: 13px;
  letter-spacing: 0.1em;
  color: #ccc;
}

.winme-edition {
  font-size: 28px;
  font-weight: bold;
  letter-spacing: 0.02em;
}

.winme-me {
  font-style: italic;
  color: #4dabf5;
}

.winme-loading-bar {
  width: 220px;
  height: 18px;
  background: #000;
  border: 1px solid #444;
  overflow: hidden;
  position: relative;
}

.winme-loading-fill {
  position: absolute;
  top: 2px;
  left: 2px;
  bottom: 2px;
  width: 0;
  display: flex;
  gap: 2px;
  animation: winmeBarFill 2.5s linear forwards;
}

.winme-loading-fill::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    90deg,
    #0060d0 0px,
    #0060d0 10px,
    transparent 10px,
    transparent 13px
  );
  animation: winmeBarScroll 2.5s linear forwards;
}

@keyframes winmeBarFill {
  0%   { width: 0; }
  100% { width: calc(100% - 4px); }
}

@keyframes winmeBarScroll {
  0%   { transform: translateX(-13px); }
  100% { transform: translateX(0); }
}

/* ----- 3c-ii. Melanie OS Vista Loading ----- */
.loading-winvista {
  background: #000;
}

.vista-boot-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.vista-boot-orb {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(ellipse at 40% 35%, #5bb2f0 0%, #2070c0 40%, #0a3a7a 80%, #041830 100%);
  position: relative;
  box-shadow:
    0 0 30px rgba(80, 160, 255, 0.6),
    0 0 60px rgba(80, 160, 255, 0.3);
  animation: vistaOrbPulse 2s ease-in-out infinite;
}

.vista-orb-glow {
  position: absolute;
  top: 10%;
  left: 18%;
  width: 55%;
  height: 35%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.6) 0%, transparent 70%);
}

.vista-boot-flower {
  position: absolute;
  width: 32px;
  height: 32px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  opacity: 0.85;
}

@keyframes vistaOrbPulse {
  0%, 100% { box-shadow: 0 0 30px rgba(80,160,255,0.6), 0 0 60px rgba(80,160,255,0.3); }
  50%      { box-shadow: 0 0 40px rgba(80,160,255,0.8), 0 0 80px rgba(80,160,255,0.4); }
}

.vista-boot-text {
  font-family: 'Segoe UI', sans-serif;
  font-size: 14px;
  color: #bbb;
  letter-spacing: 0.04em;
}

.vista-loading-bar {
  width: 250px;
  height: 16px;
  background: #111;
  border: 1px solid #333;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.vista-loading-fill {
  position: absolute;
  top: 2px;
  left: 2px;
  bottom: 2px;
  width: 0;
  border-radius: 6px;
  background: linear-gradient(180deg, #6dde6d 0%, #3cb43c 40%, #2a8f2a 100%);
  box-shadow: 0 0 6px rgba(60, 180, 60, 0.6);
  animation: vistaBarFill 2.5s ease-out forwards;
  overflow: hidden;
}

.vista-loading-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: vistaBarShine 1s ease-in-out infinite;
}

@keyframes vistaBarFill {
  0%   { width: 0; }
  100% { width: calc(100% - 4px); }
}

@keyframes vistaBarShine {
  0%   { left: -50%; }
  100% { left: 150%; }
}

.vista-boot-copyright {
  font-family: 'Segoe UI', sans-serif;
  font-size: 11px;
  color: #555;
}

/* ----- 3c-iii. Melanie OS 8 Loading ----- */
.loading-win8 {
  background: #000;
}

.win8-boot-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

.win8-boot-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.win8-boot-flower {
  width: 88px;
  height: 88px;
}

/* Circling dots animation */
.win8-boot-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  position: relative;
}

.win8-boot-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
  animation: win8DotCircle 1.8s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.win8-boot-dot:nth-child(1) { animation-delay: 0s; }
.win8-boot-dot:nth-child(2) { animation-delay: -0.15s; }
.win8-boot-dot:nth-child(3) { animation-delay: -0.3s; }
.win8-boot-dot:nth-child(4) { animation-delay: -0.45s; }
.win8-boot-dot:nth-child(5) { animation-delay: -0.6s; }

@keyframes win8DotCircle {
  0% {
    transform: translate(0, -24px);
    opacity: 1;
  }
  20% {
    transform: translate(22.8px, -7.4px);
    opacity: 1;
  }
  40% {
    transform: translate(14.1px, 19.4px);
    opacity: 1;
  }
  60% {
    transform: translate(-14.1px, 19.4px);
    opacity: 1;
  }
  80% {
    transform: translate(-22.8px, -7.4px);
    opacity: 0.6;
  }
  100% {
    transform: translate(0, -24px);
    opacity: 1;
  }
}

/* ===========================================
   4. DESKTOP BASE
   =========================================== */
.desktop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
  background-color: #008080; /* fallback teal */
}

/* ===========================================
   5. WINDOW MANAGER BASE
   =========================================== */
.window {
  position: absolute;
  display: none; /* opened via JS */
  flex-direction: column;
  min-width: 300px;
  min-height: 200px;
  z-index: 100;
  box-shadow:
    2px 2px 10px rgba(0, 0, 0, 0.4),
    0 0 1px rgba(0, 0, 0, 0.2);
  background: #f0f0f0;
  user-select: none;
}

.window.focused {
  box-shadow:
    3px 3px 14px rgba(0, 0, 0, 0.5),
    0 0 2px rgba(0, 0, 0, 0.3);
}

/* Title bar */
.title-bar {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-shrink: 0;
  padding: 3px 4px;
  cursor: default;
  user-select: none;
  gap: 4px;
}

.title-bar-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
}

.title-bar-icon img {
  width: 16px;
  height: 16px;
}

.title-bar-text {
  flex: 1;
  font-size: 12px;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.title-bar-controls {
  display: flex;
  flex-shrink: 0;
  gap: 2px;
  align-items: center;
}

.title-bar-controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  outline: none;
  font-size: 10px;
  line-height: 1;
  width: 20px;
  height: 20px;
}

/* Window body */
.window-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* Window content (scrollable area) */
.window-content {
  flex: 1;
  overflow: auto;
  position: relative;
  min-height: 0;
  user-select: text;
}

/* Menu bar */
.menu-bar {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-shrink: 0;
  padding: 2px 4px;
  gap: 2px;
  font-size: 12px;
}

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

.menu-item:hover {
  background: rgba(0, 0, 0, 0.08);
}

/* Toolbar */
.toolbar {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-shrink: 0;
  padding: 2px 4px;
  gap: 2px;
  font-size: 12px;
}

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  cursor: pointer;
  font-size: 12px;
}

.toolbar-btn:hover {
  background: rgba(0, 0, 0, 0.08);
}

/* Resize handle */
.window .resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 14px;
  height: 14px;
  cursor: nwse-resize;
  z-index: 10;
}

.window .resize-handle::after {
  content: '';
  position: absolute;
  bottom: 3px;
  right: 3px;
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(0, 0, 0, 0.3);
  border-bottom: 2px solid rgba(0, 0, 0, 0.3);
}

/* ===========================================
   6. TASKBAR BASE
   =========================================== */
.taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 9000;
  display: flex;
  flex-direction: row;
  align-items: center;
  height: 36px;
  user-select: none;
}

/* Start button */
.start-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  height: 100%;
  cursor: pointer;
  white-space: nowrap;
  font-size: 13px;
  font-weight: bold;
  flex-shrink: 0;
}

/* Quick launch area */
.quick-launch {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px;
  flex-shrink: 0;
}

/* Taskbar programs area */
.taskbar-programs {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex: 1;
  min-width: 0;
  gap: 2px;
  padding: 0 4px;
  overflow: hidden;
}

.taskbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  height: 26px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
  flex-shrink: 0;
}

.taskbar-btn.active {
  font-weight: bold;
}

/* System tray */
.system-tray {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  flex-shrink: 0;
  height: 100%;
}

.tray-icons {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}

.tray-clock {
  font-size: 12px;
  white-space: nowrap;
}

/* ===========================================
   7. START MENU BASE
   =========================================== */
.start-menu {
  position: fixed;
  bottom: 36px; /* sits above the taskbar */
  left: 0;
  z-index: 9001;
  display: none; /* toggled by JS */
  flex-direction: column;
  min-width: 200px;
  max-height: calc(100vh - 50px);
  overflow-y: auto;
  user-select: none;
}

.start-menu-items {
  display: flex;
  flex-direction: column;
}

.start-menu-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}

.start-menu-item:hover {
  background: rgba(0, 0, 0, 0.1);
}

.start-menu-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
  line-height: 1;
}

.start-menu-icon img {
  width: 24px;
  height: 24px;
}

.start-menu-separator {
  height: 1px;
  margin: 4px 12px;
  background: rgba(0, 0, 0, 0.15);
}

/* ===========================================
   8. DESKTOP ICONS BASE
   =========================================== */
.desktop-icons {
  display: grid;
  grid-template-columns: repeat(auto-fill, 80px);
  grid-auto-rows: 90px;
  gap: 6px;
  padding: 10px;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
  align-content: start;
}

.desktop-icon {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  cursor: pointer;
  padding: 6px 4px;
  border-radius: 3px;
  border: 1px solid transparent;
  text-align: center;
  user-select: none;
  outline: none;
  width: 80px;
}

.desktop-icon:hover,
.desktop-icon:focus {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}

.desktop-icon.selected {
  background: rgba(0, 100, 200, 0.3);
  border-color: rgba(0, 100, 200, 0.6);
}

.icon-img {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  font-size: 28px;
  line-height: 1;
}

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

.icon-label {
  font-size: 11px;
  line-height: 1.3;
  word-break: break-word;
  max-width: 70px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
  color: #fff;
}

/* ===========================================
   9. METRO (MELANIE OS 8) BASE
   =========================================== */

/* Start screen */
.metro-start-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.metro-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  flex-shrink: 0;
}

.metro-title {
  font-family: 'Segoe UI Light', 'Segoe UI', sans-serif;
  font-size: 28px;
  font-weight: 200;
  letter-spacing: 0.03em;
}

.metro-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.metro-username {
  font-size: 14px;
}

.metro-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #555;
}

/* Tiles container */
.metro-tiles-container {
  display: flex;
  flex-direction: row;
  gap: 30px;
  padding: 10px 80px 60px 80px;
  overflow-x: auto;
  flex: 1;
  align-items: flex-start;
}

.metro-tile-group {
  flex-shrink: 0;
}

.tile-group-label {
  font-family: 'Segoe UI', sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-transform: none;
  margin-bottom: 10px;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.8);
}

.tile-group-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, 150px);
  grid-auto-rows: 150px;
  gap: 4px;
  align-items: start;
}

/* Tile base */
.metro-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  padding: 8px;
  transition: transform 0.1s ease;
  user-select: none;
}

.metro-tile:hover {
  transform: scale(1.02);
  filter: brightness(1.08);
}

.metro-tile:active {
  transform: scale(0.97);
}

/* Tile sizes */
.metro-tile.tile-small {
  width: 70px;
  height: 70px;
  grid-column: span 1;
  grid-row: span 1;
}

.metro-tile.tile-medium {
  width: 150px;
  height: 150px;
  grid-column: span 1;
  grid-row: span 1;
}

.metro-tile.tile-wide {
  width: 310px;
  height: 150px;
  grid-column: span 2;
  grid-row: span 1;
}

.metro-tile.tile-large {
  width: 310px;
  height: 310px;
  grid-column: span 2;
  grid-row: span 2;
}

/* Tile colors */
.metro-tile[data-color="blue"]   { background-color: #2d89ef; }
.metro-tile[data-color="green"]  { background-color: #00a300; }
.metro-tile[data-color="purple"] { background-color: #7b4f9d; }
.metro-tile[data-color="orange"] { background-color: #da532c; }
.metro-tile[data-color="red"]    { background-color: #ee1111; }
.metro-tile[data-color="teal"]   { background-color: #00aba9; }
.metro-tile[data-color="dark"]   { background-color: #2b5797; }

.tile-icon {
  font-size: 36px;
  line-height: 1;
  margin-bottom: 8px;
}

.tile-label {
  font-family: 'Segoe UI', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  position: absolute;
  bottom: 6px;
  left: 8px;
}

/* Metro app (full-screen overlay) */
.metro-app {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none; /* shown by JS */
  flex-direction: column;
  z-index: 500;
  background: #1a1a1a;
  color: #fff;
}

.app-titlebar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  flex-shrink: 0;
}

.app-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #fff;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: background 0.15s;
  color: #fff;
  background: transparent;
}

.app-back-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.app-title {
  font-family: 'Segoe UI Light', 'Segoe UI', sans-serif;
  font-size: 22px;
  font-weight: 200;
}

.app-content {
  flex: 1;
  overflow-y: auto;
  padding: 0 24px 24px;
}

/* Charms bar */
.charms-bar {
  position: fixed;
  top: 0;
  right: 0;
  width: 80px;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: none; /* toggled by JS */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 9500;
  backdrop-filter: blur(10px);
}

.charm {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  cursor: pointer;
  font-size: 11px;
  text-align: center;
  line-height: 1.3;
  color: #fff;
  border-radius: 2px;
  transition: background 0.15s;
}

.charm:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ===========================================
   10. STATUS BAR BASE
   =========================================== */
.status-bar {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-shrink: 0;
  padding: 2px 6px;
  gap: 8px;
  font-size: 12px;
  min-height: 22px;
}

.status-field {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===========================================
   11. CONTACT FORM BASE
   =========================================== */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
}

.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
  padding: 6px 8px;
  font-size: 13px;
  border: 1px solid #999;
  background: #fff;
  color: #000;
  resize: vertical;
}

.contact-form textarea {
  min-height: 80px;
}

.contact-form .form-submit-btn {
  align-self: flex-start;
  padding: 6px 20px;
  font-size: 13px;
  cursor: pointer;
}

/* ===========================================
   12. MESSAGE BOX (DIALOG) BASE
   =========================================== */
.msg-box-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.msg-box {
  min-width: 320px;
  max-width: 450px;
  background: #f0f0f0;
  box-shadow: 3px 3px 15px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  border: 1px solid #888;
}

.msg-box .title-bar {
  display: flex;
  align-items: center;
  padding: 6px 8px;
}

.msg-box-body {
  display: flex;
  flex-direction: row;
  padding: 20px 16px;
  gap: 14px;
  align-items: flex-start;
}

.msg-box-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.msg-box-text {
  font-size: 13px;
  line-height: 1.5;
  color: #222;
}

.msg-box-buttons {
  display: flex;
  justify-content: flex-end;
  padding: 8px 12px 12px;
  gap: 8px;
}

.msg-box-btn {
  padding: 5px 24px;
  font-size: 13px;
  cursor: pointer;
  background: #e0e0e0;
  border: 1px solid #aaa;
}

.msg-box-btn:hover {
  background: #d0d0d0;
}

/* ===========================================
   13. TOAST NOTIFICATION BASE (Win8 style)
   =========================================== */
.toast-notification {
  position: fixed;
  top: 10px;
  right: 10px;
  min-width: 280px;
  max-width: 380px;
  padding: 14px 18px;
  background: #1a1a1a;
  color: #fff;
  font-size: 13px;
  z-index: 11000;
  opacity: 0;
  transform: translateX(100%);
  transition: transform 0.3s ease, opacity 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.toast-notification.show {
  opacity: 1;
  transform: translateX(0);
}

.toast-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.toast-message {
  font-size: 12px;
  color: #ccc;
}

/* ===========================================
   14. SCROLLBAR STYLING
   =========================================== */
.window-content::-webkit-scrollbar,
.metro-start-screen::-webkit-scrollbar,
.app-content::-webkit-scrollbar {
  width: 16px;
  height: 16px;
}

.window-content::-webkit-scrollbar-track,
.metro-start-screen::-webkit-scrollbar-track,
.app-content::-webkit-scrollbar-track {
  background: #eee;
}

.window-content::-webkit-scrollbar-thumb,
.metro-start-screen::-webkit-scrollbar-thumb,
.app-content::-webkit-scrollbar-thumb {
  background: #c0c0c0;
  border: 1px solid #999;
}

.window-content::-webkit-scrollbar-thumb:hover,
.metro-start-screen::-webkit-scrollbar-thumb:hover,
.app-content::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}

/* ===========================================
   15. LOADING SPINNER (form submission)
   =========================================== */
.form-loading-indicator {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0, 0, 0, 0.15);
  border-top-color: #333;
  border-radius: 50%;
  animation: spinnerRotate 0.6s linear infinite;
  vertical-align: middle;
  margin-left: 8px;
}

@keyframes spinnerRotate {
  to { transform: rotate(360deg); }
}

/* ===========================================
   16. ALTCHA WIDGET — CSS RESET FIXES
   =========================================== */
/* ALTCHA renders in the light DOM (no shadow DOM), so the global input
   reset (appearance:none, border:none, background:none) wipes the native
   checkbox. Restore browser-native rendering for inputs inside the widget. */
altcha-widget {
  color: CanvasText;
}

altcha-widget input {
  appearance: auto;
  -webkit-appearance: auto;
  border: revert;
  background: revert;
  outline: revert;
}

/* ===========================================
   17. GLOBAL TRANSITIONS
   =========================================== */
.boot-phase {
  transition: opacity 0.3s ease;
}

.boot-phase.fade-out {
  opacity: 0;
}

/* ===========================================
   17. DESKTOP CONTEXT MENU
   =========================================== */
#desktop-context-menu {
  position: fixed;
  z-index: 10000;
  display: none;
  min-width: 150px;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* --- WinME Style --- */
.context-menu-winme {
  background: #c0c0c0;
  border: 2px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #404040, 2px 2px 5px rgba(0,0,0,0.3) !important;
  font-family: Tahoma, 'MS Sans Serif', sans-serif;
  font-size: 11px;
  color: #000;
  padding: 2px;
}

.context-menu-winme .context-menu-item {
  padding: 4px 16px 4px 6px;
  cursor: default;
}

.context-menu-winme .context-menu-item:hover {
  background: #000080;
  color: #fff;
}

.context-menu-winme .context-menu-separator {
  border-bottom: 1px solid #808080;
  border-top: 1px solid #fff;
  margin: 3px 1px;
  height: 0;
  overflow: hidden;
}

/* --- WinVista Style --- */
.context-menu-winvista {
  background: rgba(245, 245, 245, 0.90);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid #979797;
  border-radius: 2px;
  font-family: 'Segoe UI', Arial, sans-serif;
  font-size: 12px;
  color: #000;
  padding: 3px;
}

.context-menu-winvista .context-menu-item {
  padding: 4px 24px 4px 20px;
  cursor: default;
  border: 1px solid transparent;
  border-radius: 2px;
}

.context-menu-winvista .context-menu-item:hover {
  background: linear-gradient(to bottom, #f2f7fc, #e5f3ff);
  border-color: #b8d6f4;
  color: #000;
}

.context-menu-winvista .context-menu-separator {
  height: 1px;
  background: #d0d0d0;
  margin: 4px 8px;
}

/* ===========================================
   DIAL-UP CONNECTION STYLES
   =========================================== */
.dialup-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  background: #fff;
  height: 100%;
  color: #000;
}

.dialup-animation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
}

.dialup-endpoint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100px;
}

.dialup-endpoint .endpoint-icon {
  font-size: 48px;
  line-height: 1;
}

.dialup-endpoint .endpoint-label {
  font-size: 12px;
  font-weight: bold;
  text-align: center;
}

.dialup-link {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 0 20px;
}

.dialup-status {
  font-size: 14px;
  font-weight: bold;
  min-height: 20px;
}

.dialup-progress-bar {
  width: 100%;
  height: 12px;
  background: #eee;
  border: 1px solid #aaa;
  position: relative;
  overflow: hidden;
}

.dialup-progress-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 0%;
  background: repeating-linear-gradient(
    45deg,
    #0078d7,
    #0078d7 10px,
    #005a9e 10px,
    #005a9e 20px
  );
  transition: width 0.1s linear;
}

.dialup-progress-fill.active {
  animation: dialupScroll 2s linear infinite;
}

@keyframes dialupScroll {
  from { background-position: 0 0; }
  to { background-position: 28px 0; }
}

.dialup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.dialup-actions button {
  padding: 4px 16px;
  border: 1px solid #888;
  background: #e1e1e1;
  color: #000;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}

.dialup-actions button:hover {
  background: #e5f1fb;
  border-color: #0078d7;
}

.dialup-actions button:active {
  background: #cce4f7;
}

.dialup-stop-btn {
  display: none;
}
.dialup-stop-btn.visible {
  display: inline-block;
}

/* ===========================================
   CLASSIC WINDOWS TOOLTIPS (JS injected)
   =========================================== */
.classic-tooltip {
  position: fixed;
  background: #ffffe1;
  color: #000;
  border: 1px solid #000;
  padding: 2px 4px;
  font-family: Tahoma, 'MS Sans Serif', sans-serif;
  font-size: 11px;
  line-height: 1.2;
  white-space: normal;
  width: max-content;
  max-width: 250px;
  text-align: left;
  z-index: 2147483647; /* Maximum possible z-index to ensure it's on top of everything */
  pointer-events: none;
  box-shadow: 2px 2px 3px rgba(0,0,0,0.2);
}
