/* ============================================
   OS-SPECIFIC STYLES FOR WINDOWS & MAC MODES
   Enhanced with animations and polish
   ============================================ */

html,
body {
  margin: 0 !important;
  padding: 0 !important;
  height: 100% !important;
  width: 100% !important;
  overflow: hidden !important;
  background-color: #000 !important;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  background-image: var(--bg-image, url('/assets/wallpapers/1.jpg')) !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  background-attachment: fixed !important;
  transition: background-image 0.5s ease-in-out;
}

/* HIDE ALL OS ELEMENTS UNTIL USER LOGS IN */
body:not([data-logged-in="1"]) .dock,
body:not([data-logged-in="1"]) .topbar,
body:not([data-logged-in="1"]) .wm,
body:not([data-logged-in="1"]) .desktop {
  display: none !important;
  visibility: hidden !important;
}

/* SHOW OS ELEMENTS AFTER LOGIN */
body[data-logged-in="1"] .dock,
body[data-logged-in="1"] .topbar,
body[data-logged-in="1"] .wm,
body[data-logged-in="1"] .desktop {
  visibility: visible;
}

/* HIDE TOPBAR ONLY IN WINDOWS MODE */
html[data-os="windows"] .topbar {
  display: none !important;
}

html[data-os="mac"] .topbar {
  display: flex !important;
}

/* ADJUST WM INSETS WITHOUT TOPBAR */
html[data-os="windows"] .wm {
  inset: 0 0 48px 0 !important;
}

html[data-os="mac"] .wm {
  inset: 28px 0 84px 0 !important;
}

html[data-os="windows"] .desktop {
  position: fixed !important;
  inset: 0 !important;
  padding: 0 !important;
  z-index: 0 !important;
}

html[data-os="mac"] .desktop {
  padding-bottom: 84px !important;
  padding-top: 28px !important;
}

/* Ensure windows are above desktop */
html[data-os="windows"] .wm {
  z-index: 10 !important;
}

html[data-os="windows"] .dock {
  z-index: 999 !important;
}


/* IMMERSIVE MODE - FULL SCREEN COVERAGE */
html[data-os="windows"] body[data-immersive="1"] .wm {
  inset: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
}

html[data-os="windows"] body[data-immersive="1"] .dock {
  display: none !important;
}

/* Immersive window - COVER EVERYTHING */
html[data-os="windows"] body[data-immersive="1"] .window {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  transform: none !important;
}

html[data-os="windows"] body[data-immersive="1"] .window .titlebar {
  border-radius: 0 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Ensure topbar is HIDDEN in Mac Immersive mode */
html[data-os="mac"] body[data-immersive="1"] .topbar {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

html[data-os="mac"] body[data-immersive="1"] .wm {
  inset: 0 !important;
}

/* ============================================
   WINDOWS MODE - TASKBAR STYLE
   ============================================ */

/* Taskbar base - Windows 11 Layout */
html[data-os="windows"] .dock {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  transform: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  height: 48px !important;
  display: grid !important;
  grid-template-columns: auto 1fr auto !important;
  align-items: center !important;
  gap: 0 !important;
  background: rgba(8, 10, 14, 0.75) !important;
  backdrop-filter: saturate(200%) blur(60px) !important;
  border: none !important;
  border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.6) !important;
  z-index: 999 !important;
}

/* Remove pseudo elements */
html[data-os="windows"] .dock::before,
html[data-os="windows"] .dock::after {
  display: none !important;
  content: none !important;
}

/* Dock items */
html[data-os="windows"] .dock-item {
  border-radius: 4px !important;
  padding: 6px 10px !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  position: relative !important;
  cursor: pointer !important;
}

html[data-os="windows"] .dock-item:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  transform: translateY(-2px) !important;
}

html[data-os="windows"] .dock-item:active {
  transform: translateY(0) scale(0.96) !important;
}

