/* ==========================================
   macOS Sonoma / Modern Dark Apple Glass Theme Stylesheet
   ========================================== */
.theme-mac-sonoma {
  --desktop-bg: radial-gradient(circle at 60% 40%, #2e1065 0%, #0f172a 60%, #020617 100%);
  --window-bg: rgba(30, 41, 59, 0.7);
  --window-border: rgba(255, 255, 255, 0.15);
  --text-main: #f8fafc;
  /* The accent, the surfaces, the bar and the second text of this look, which the desk's parts and a game in a window read; without them the first look's showed through. */
  --accent: #3b82f6;
  --window-active-border: #60a5fa;
  --surface: rgba(30, 41, 59, 0.85);
  --surface-hover: rgba(51, 65, 85, 0.9);
  --taskbar-bg: rgba(15, 23, 42, 0.65);
  --text-secondary: #cbd5e1;
}

.theme-mac-sonoma #desktop {
  background: radial-gradient(circle at 60% 40%, #2e1065 0%, #0f172a 60%, #020617 100%);
}

/* --- Windows --- */
.theme-mac-sonoma .window {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  background: rgba(15, 23, 42, 0.75);
  color: #f8fafc;
}
.theme-mac-sonoma { --titlebar-blur: 24px; }   /* the glass on the title bar only (frame.css says why) */

.theme-mac-sonoma .window.active {
  box-shadow: 0 25px 60px rgba(168, 85, 247, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.3);
}

.theme-mac-sonoma .window .titlebar {
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-weight: 600;
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  height: 32px;
  padding: 0 12px;
  justify-content: center;
  position: relative;
  border-radius: 11px 11px 0 0;
}

.theme-mac-sonoma .window .window-title {
  color: #f8fafc;
  font-weight: 600;
  text-align: center;
  padding: 0 80px;  /* the four buttons end 78px in */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;  /* the padding keeps the title clear of the buttons; a max-width as well took that room twice */
}

.theme-mac-sonoma .window .window-controls {
  flex-direction: row-reverse;  /* close, minimize, zoom, code from the left, as on a Mac (the page has them the other way) */
  position: absolute;
  left: 12px;
  top: 10px;
  display: flex;
  gap: 6px;  /* four buttons, as the other Macs space them */
  z-index: 5;
}

.theme-mac-sonoma .window .window-controls button {
  width: 12px;
  height: 12px;
  min-width: 12px;
  min-height: 12px;
  border-radius: 50%;
  border: none;
  font-size: 0;
  color: transparent;
  padding: 0;
}

.theme-mac-sonoma .window .window-controls .btn-close {
  background: #ff5f57;
}

.theme-mac-sonoma .window .window-controls .btn-minimize {
  background: #febc2e;
}

.theme-mac-sonoma .window .window-controls .btn-maximize {
  background: #28c840;
  order: -1;  /* zoom after minimize; the controls run right to left */
}

.theme-mac-sonoma .window .window-controls .btn-code {
  background: #8e8e93;
  order: -2;  /* last, past zoom: green is zoom, as on a Mac */
}

.theme-mac-sonoma .code-toolbar {
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-mac-sonoma .code-tab {
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  border: 1px solid transparent;
  border-radius: 6px;
  font-family: -apple-system, sans-serif;
}

.theme-mac-sonoma .code-tab.active {
  background: #a855f7;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.6);
}

/* --- Taskbar --- */
.theme-mac-sonoma #taskbar {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: #f8fafc;
}

.theme-mac-sonoma .start-btn {
  background: linear-gradient(135deg, #a855f7, #6366f1);
  border: none;
  border-radius: 12px;
  color: #ffffff;
  font-family: -apple-system, sans-serif;
  font-weight: bold;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.5);
}

.theme-mac-sonoma .taskbar-windows button {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #f8fafc;
  font-family: -apple-system, sans-serif;
}

.theme-mac-sonoma .taskbar-windows button.active {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.theme-mac-sonoma .guide-btn,
.theme-mac-sonoma .tray-item,
.theme-mac-sonoma #clock {
  color: #c084fc !important;
  font-weight: 600;
  font-family: -apple-system, sans-serif;
  text-shadow: none !important;
}

/* --- Context Menu & Start Menu --- */
.theme-mac-sonoma .context-menu {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  color: #f8fafc;
}

.theme-mac-sonoma .context-menu-item {
  color: #f8fafc;
  font-family: -apple-system, sans-serif;
  border-radius: 6px;
}

.theme-mac-sonoma .context-menu-item:hover {
  background: #a855f7;
  color: #ffffff;
}

.theme-mac-sonoma .start-menu {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px 14px 0 0;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  color: #f8fafc;
}

.theme-mac-sonoma .start-menu-header {
  background: linear-gradient(135deg, #a855f7, #6366f1);
  color: #ffffff;
}

.theme-mac-sonoma .start-menu-item { color: #f8fafc; border-radius: 8px; }
.theme-mac-sonoma .start-menu-item:hover { background: #a855f7; color: #ffffff; }
.theme-mac-sonoma .start-menu-footer { background: rgba(2, 6, 23, 0.6); border-top: 1px solid rgba(255, 255, 255, 0.1); }
