:root {
  /* --- WEINOS 2.0 PALETTE --- */
  --bg-gradient: linear-gradient(135deg, #FF9A9E 0%, #FECFEF 99%, #FECFEF 100%);
  --bg-image: url('https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?q=80&w=2564&auto=format&fit=crop');

  --glass-base: rgba(255, 255, 255, 0.15);
  --glass-border: rgba(255, 255, 255, 0.2);
  --glass-highlight: rgba(255, 255, 255, 0.5);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);

  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);

  --accent-color: #007AFF;
  /* macOS Blue */
  --danger-color: #FF3B30;

  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-drag: none;
}

body,
html {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-main);
  color: var(--text-primary);
  background: #000;
}

/* --- WALLPAPER --- */
.wallpaper {
  position: absolute;
  inset: 0;
  background: #0f0c29;
  z-index: -1;
  overflow: hidden;
}

.wallpaper::before,
.wallpaper::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.6;
  animation: float 20s infinite alternate;
}

.wallpaper::before {
  width: 60vw;
  height: 60vw;
  background: #302b63;
  top: -10%;
  left: -10%;
  animation-duration: 25s;
}

.wallpaper::after {
  width: 50vw;
  height: 50vw;
  background: #24243e;
  bottom: -10%;
  right: -10%;
  animation-duration: 30s;
}

/* Extra blob for the "purple spot" */
.wallpaper-blob {
  position: absolute;
  width: 40vw;
  height: 40vw;
  background: #8e2de2;
  /* Purple */
  border-radius: 50%;
  filter: blur(100px);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.4;
  animation: pulseMove 15s infinite alternate ease-in-out;
}

@keyframes float {
  0% {
    transform: translate(0, 0);
  }

  100% {
    transform: translate(50px, 50px);
  }
}

@keyframes pulseMove {
  0% {
    transform: translate(-50%, -50%) scale(1);
    background: #8e2de2;
  }

  50% {
    transform: translate(-40%, -60%) scale(1.2);
    background: #4a00e0;
    /* Darker Blue/Purple */
  }

  100% {
    transform: translate(-60%, -40%) scale(1);
    background: #8e2de2;
  }
}

/* --- TOP BAR --- */
.top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 32px;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 1000;
  font-size: 14px;
  font-weight: 500;
}

.top-left {
  display: flex;
  gap: 20px;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.5px;
}

.top-right {
  display: flex;
  gap: 20px;
}

/* --- DESKTOP AREA --- */
.desktop-area {
  position: absolute;
  top: 32px;
  bottom: 80px;
  /* Space for Dock */
  left: 0;
  right: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 20px;
  pointer-events: none;
  /* Let clicks pass through to windows */
}

.desktop-icon {
  width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.desktop-icon:hover {
  transform: scale(1.05);
}

.desktop-icon .icon-bg {
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 32px;
  backdrop-filter: blur(5px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: background 0.2s;
}

.desktop-icon:hover .icon-bg {
  background: rgba(255, 255, 255, 0.25);
}

.desktop-icon span {
  font-size: 13px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  text-align: center;
  line-height: 1.2;
}

/* --- WINDOWS --- */
.window-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.window {
  position: absolute;
  width: 800px;
  height: 600px;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: auto;
  animation: windowOpen 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: center;
}

@keyframes windowOpen {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }

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

.window.closing {
  animation: windowClose 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes windowClose {
  to {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
}

.window.minimized {
  opacity: 0;
  transform: scale(0.5) translateY(200px);
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.title-bar {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

.control-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
}

.control-btn.close {
  background: #FF5F56;
  border: 1px solid #E0443E;
}

.control-btn.min {
  background: #FFBD2E;
  border: 1px solid #DEA123;
}

.control-btn.max {
  background: #27C93F;
  border: 1px solid #1AAB29;
}

.control-btn:hover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 50%;
}

.window-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  font-weight: 600;
  color: #333;
  opacity: 0.8;
}

.window-content {
  flex: 1;
  background: rgba(255, 255, 255, 0.5);
  position: relative;
}

.window-content iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* --- DOCK --- */
.dock-container {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 1000;
}

.dock {
  background: var(--dock-bg);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid var(--dock-border);
  border-radius: 24px;
  padding: 12px;
  display: flex;
  gap: 12px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  transition: width 0.3s ease;
}

.dock-item {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  display: grid;
  place-items: center;
  font-size: 24px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.dock-item:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-10px) scale(1.1);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.dock-item.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
}

.dock-tooltip {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  white-space: nowrap;
}

.dock-item:hover .dock-tooltip {
  opacity: 1;
}

/* --- BOOT SCREEN --- */
.boot-screen {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: auto;
  animation: windowOpen 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: center;
}

@keyframes windowOpen {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }

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

.window.closing {
  animation: windowClose 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes windowClose {
  to {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
}

.window.minimized {
  opacity: 0;
  transform: scale(0.5) translateY(200px);
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.title-bar {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

.control-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
}

.control-btn.close {
  background: #FF5F56;
  border: 1px solid #E0443E;
}

.control-btn.min {
  background: #FFBD2E;
  border: 1px solid #DEA123;
}

.control-btn.max {
  background: #27C93F;
  border: 1px solid #1AAB29;
}

.control-btn:hover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 50%;
}

.window-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  font-weight: 600;
  color: #333;
  opacity: 0.8;
}

.window-content {
  flex: 1;
  background: rgba(255, 255, 255, 0.5);
  position: relative;
}

.window-content iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* --- DOCK --- */
.dock-container {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 1000;
}

.dock {
  background: var(--dock-bg);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid var(--dock-border);
  border-radius: 24px;
  padding: 12px;
  display: flex;
  gap: 12px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  transition: width 0.3s ease;
}

.dock-item {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  display: grid;
  place-items: center;
  font-size: 24px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.dock-item:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-10px) scale(1.1);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.dock-item.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
}

.dock-tooltip {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  white-space: nowrap;
}

.dock-item:hover .dock-tooltip {
  opacity: 1;
}

/* --- BOOT SCREEN --- */
.boot-screen {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: opacity 0.8s ease;
}

.boot-logo {
  font-size: 48px;
  font-weight: 800;
  background: linear-gradient(135deg, #00C6FF, #0072FF);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 20px;
  letter-spacing: -1px;
  text-align: center;
}

.loader {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #007AFF;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

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

/* --- RESIZE HANDLES --- */
.resize-handle {
  position: absolute;
  z-index: 100;
}

.resize-handle.n {
  top: -5px;
  left: 0;
  right: 0;
  height: 10px;
  cursor: ns-resize;
}

.resize-handle.s {
  bottom: -5px;
  left: 0;
  right: 0;
  height: 10px;
  cursor: ns-resize;
}

.resize-handle.e {
  top: 0;
  bottom: 0;
  right: -5px;
  width: 10px;
  cursor: ew-resize;
}

.resize-handle.w {
  top: 0;
  bottom: 0;
  left: -5px;
  width: 10px;
  cursor: ew-resize;
}

.resize-handle.ne {
  top: -5px;
  right: -5px;
  width: 15px;
  height: 15px;
  cursor: ne-resize;
}

.resize-handle.nw {
  top: -5px;
  left: -5px;
  width: 15px;
  height: 15px;
  cursor: nw-resize;
}

.resize-handle.se {
  bottom: -5px;
  right: -5px;
  width: 15px;
  height: 15px;
  cursor: se-resize;
}

.resize-handle.sw {
  bottom: -5px;
  left: -5px;
  width: 15px;
  height: 15px;
  cursor: sw-resize;
}