/* Icons */
html[data-os="windows"] .icon {
  height: 32px !important;
  width: 32px !important;
  border-radius: 4px !important;
  transform-origin: center center !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Open indicator */
html[data-os="windows"] .dock-item.open::after {
  content: "" !important;
  position: absolute !important;
  left: 50% !important;
  bottom: 0 !important;
  transform: translateX(-50%) !important;
  height: 3px !important;
  width: 60% !important;
  border-radius: 2px 2px 0 0 !important;
  background: linear-gradient(90deg, transparent, #4cc2ff, transparent) !important;
  box-shadow: 0 0 8px rgba(76, 194, 255, 0.6) !important;
  z-index: 10 !important;
  animation: pulseGlow 2s ease-in-out infinite !important;
}

@keyframes pulseGlow {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

/* Label/Tooltip */
html[data-os="windows"] .label {
  position: absolute !important;
  left: 50% !important;
  bottom: 54px !important;
  border-radius: 4px !important;
  background: rgba(32, 32, 38, 0.98) !important;
  backdrop-filter: blur(12px) !important;
  padding: 6px 10px !important;
  font-size: 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
  transform: translateX(-50%) translateY(4px) !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Show label only on hover */
html[data-os="windows"] .dock-item:hover .label,
html[data-os="windows"] .dock-item.active .label {
  visibility: visible !important;
  opacity: 1 !important;
  animation: tooltipFadeIn 0.2s ease-out !important;
}

html[data-os="windows"] .dock-item.hovering .label {
  visibility: visible !important;
  opacity: 1 !important;
  animation: tooltipFadeIn 0.2s ease-out !important;
}

/* Mac mode: show label on hover/active similar to Windows */
html[data-os="mac"] .dock-item .label {
  visibility: hidden !important;
  opacity: 0 !important;
  left: 50% !important;
  transform: translateX(-50%) translateY(6px) !important;
}

html[data-os="mac"] .dock-item:hover .label,
html[data-os="mac"] .dock-item.active .label {
  visibility: visible !important;
  opacity: 1 !important;
  animation: tooltipFadeIn 0.18s ease-out !important;
  transform: translateX(-50%) translateY(0) !important;
}

html[data-os="mac"] .dock-item.hovering .label {
  visibility: visible !important;
  opacity: 1 !important;
  animation: tooltipFadeIn 0.18s ease-out !important;
  transform: translateX(-50%) translateY(0) !important;
}

@keyframes tooltipFadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* System Tray / Clock Area - RIGHT SIDE */
#taskbar-systray {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 0 12px !important;
  height: 100% !important;
  grid-column: 3 !important;
  justify-content: flex-end !important;
  margin-left: auto !important;
}

#taskbar-controls {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  margin-right: 12px !important;
}

#taskbar-clock {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  padding: 4px 12px !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  user-select: none !important;
}

#taskbar-clock:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

#taskbar-clock:active {
  background: rgba(255, 255, 255, 0.12) !important;
  transform: scale(0.98) !important;
}

#taskbar-time {
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #ffffff !important;
  line-height: 1.2 !important;
}

#taskbar-date {
  font-size: 11px !important;
  font-weight: 500 !important;
  color: rgba(255, 255, 255, 0.75) !important;
  line-height: 1.2 !important;
}

/* Taskbar buttons */
.taskbar-btn {
  appearance: none !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: rgba(255, 255, 255, 0.05) !important;
  color: #e7e7ea !important;
  height: 28px !important;
  width: 28px !important;
  border-radius: 4px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  margin: 0 !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.taskbar-btn:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

.taskbar-btn:active {
  transform: translateY(0) scale(0.95) !important;
}

.taskbar-btn img {
  height: 14px !important;
  width: 14px !important;
  pointer-events: none !important;
  object-fit: contain !important;
}

/* Apps container - CENTERED in grid */
#taskbar-apps-container {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  grid-column: 2 !important;
  padding: 0 12px !important;
}

/* Left controls container */
#taskbar-left-controls {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 0 8px !important;
  grid-column: 1 !important;
}

/* Hide taskbar controls and clock in Mac mode */
html[data-os="mac"] #taskbar-left-controls,
html[data-os="mac"] #taskbar-systray,
html[data-os="mac"] #taskbar-clock,
html[data-os="mac"] #taskbar-calendar {
  display: none !important;
}

/* ============================================
   USER PROFILE MENU - WINDOWS & MAC
   ============================================ */

/* User profile button */
.user-profile-btn {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 4px 12px 4px 4px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 20px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  user-select: none !important;
}

.user-profile-btn:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  transform: translateY(-1px) !important;
}

.user-profile-btn:active {
  transform: translateY(0) scale(0.98) !important;
}

/* Mac topbar padding to prevent button cutoff */
html[data-os="mac"] .topbar {
  padding-left: 12px !important;
  padding-right: 12px !important;
}

html[data-os="mac"] #tb-controls {
  margin-right: 8px !important;
}

/* User avatar */
.user-avatar {
  width: 28px !important;
  height: 28px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  border: 2px solid rgba(255, 255, 255, 0.3) !important;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
}

/* User name */
.user-name {
  font-size: 13px !important;
  font-weight: 600 !important;
  color: rgba(255, 255, 255, 0.95) !important;
  max-width: 120px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* User profile menu dropdown */
#user-profile-menu {
  position: fixed !important;
  background: rgba(24, 24, 28, 0.98) !important;
  backdrop-filter: blur(40px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 12px !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7) !important;
  padding: 8px !important;
  min-width: 220px !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateY(-10px) scale(0.95) !important;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  z-index: 10002 !important;
}

