/* ==============================================================
   macOS Tahoe 26 — System CSS
   Core Liquid Glass styling: menu bar, dock, windows, desktop
   ============================================================== */

/* ——— Custom Properties ——— */
:root {
  /* Typography */
  --font-system: -apple-system, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', sans-serif;
  --font-mono: 'SF Mono', 'Menlo', 'Monaco', 'Courier New', monospace;

  /* Menu bar */
  --menubar-height: 26px;
  --menubar-bg: rgba(0, 0, 0, 0.18);
  --menubar-text: #fff;
  --menubar-font-size: 13px;

  /* Dock */
  --dock-bg: rgba(255, 255, 255, 0.12);
  --dock-border: rgba(255, 255, 255, 0.18);
  --dock-radius: 18px;
  --dock-icon-size: 48px;
  --dock-padding: 4px 10px;
  --dock-gap: 4px;

  /* Window chrome */
  --window-radius: 12px;
  --window-title-height: 38px;
  --window-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
  --window-bg: #fff;
  --window-title-bg: rgba(245, 245, 245, 0.85);

  /* Traffic lights */
  --tl-close: #ff5f57;
  --tl-minimize: #febc2e;
  --tl-maximize: #28c840;
  --tl-size: 12px;
  --tl-gap: 7px;
  --tl-border: rgba(0, 0, 0, 0.12);

  /* Tahoe sidebar */
  --sidebar-bg: rgba(0, 0, 0, 0.04);
  --sidebar-radius: 10px;

  /* Wallpaper gradient */
  --wallpaper: linear-gradient(160deg, #1a6fb5 0%, #4da0d8 40%, #87bb8a 70%, #c9a96e 100%);

  /* Glass effect */
  --glass-blur: blur(20px);
  --glass-saturate: saturate(180%);

  /* Z-index layers */
  --z-wallpaper: 0;
  --z-windows: 100;
  --z-notification: 900;
  --z-dock: 1000;
  --z-menubar: 1100;
  --z-dropdown: 1200;
  --z-modal: 1500;
}

/* ——— Reset ——— */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-system);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
  cursor: default;
}

.hidden {
  display: none !important;
}

/* ——— Desktop ——— */
#desktop {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
}

#wallpaper {
  position: fixed;
  inset: 0;
  z-index: var(--z-wallpaper);
  background: var(--wallpaper);
  background-size: cover;
}

/* ——— Menu Bar ——— */
#menu-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--menubar-height);
  z-index: var(--z-menubar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  background: var(--menubar-bg);
  backdrop-filter: var(--glass-blur) var(--glass-saturate);
  -webkit-backdrop-filter: var(--glass-blur) var(--glass-saturate);
  color: var(--menubar-text);
  font-size: var(--menubar-font-size);
}

.menu-bar-left,
.menu-bar-right {
  display: flex;
  align-items: center;
  gap: 2px;
}

.menu-bar-item {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  font-size: var(--menubar-font-size);
  padding: 2px 8px;
  border-radius: 4px;
  cursor: default;
  line-height: 1;
  white-space: nowrap;
}

.menu-bar-item:hover {
  background: rgba(255, 255, 255, 0.15);
}

.menu-bar-item.apple-menu {
  font-size: 16px;
  padding: 0 8px;
  line-height: var(--menubar-height);
}

.menu-bar-item.active-app-name {
  font-weight: 700;
  cursor: default;
}

.menu-bar-item.clock {
  cursor: default;
}

/* Apple Dropdown */
.apple-dropdown {
  position: fixed;
  top: var(--menubar-height);
  left: 6px;
  z-index: var(--z-dropdown);
  background: rgba(40, 40, 40, 0.82);
  backdrop-filter: var(--glass-blur) var(--glass-saturate);
  -webkit-backdrop-filter: var(--glass-blur) var(--glass-saturate);
  border: 0.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 4px 0;
  min-width: 210px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.dropdown-item {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: #fff;
  font: inherit;
  font-size: 13px;
  text-align: left;
  padding: 4px 14px;
  cursor: default;
  border-radius: 4px;
  margin: 0 4px;
  width: calc(100% - 8px);
}

.dropdown-item:hover {
  background: #3478f6;
}

.dropdown-separator {
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
  margin: 4px 12px;
}

/* ——— Dock ——— */
#dock {
  position: fixed;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-dock);
}

.dock-container {
  display: flex;
  align-items: flex-end;
  gap: var(--dock-gap);
  padding: var(--dock-padding);
  background: var(--dock-bg);
  backdrop-filter: var(--glass-blur) var(--glass-saturate);
  -webkit-backdrop-filter: var(--glass-blur) var(--glass-saturate);
  border: 0.5px solid var(--dock-border);
  border-radius: var(--dock-radius);
}

.dock-icon-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.dock-icon {
  width: var(--dock-icon-size);
  height: var(--dock-icon-size);
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  cursor: default;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: bottom center;
  position: relative;
}

.dock-icon:hover {
  transform: scale(1.3);
}

/* Tooltip */
.dock-icon-wrapper .dock-tooltip {
  position: absolute;
  bottom: calc(var(--dock-icon-size) + 8px);
  background: rgba(40, 40, 40, 0.85);
  backdrop-filter: blur(12px);
  color: #fff;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 5px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s, transform 0.15s;
}