#user-profile-menu.show {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) scale(1) !important;
}

/* Mac-specific glass style */
html[data-os="mac"] #user-profile-menu {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08)) !important;
  backdrop-filter: blur(50px) saturate(250%) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

/* Menu item */
.user-profile-menu-item {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 10px 14px !important;
  color: rgba(255, 255, 255, 0.9) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  border-radius: 8px !important;
  transition: all 0.15s ease !important;
}

.user-profile-menu-item:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
}

.user-profile-menu-item svg {
  width: 16px !important;
  height: 16px !important;
  flex-shrink: 0 !important;
}

/* Separator */
.user-profile-menu-separator {
  height: 1px !important;
  background: rgba(255, 255, 255, 0.1) !important;
  margin: 6px 0 !important;
}

/* Logout item - different color */
.user-profile-menu-item.logout {
  color: #ff6b6b !important;
}

.user-profile-menu-item.logout:hover {
  background: rgba(255, 107, 107, 0.15) !important;
  color: #ff5252 !important;
}

/* Calendar Widget */
#taskbar-calendar {
  position: fixed !important;
  right: 8px !important;
  bottom: 56px !important;
  width: 320px !important;
  background: rgba(24, 24, 28, 0.98) !important;
  backdrop-filter: blur(40px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 12px !important;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7) !important;
  padding: 16px !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateY(10px) scale(0.95) !important;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  z-index: 10000 !important;
}

#taskbar-calendar.show {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) scale(1) !important;
}

#calendar-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 12px !important;
  padding-bottom: 12px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

#calendar-current-date {
  color: #ffffff !important;
  font-size: 14px !important;
  font-weight: 600 !important;
}

#calendar-nav {
  display: flex !important;
  gap: 4px !important;
}

.calendar-nav-btn {
  appearance: none !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
  width: 28px !important;
  height: 28px !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 14px !important;
  transition: all 0.2s ease !important;
}

.calendar-nav-btn:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

#calendar-month-year {
  color: rgba(255, 255, 255, 0.7) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  text-align: center !important;
  margin-bottom: 8px !important;
}

#calendar-weekdays {
  display: grid !important;
  grid-template-columns: repeat(7, 1fr) !important;
  gap: 4px !important;
  margin-bottom: 8px !important;
}

.calendar-weekday {
  color: rgba(255, 255, 255, 0.5) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  text-align: center !important;
  padding: 6px 0 !important;
}

#calendar-days {
  display: grid !important;
  grid-template-columns: repeat(7, 1fr) !important;
  gap: 4px !important;
}

.calendar-day {
  aspect-ratio: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: rgba(255, 255, 255, 0.9) !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  background: transparent !important;
}

.calendar-day:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

.calendar-day.other-month {
  color: rgba(255, 255, 255, 0.3) !important;
}

.calendar-day.today {
  background: linear-gradient(135deg, #ff6b6b, #ee5a6f) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4) !important;
}

.calendar-day.selected {
  background: rgba(76, 194, 255, 0.2) !important;
  border: 2px solid #4cc2ff !important;
  color: #ffffff !important;
}

/* Month/Year selectors */
#calendar-month-year {
  color: rgba(255, 255, 255, 0.7) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  text-align: center !important;
  margin-bottom: 8px !important;
  cursor: pointer !important;
  padding: 6px !important;
  border-radius: 6px !important;
  transition: all 0.2s ease !important;
}

#calendar-month-year:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

.month-year-selector {
  display: none !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 6px !important;
  margin-bottom: 12px !important;
}

.month-year-selector.show {
  display: grid !important;
}

.month-year-item {
  padding: 10px !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 6px !important;
  color: rgba(255, 255, 255, 0.8) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  text-align: center !important;
  transition: all 0.2s ease !important;
}

.month-year-item:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
}

.month-year-item.selected {
  background: rgba(76, 194, 255, 0.2) !important;
  border-color: #4cc2ff !important;
  color: #ffffff !important;
}

/* Logout menu positioned below button */
.taskbar-logout-menu {
  position: fixed !important;
  background: rgba(24, 24, 28, 0.98) !important;
  backdrop-filter: blur(40px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6) !important;
  padding: 6px !important;
  min-width: 180px !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateY(-10px) scale(0.95) !important;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  z-index: 10001 !important;
}

.taskbar-logout-menu.show {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) scale(1) !important;
}

.taskbar-logout-item {
  padding: 10px 14px !important;
  color: rgba(255, 255, 255, 0.9) !important;
  font-size: 13px !important;
  cursor: pointer !important;
  border-radius: 4px !important;
  transition: all 0.15s ease !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.taskbar-logout-item:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
}

/* ============================================
   MAC TOPBAR CUSTOMIZATION
   ============================================ */

/* Reorder topbar buttons in Mac mode: Power, Settings, Fullscreen, OS */
html[data-os="mac"] #tb-controls {
  display: flex !important;
  gap: 4px !important;
}

html[data-os="mac"] #power-btn {
  order: 1 !important;
}

html[data-os="mac"] #settings-btn {
  order: 2 !important;
}

html[data-os="mac"] #fullscreen-btn {
  order: 3 !important;
}

html[data-os="mac"] #os-btn {
  order: 4 !important;
}

/* Hide ALL old individual buttons in Mac - only show profile */
html[data-os="mac"] #power-btn,
html[data-os="mac"] #settings-btn,
html[data-os="mac"] #os-btn,
html[data-os="mac"] #fullscreen-btn {
  display: none !important;
}

/* Mac topbar date - clickable */
html[data-os="mac"] #date {
  cursor: pointer !important;
  padding: 4px 8px !important;
  border-radius: 6px !important;
  transition: all 0.2s ease !important;
}

html[data-os="mac"] #date:hover {
  background: rgba(255, 255, 255, 0.15) !important;
}

/* Mac calendar widget */
#mac-calendar {
  position: fixed !important;
  right: 8px !important;
  top: 36px !important;
  width: 320px !important;
  background: rgba(28, 28, 30, 0.85) !important;
  backdrop-filter: blur(50px) saturate(250%) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 14px !important;
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
  padding: 16px !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateY(-10px) scale(0.95) !important;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  z-index: 10000 !important;
}

#mac-calendar.show {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) scale(1) !important;
}

/* Mac calendar styling - more colorful */
#mac-calendar #calendar-header {
  border-bottom-color: rgba(255, 255, 255, 0.2) !important;
}

#mac-calendar #calendar-current-date {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
}

#mac-calendar .calendar-nav-btn {
  background: rgba(255, 255, 255, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  border-radius: 8px !important;
}

#mac-calendar .calendar-nav-btn:hover {
  background: rgba(255, 255, 255, 0.25) !important;
}

#mac-calendar #calendar-month-year {
  color: rgba(255, 255, 255, 0.95) !important;
  font-weight: 600 !important;
}

#mac-calendar .calendar-weekday {
  color: rgba(255, 255, 255, 0.7) !important;
  font-weight: 700 !important;
}

#mac-calendar .calendar-day {
  color: #ffffff !important;
  font-weight: 600 !important;
}

#mac-calendar .calendar-day:hover {
  background: rgba(255, 255, 255, 0.2) !important;
}

#mac-calendar .calendar-day.other-month {
  color: rgba(255, 255, 255, 0.4) !important;
}

#mac-calendar .calendar-day.today {
  background: linear-gradient(135deg, #007aff, #0051d5) !important;
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.5) !important;
}

#mac-calendar .month-year-item {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
  border-radius: 8px !important;
}

#mac-calendar .month-year-item:hover {
  background: rgba(255, 255, 255, 0.2) !important;
}

#mac-calendar .month-year-item.selected {
  background: rgba(0, 122, 255, 0.4) !important;
  border-color: #007aff !important;
}

/* ============================================
   MAC MODE - DOCK STYLE
   ============================================ */

html[data-os="mac"] .dock {
  position: fixed !important;
  left: 50% !important;
  bottom: 8px !important;
  transform: translateX(-50%) !important;
  border-radius: 20px !important;
  padding: 8px 16px !important;
  display: flex !important;
  align-items: flex-end !important;
  justify-content: center !important;
  gap: 12px !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.12)) !important;
  backdrop-filter: saturate(250%) blur(50px) !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1) !important;
  animation: dockSlideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

@keyframes dockSlideUp {
  from {
    transform: translateX(-50%) translateY(100px);
    opacity: 0;
  }

  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

html[data-os="mac"] .dock-item {
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  cursor: pointer !important;
}

html[data-os="mac"] .icon {
  height: 52px !important;
  width: 52px !important;
  border-radius: 16px !important;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

html[data-os="mac"] .dock-item:hover .icon {
  transform: translateY(-12px) scale(1.2) !important;
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

html[data-os="mac"] .dock-item.open::after {
  content: "" !important;
  position: absolute !important;
  left: 50% !important;
  bottom: -6px !important;
  transform: translateX(-50%) !important;
  height: 4px !important;
  width: 4px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.95) !important;
  box-shadow:
    0 0 4px rgba(255, 255, 255, 0.8),
    0 2px 8px rgba(0, 0, 0, 0.4) !important;
  z-index: 10 !important;
}

html[data-os="mac"] .label {
  bottom: 72px !important;
  border-radius: 10px !important;
  background: rgba(20, 20, 25, 0.85) !important;
  backdrop-filter: saturate(180%) blur(20px) !important;
  padding: 6px 12px !important;
  font-size: 13px !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
  animation: tooltipFadeIn 0.2s ease-out !important;
}

/* ============================================
   WINDOW CONTROLS - ENHANCED
   ============================================ */

/* Mac - Traffic lights on LEFT */
html[data-os="mac"] .traffic {
  order: -1 !important;
  margin-right: auto !important;
  margin-left: 0 !important;
  display: flex !important;
  gap: 8px !important;
}

html[data-os="mac"] .traffic .btn {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  position: relative !important;
  overflow: hidden !important;
}

html[data-os="mac"] .traffic .btn::after {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  border-radius: 50% !important;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3), transparent) !important;
  opacity: 0 !important;
  transform: scale(0) !important;
  transition: all 0.3s ease !important;
}