.dock-icon-wrapper:hover .dock-tooltip {
  opacity: 1;
  transform: translateY(0);
}

/* Running indicator */
.dock-indicator {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  margin-top: 2px;
  opacity: 0;
  transition: opacity 0.2s;
}

.dock-indicator.active {
  opacity: 1;
}

/* Dock separator */
.dock-separator {
  width: 1px;
  height: calc(var(--dock-icon-size) * 0.6);
  background: rgba(255, 255, 255, 0.25);
  margin: 0 4px;
  align-self: center;
}

/* ——— Windows Layer ——— */
#windows-layer {
  position: fixed;
  top: var(--menubar-height);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-windows);
  pointer-events: none;
}

/* ——— Window Chrome ——— */
.window {
  position: absolute;
  border-radius: var(--window-radius);
  overflow: hidden;
  box-shadow: var(--window-shadow);
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  /* Opening animation */
  animation: windowOpen 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes windowOpen {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes windowClose {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.92);
  }
}

.window-titlebar {
  height: var(--window-title-height);
  min-height: var(--window-title-height);
  background: var(--window-title-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  padding: 0 12px;
  position: relative;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
  cursor: default;
}

.traffic-lights {
  display: flex;
  gap: var(--tl-gap);
  z-index: 1;
}

.traffic-light {
  width: var(--tl-size);
  height: var(--tl-size);
  border-radius: 50%;
  border: 0.5px solid var(--tl-border);
  cursor: default;
  position: relative;
  transition: filter 0.1s;
}

.traffic-light:hover {
  filter: brightness(0.88);
}

.traffic-light.close {
  background: var(--tl-close);
}

.traffic-light.minimize {
  background: var(--tl-minimize);
}

.traffic-light.maximize {
  background: var(--tl-maximize);
}

/* Show x / - / + symbols on hover */
.traffic-lights:hover .traffic-light.close::after {
  content: '×';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.5);
  line-height: 1;
}

.traffic-lights:hover .traffic-light.minimize::after {
  content: '−';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.5);
  line-height: 1;
}

.traffic-lights:hover .traffic-light.maximize::after {
  content: '+';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.5);
  line-height: 1;
}

.window-title {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.85);
  pointer-events: none;
}

.window-body {
  flex: 1;
  background: var(--window-bg);
  overflow: auto;
  position: relative;
}

/* ——— Tahoe Oval Sidebar (used by apps) ——— */
.window-body-with-sidebar {
  display: flex;
  padding: 8px;
  gap: 1px;
  background: var(--window-bg);
}

.window-sidebar {
  width: 200px;
  min-width: 200px;
  background: var(--sidebar-bg);
  border-radius: var(--sidebar-radius);
  padding: 8px;
  overflow-y: auto;
}

.window-main {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

/* Sidebar items */
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: rgba(0, 0, 0, 0.75);
  cursor: default;
}

.sidebar-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.sidebar-item.active {
  background: rgba(0, 0, 0, 0.08);
  font-weight: 500;
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 10px 4px;
}

/* ——— Notifications ——— */
#notification-area {
  position: fixed;
  top: calc(var(--menubar-height) + 8px);
  right: 12px;
  z-index: var(--z-notification);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.notification {
  background: rgba(50, 50, 50, 0.82);
  backdrop-filter: var(--glass-blur) var(--glass-saturate);
  -webkit-backdrop-filter: var(--glass-blur) var(--glass-saturate);
  border: 0.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 12px 16px;
  color: #fff;
  min-width: 300px;
  max-width: 360px;
  pointer-events: auto;
  animation: notifSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.notification.dismissing {
  animation: notifSlideOut 0.3s ease-in forwards;
}

@keyframes notifSlideIn {
  from {
    opacity: 0;
    transform: translateX(60px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes notifSlideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(60px);
  }
}

.notification-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}

.notification-body {
  font-size: 12px;
  opacity: 0.85;
  line-height: 1.4;
}

/* ——— About This Mac Modal ——— */
#about-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
}

.about-window {
  width: 300px;
  background: rgba(245, 245, 245, 0.95);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-radius: 12px;
  box-shadow: 0 12px 50px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  animation: windowOpen 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.about-traffic-lights {
  display: flex;
  padding: 12px 12px 0;
}

.about-traffic-lights .traffic-light {
  width: var(--tl-size);
  height: var(--tl-size);
  border-radius: 50%;
  background: var(--tl-close);
  border: 0.5px solid var(--tl-border);
  cursor: default;
}

.about-traffic-lights .traffic-light:hover {
  filter: brightness(0.88);
}

.about-content {
  text-align: center;
  padding: 20px 30px 30px;
}

.about-logo {
  font-size: 56px;
  color: #333;
  line-height: 1;
  margin-bottom: 6px;
}

.about-content h1 {
  font-size: 22px;
  font-weight: 300;
  color: #222;
  margin-bottom: 4px;
}

.about-version {
  font-size: 12px;
  color: #666;
  margin-bottom: 14px;
}

.about-chip,
.about-memory,
.about-serial {
  font-size: 12px;
  color: #555;
  line-height: 1.6;
}

/* ——— Scrollbar styling ——— */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.35);
}