html[data-os="mac"] .traffic .btn:hover::after {
  opacity: 1 !important;
  transform: scale(1) !important;
}

html[data-os="mac"] .traffic .close {
  background: #ff5f57 !important;
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
}

html[data-os="mac"] .traffic .min {
  background: #ffbd2e !important;
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
}

html[data-os="mac"] .traffic .zoom {
  background: #28c840 !important;
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
}

html[data-os="mac"] .traffic .close:hover {
  background: #ff4943 !important;
  box-shadow: 0 2px 8px rgba(255, 95, 87, 0.4) !important;
}

html[data-os="mac"] .traffic .min:hover {
  background: #ffb01a !important;
  box-shadow: 0 2px 8px rgba(255, 189, 46, 0.4) !important;
}

html[data-os="mac"] .traffic .zoom:hover {
  background: #14c42c !important;
  box-shadow: 0 2px 8px rgba(40, 200, 64, 0.4) !important;
}

/* Windows - Controls on RIGHT in order: MIN, MAX, CLOSE */
html[data-os="windows"] .traffic {
  order: 999 !important;
  margin-left: auto !important;
  margin-right: 0 !important;
  gap: 0 !important;
  display: flex !important;
}

/* Reorder buttons: min first, zoom second, close last */
html[data-os="windows"] .traffic .min {
  order: 1 !important;
}

html[data-os="windows"] .traffic .zoom {
  order: 2 !important;
}

html[data-os="windows"] .traffic .close {
  order: 3 !important;
}

html[data-os="windows"] .traffic .btn {
  height: 32px !important;
  width: 46px !important;
  border-radius: 0 !important;
  background: transparent !important;
  position: relative !important;
  transition: all 0.15s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: none !important;
}

html[data-os="windows"] .traffic .close {
  background: transparent !important;
}

html[data-os="windows"] .traffic .min {
  background: transparent !important;
}

html[data-os="windows"] .traffic .zoom {
  background: transparent !important;
}

html[data-os="windows"] .traffic .close:hover {
  background: #e81123 !important;
}

html[data-os="windows"] .traffic .min:hover {
  background: rgba(255, 255, 255, 0.1) !important;
}

html[data-os="windows"] .traffic .zoom:hover {
  background: rgba(255, 255, 255, 0.1) !important;
}

/* Button symbols */
html[data-os="windows"] .traffic .close::before {
  content: "✕" !important;
  position: absolute !important;
  font-size: 11px !important;
  line-height: 1 !important;
  font-weight: 400 !important;
  transition: transform 0.2s ease !important;
}

html[data-os="windows"] .traffic .close:hover::before {
  transform: rotate(90deg) !important;
}

html[data-os="windows"] .traffic .min::before {
  content: "" !important;
  position: absolute !important;
  width: 10px !important;
  height: 1px !important;
  background: currentColor !important;
}

html[data-os="windows"] .traffic .zoom::before {
  content: "" !important;
  position: absolute !important;
  width: 9px !important;
  height: 9px !important;
  background: transparent !important;
  border: 1px solid currentColor !important;
}

/* ============================================
   WINDOW STYLES - ENHANCED (webOS style)
   ============================================ */

/* Base window in windowed mode */
.window.windowed {
  position: absolute !important;
  min-width: 320px !important;
  min-height: 200px !important;
  max-width: none !important;
  max-height: none !important;
}

/* Window shadow enhancement when windowed */
.window.windowed {
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 8px 25px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1) !important;
}

/* Active window has stronger shadow */
.window.windowed.active {
  box-shadow:
    0 25px 80px rgba(0, 0, 0, 0.6),
    0 10px 35px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.15) !important;
}

/* Dragging state */
.window.dragging {
  opacity: 0.92 !important;
  cursor: grabbing !important;
  box-shadow:
    0 35px 100px rgba(0, 0, 0, 0.7),
    0 15px 50px rgba(0, 0, 0, 0.5) !important;
  transition: box-shadow 0.15s ease, opacity 0.1s ease !important;
}

.window.dragging * {
  cursor: grabbing !important;
}

/* Snap preview (Windows-style drag zones) */
.window-snap-preview {
  position: absolute;
  z-index: 9995;
  border-radius: 10px;
  border: 1px solid rgba(125, 211, 252, 0.65);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(37, 99, 235, 0.12));
  box-shadow: 0 18px 50px rgba(30, 64, 175, 0.22), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  pointer-events: none;
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.window-snap-preview.show {
  opacity: 1;
  transform: scale(1);
}

/* Enhanced window context menu */
.context.window-menu {
  min-width: 250px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(180deg, rgba(25, 28, 42, 0.95), rgba(18, 20, 31, 0.95));
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(120, 170, 255, 0.14) inset;
}

.context.window-menu.show {
  gap: 6px;
}

.context .context-sep {
  height: 1px;
  margin: 2px 6px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
}

.context.window-menu .ctx-window-btn {
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  color: #edf2ff;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
}

.context.window-menu .ctx-window-btn:hover {
  border-color: rgba(125, 211, 252, 0.5);
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.22), rgba(37, 99, 235, 0.12));
  transform: translateY(-1px);
}

.context.window-menu .ctx-window-btn .ctx-item-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.context.window-menu .ctx-window-btn .ctx-item-icon {
  width: 18px;
  text-align: center;
  opacity: 0.9;
}

.context.window-menu .ctx-window-btn .ctx-item-hint {
  opacity: 0.65;
  font-size: 11px;
}

.context.window-menu .ctx-window-btn.danger {
  color: #ffd6d6;
  border-color: rgba(248, 113, 113, 0.35);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.18), rgba(185, 28, 28, 0.1));
}

.context.window-menu .ctx-window-btn.danger:hover {
  border-color: rgba(248, 113, 113, 0.6);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.3), rgba(185, 28, 28, 0.2));
}

/* Resizing state */
.window.resizing {
  opacity: 0.95 !important;
  transition: none !important;
}

/* Titlebar cursor for windowed mode */
.window.windowed .titlebar {
  cursor: grab !important;
}

.window.windowed .titlebar:active {
  cursor: grabbing !important;
}

/* Full mode - no grab cursor */
.window.full .titlebar {
  cursor: default !important;
}

/* ============================================
   RESIZE HANDLES
   ============================================ */

.resize-handle {
  position: absolute !important;
  z-index: 100 !important;
  background: transparent !important;
}

/* Hide resize handles in fullscreen */
.window.full .resize-handle {
  display: none !important;
}

/* Edge handles */
.resize-n {
  top: -4px;
  left: 10px;
  right: 10px;
  height: 8px;
  cursor: ns-resize !important;
}

.resize-s {
  bottom: -4px;
  left: 10px;
  right: 10px;
  height: 8px;
  cursor: ns-resize !important;
}

.resize-e {
  right: -4px;
  top: 10px;
  bottom: 10px;
  width: 8px;
  cursor: ew-resize !important;
}

.resize-w {
  left: -4px;
  top: 10px;
  bottom: 10px;
  width: 8px;
  cursor: ew-resize !important;
}

/* Corner handles */
.resize-ne {
  top: -4px;
  right: -4px;
  width: 14px;
  height: 14px;
  cursor: nesw-resize !important;
}

.resize-nw {
  top: -4px;
  left: -4px;
  width: 14px;
  height: 14px;
  cursor: nwse-resize !important;
}

.resize-se {
  bottom: -4px;
  right: -4px;
  width: 14px;
  height: 14px;
  cursor: nwse-resize !important;
}

.resize-sw {
  bottom: -4px;
  left: -4px;
  width: 14px;
  height: 14px;
  cursor: nesw-resize !important;
}

/* Visual indicator on hover (subtle) */
.resize-handle:hover {
  background: rgba(255, 255, 255, 0.05) !important;
}

/* Corner resize indicator (optional visual cue) */
.resize-se::after {
  content: '' !important;
  position: absolute !important;
  right: 4px !important;
  bottom: 4px !important;
  width: 8px !important;
  height: 8px !important;
  border-right: 2px solid rgba(255, 255, 255, 0.2) !important;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2) !important;
  pointer-events: none !important;
}

.window.full .resize-se::after {
  display: none !important;
}

html[data-os="windows"] .window {
  border-radius: 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.6) !important;
  animation: windowFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

html[data-os="windows"] .window.windowed {
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 8px 25px rgba(0, 0, 0, 0.3) !important;
}

html[data-os="mac"] .window {
  border-radius: 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  box-shadow:
    0 32px 100px rgba(0, 0, 0, 0.7),
    0 0 0 0.5px rgba(255, 255, 255, 0.1) inset !important;
  animation: windowFadeIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

html[data-os="mac"] .window.windowed {
  box-shadow:
    0 25px 80px rgba(0, 0, 0, 0.6),
    0 10px 35px rgba(0, 0, 0, 0.3),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.15) !important;
}

@keyframes windowFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Window closing animation */
.window.closing {
  animation: windowFadeOut 0.25s cubic-bezier(0.4, 0, 1, 1) forwards !important;
}

@keyframes windowFadeOut {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }

  to {
    opacity: 0;
    transform: scale(0.85) translateY(20px);
  }
}

html[data-os="windows"] .titlebar {
  border-radius: 8px 8px 0 0 !important;
  height: 32px !important;
  background: rgba(255, 255, 255, 0.03) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html[data-os="mac"] .titlebar {
  border-radius: 14px 14px 0 0 !important;
  height: 36px !important;
  background: rgba(255, 255, 255, 0.02) !important;
}

html[data-os="mac"] .title {
  text-align: center !important;
  flex: 1 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}

html[data-os="windows"] .title {
  text-align: left !important;
  margin-left: 8px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
}

html[data-os="windows"] .content iframe {
  border-radius: 0 0 8px 8px !important;
}

html[data-os="mac"] .content iframe {
  border-radius: 0 0 14px 14px !important;
}

/* ============================================
   ADDITIONAL ANIMATIONS & POLISH
   ============================================ */

/* Smooth transitions for all interactive elements */
.dock-item,
.icon,
.label,
.traffic .btn,
.taskbar-btn,
.window {
  will-change: transform, opacity !important;
}

/* Ripple effect on click */
@keyframes ripple {
  from {
    transform: scale(0);
    opacity: 1;
  }

  to {
    transform: scale(2);
    opacity: 0;
  }
}

/* Hover glow on dock items */
html[data-os="mac"] .dock-item:hover .icon {
  filter: brightness(1.1) !important;
}

/* Mission Control / Task View effect */
.mission.show {
  animation: missionFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

@keyframes missionFadeIn {
  from {
    opacity: 0;
    backdrop-filter: blur(0);
  }

  to {
    opacity: 1;
    backdrop-filter: blur(14px) saturate(140%);
  }
}

/* Spotlight search animation */
.spotlight.show {
  animation: spotlightFadeIn 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

@keyframes spotlightFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.spotlight.show .box {
  animation: spotlightSlideDown 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

@keyframes spotlightSlideDown {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.9);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Toast notification enhancement */
.toast.show {
  animation: toastSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Context menu animation */
.context.show {
  animation: contextPop 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

@keyframes contextPop {
  from {
    opacity: 0;
    transform: scale(0.8);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Hide user name */
#tb-user-name {
  display: none !important;
}

/* Force hide dock-item labels - only show on hover */
.dock-item .label {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease !important;
}

.dock-item:hover .label {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Hide labels completely during dock loading */
.dock-item.active .label {
  opacity: 0 !important;
  visibility: hidden !important;
}

/* ============================================
   DOCK LOADING ANIMATION
   ============================================ */

/* Hide dock items until ready */
.dock:not(.dock-ready) .dock-item {
  opacity: 0 !important;
  transform: translateY(20px) scale(0.8) !important;
  transition: none !important;
}

/* When dock is ready, fade in items with stagger effect */
.dock.dock-ready .dock-item {
  opacity: 1 !important;
  transform: translateY(0) scale(1) !important;
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

/* Stagger animation for each item */
.dock.dock-ready .dock-item:nth-child(1) {
  transition-delay: 0.05s !important;
}

.dock.dock-ready .dock-item:nth-child(2) {
  transition-delay: 0.1s !important;
}

.dock.dock-ready .dock-item:nth-child(3) {
  transition-delay: 0.15s !important;
}

.dock.dock-ready .dock-item:nth-child(4) {
  transition-delay: 0.2s !important;
}

.dock.dock-ready .dock-item:nth-child(5) {
  transition-delay: 0.25s !important;
}

.dock.dock-ready .dock-item:nth-child(6) {
  transition-delay: 0.3s !important;
}

.dock.dock-ready .dock-item:nth-child(7) {
  transition-delay: 0.35s !important;
}

.dock.dock-ready .dock-item:nth-child(8) {
  transition-delay: 0.4s !important;
}

.dock.dock-ready .dock-item:nth-child(9) {
  transition-delay: 0.45s !important;
}

.dock.dock-ready .dock-item:nth-child(10) {
  transition-delay: 0.5s !important;
}

/* Windows taskbar - same effect for apps container */
html[data-os="windows"] #taskbar-apps-container:not(.dock-ready) .dock-item {
  opacity: 0 !important;
  transform: translateY(10px) scale(0.9) !important;
  transition: none !important;
}

html[data-os="windows"] #taskbar-apps-container.dock-ready .dock-item {
  opacity: 1 !important;
  transform: translateY(0) scale(1) !important;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

html[data-os="windows"] #taskbar-apps-container.dock-ready .dock-item:nth-child(1) {
  transition-delay: 0.03s !important;
}

html[data-os="windows"] #taskbar-apps-container.dock-ready .dock-item:nth-child(2) {
  transition-delay: 0.06s !important;
}

html[data-os="windows"] #taskbar-apps-container.dock-ready .dock-item:nth-child(3) {
  transition-delay: 0.09s !important;
}

html[data-os="windows"] #taskbar-apps-container.dock-ready .dock-item:nth-child(4) {
  transition-delay: 0.12s !important;
}

html[data-os="windows"] #taskbar-apps-container.dock-ready .dock-item:nth-child(5) {
  transition-delay: 0.15s !important;
}

html[data-os="windows"] #taskbar-apps-container.dock-ready .dock-item:nth-child(6) {
  transition-delay: 0.18s !important;
}

html[data-os="windows"] #taskbar-apps-container.dock-ready .dock-item:nth-child(7) {
  transition-delay: 0.21s !important;
}

html[data-os="windows"] #taskbar-apps-container.dock-ready .dock-item:nth-child(8) {
  transition-delay: 0.24s !important;
}

/* Exit animation class for smooth transitions */
.dock.dock-exiting .dock-item,
html[data-os="windows"] #taskbar-apps-container.dock-exiting .dock-item {
  opacity: 0 !important;
  transform: translateY(20px) scale(0.8) !important;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  transition-delay: 0s !important;
  /* No stagger on exit, all go at once or quickly */
}

/* ============================================
   WEBOS-STYLE WINDOW TRANSITIONS
   ============================================ */

/* Smooth transition between fullscreen and windowed */
.window {
  transition:
    left 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    top 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.2s ease,
    border-radius 0.2s ease !important;
}

/* Disable transition during drag/resize */
.window.dragging,
.window.resizing {
  transition: none !important;
}

/* Window content should adapt smoothly */
.window .content {
  transition: border-radius 0.2s ease !important;
}

/* Windowed mode content corners */
html[data-os="mac"] .window.windowed .content {
  border-radius: 0 0 14px 14px !important;
}

html[data-os="windows"] .window.windowed .content {
  border-radius: 0 0 8px 8px !important;
}

/* Multiple windows visible - ensure proper layering */
.wm {
  pointer-events: auto !important;
}

/* Inactive windows should be slightly dimmed */
.window:not(.active):not(.hidden) {
  filter: brightness(0.97) !important;
}

/* Active window glow effect (subtle) */
.window.active.windowed {
  box-shadow:
    0 25px 80px rgba(0, 0, 0, 0.6),
    0 10px 35px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.15),
    0 0 30px rgba(100, 150, 255, 0.08) !important;
}

/* Window snap preview (future feature) */
.window-snap-preview {
  position: absolute;
  background: rgba(100, 150, 255, 0.15);
  border: 2px dashed rgba(100, 150, 255, 0.5);
  border-radius: 12px;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.window-snap-preview.show {
  opacity: 1;
}

/* ============================================
   BOOT LOADER OVERLAY
   ============================================ */

.boot-loader {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 20%, rgba(80, 120, 255, 0.12), transparent 32%),
    radial-gradient(circle at 70% 60%, rgba(255, 140, 80, 0.12), transparent 34%),
    rgba(4, 6, 15, 0.7);
  backdrop-filter: blur(10px) saturate(1.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1200;
}

.boot-loader.visible {
  opacity: 1;
  pointer-events: all;
}

.boot-loader__glass {
  min-width: 320px;
  max-width: 540px;
  padding: 28px 28px 24px;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(18, 24, 40, 0.8), rgba(15, 21, 36, 0.72));
  box-shadow:
    0 20px 70px rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 1px 0 rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 14px;
  color: #e6ebff;
  text-align: center;
}

.boot-loader__spinner {
  width: 72px;
  height: 72px;
  margin: 0 auto 6px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.08);
  border-top-color: #5ed0ff;
  border-right-color: #8b79ff;
  border-bottom-color: #ffb36b;
  animation: bootSpin 1.1s linear infinite;
  box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.02);
}

.boot-loader__text {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.boot-loader__sub {
  font-size: 13px;
  color: #c8d2ff;
  opacity: 0.9;
}

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