/* ═══════════════════════════════════════════════════════════
   FileOS Desktop — Desktop Shell CSS
   Windows 11-style OS landing page
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── CSS Custom Properties ── */
:root {
  --bg-base: #0a0a14;
  --bg-surface: #1a1a2e;
  --bg-elevated: #22223a;
  --bg-taskbar: rgba(30, 30, 50, 0.82);
  --bg-start-menu: rgba(28, 28, 46, 0.92);
  --bg-window: rgba(32, 32, 52, 0.95);
  --bg-window-titlebar: rgba(24, 24, 40, 0.98);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --bg-glass-hover: rgba(255, 255, 255, 0.08);
  --bg-glass-active: rgba(255, 255, 255, 0.12);

  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-light: rgba(255, 255, 255, 0.12);
  --border-focus: #0078d4;

  --accent: #0078d4;
  --accent-hover: #1a8ae8;
  --accent-light: rgba(0, 120, 212, 0.15);
  --accent-glow: rgba(0, 120, 212, 0.25);

  --text-primary: #e4e4e8;
  --text-secondary: #9898a8;
  --text-muted: #6b6b7b;
  --text-inverse: #0a0a14;

  --red: #e81123;
  --red-hover: #f1707a;
  --green: #16c60c;
  --yellow: #f7c948;
  --orange: #f08c00;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.5);
  --shadow-window: 0 8px 40px rgba(0, 0, 0, 0.55), 0 0 1px rgba(255,255,255,0.1);

  --blur-sm: blur(10px);
  --blur-md: blur(20px);
  --blur-lg: blur(30px);
  --blur-xl: blur(40px);

  --taskbar-height: 48px;
  --font-family: 'Segoe UI Variable', 'Segoe UI', Inter, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Cascadia Code', 'JetBrains Mono', 'Fira Code', monospace;

  --z-desktop: 1;
  --z-icons: 10;
  --z-rubber-band: 50;
  --z-windows: 100;
  --z-taskbar: 500;
  --z-start-menu: 600;
  --z-context-menu: 700;
  --z-tooltip: 800;
  --z-notification: 900;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-family);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
  cursor: default;
}

/* ── Desktop Container ── */
#desktop {
  position: fixed;
  inset: 0;
  z-index: var(--z-desktop);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}

/* ── Desktop Icon Area ── */
#desktop-icons {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: var(--taskbar-height);
  z-index: var(--z-icons);
  padding: 12px;
  overflow: hidden;
}

/* ── Rubber Band Selection ── */
#rubber-band {
  position: absolute;
  border: 1px solid var(--accent);
  background: var(--accent-light);
  z-index: var(--z-rubber-band);
  pointer-events: none;
  display: none;
  border-radius: 2px;
}

/* ── Window Layer ── */
#window-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: var(--taskbar-height);
  z-index: var(--z-windows);
  pointer-events: none;
}

#window-layer > * {
  pointer-events: auto;
}

/* ═══════════════════════════════════════
   TASKBAR
   ═══════════════════════════════════════ */
#taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--taskbar-height);
  z-index: var(--z-taskbar);
  background: var(--bg-taskbar);
  backdrop-filter: var(--blur-xl);
  -webkit-backdrop-filter: var(--blur-xl);
  border-top: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  padding: 0 8px;
}

.taskbar-left {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
}

.taskbar-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1 1 auto;
}

.taskbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

/* ── Start Button ── */
.start-button {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-primary);
  transition: background 0.15s ease;
}

.start-button:hover {
  background: var(--bg-glass-hover);
}

.start-button:active {
  background: var(--bg-glass-active);
}

.start-button.active {
  background: var(--accent-light);
}

.start-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* ── Search Button ── */
.search-button {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-secondary);
  transition: background 0.15s ease;
}

.search-button:hover {
  background: var(--bg-glass-hover);
}

/* ── Taskbar App Buttons ── */
.taskbar-app {
  height: 40px;
  min-width: 40px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 12px;
  transition: background 0.15s ease;
  position: relative;
}

.taskbar-app:hover {
  background: var(--bg-glass-hover);
}

.taskbar-app:active {
  background: var(--bg-glass-active);
}

.taskbar-app.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

.taskbar-app.active {
  background: var(--bg-glass);
}

.taskbar-app-icon {
  font-size: 18px;
  line-height: 1;
}

/* ── System Tray ── */
.system-tray {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s ease;
}

.system-tray:hover {
  background: var(--bg-glass-hover);
}

.tray-icon {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ── Clock ── */
.taskbar-clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 4px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s ease;
  min-width: 72px;
}

.taskbar-clock:hover {
  background: var(--bg-glass-hover);
}

.clock-time {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
}

.clock-date {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.3;
}

/* ═══════════════════════════════════════
   START MENU
   ═══════════════════════════════════════ */
#start-menu {
  position: fixed;
  bottom: calc(var(--taskbar-height) + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  width: 640px;
  max-height: 680px;
  z-index: var(--z-start-menu);
  background: var(--bg-start-menu);
  backdrop-filter: var(--blur-xl);
  -webkit-backdrop-filter: var(--blur-xl);
  border: 1px solid var(--border-glass-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#start-menu.visible {
  display: flex;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Start Menu Search ── */
.start-search {
  padding: 24px 24px 16px;
}

.start-search-input {
  width: 100%;
  height: 36px;
  padding: 0 16px 0 40px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass-light);
  border-radius: 20px;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease;
}

.start-search-input::placeholder {
  color: var(--text-muted);
}

.start-search-input:focus {
  border-color: var(--accent);
}

.start-search-wrapper {
  position: relative;
}

.start-search-wrapper::before {
  content: '🔍';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  pointer-events: none;
}

/* ── Pinned Apps ── */
.start-section {
  padding: 0 24px 16px;
}

.start-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.start-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.start-section-action {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-glass);
  border: none;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-family);
  transition: background 0.15s ease;
}

.start-section-action:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
}

/* ── Pinned Grid ── */
.pinned-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}

.pinned-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 4px;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-family);
  transition: background 0.15s ease;
}

.pinned-app:hover {
  background: var(--bg-glass-hover);
}

.pinned-app-icon {
  font-size: 28px;
  line-height: 1;
}

.pinned-app-label {
  font-size: 11px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 80px;
  color: var(--text-secondary);
}

/* ── All Apps List ── */
.start-divider {
  height: 1px;
  background: var(--border-glass);
  margin: 0 24px;
}

.all-apps-list {
  padding: 8px 24px 16px;
  overflow-y: auto;
  max-height: 300px;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-glass-active) transparent;
}

.all-apps-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 13px;
  width: 100%;
  text-align: left;
  transition: background 0.15s ease;
}

.all-apps-item:hover {
  background: var(--bg-glass-hover);
}

.all-apps-item-icon {
  font-size: 22px;
  width: 32px;
  text-align: center;
  flex-shrink: 0;
}

/* ── Start Menu Footer ── */
.start-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-top: 1px solid var(--border-glass);
}

.start-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s ease;
}

.start-user:hover {
  background: var(--bg-glass-hover);
}

.start-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

.start-user-name {
  font-size: 13px;
  font-weight: 500;
}

.start-power {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 16px;
  transition: background 0.15s ease;
}

.start-power:hover {
  background: var(--bg-glass-hover);
}

/* ═══════════════════════════════════════
   BOOT SCREEN
   ═══════════════════════════════════════ */
#boot-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  transition: opacity 0.6s ease;
}

#boot-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.boot-logo {
  font-size: 48px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #6366f1, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
}

.boot-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--bg-glass-hover);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* ═══════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@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);
  }
}

/* ═══════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════ */
::-webkit-scrollbar {
  width: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--bg-glass-active);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* ═══════════════════════════════════════
   NOTIFICATION TOAST
   ═══════════════════════════════════════ */
.notification-toast {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: var(--z-notification);
  background: var(--bg-window);
  backdrop-filter: var(--blur-md);
  border: 1px solid var(--border-glass-light);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-md);
  animation: fadeInUp 0.3s ease;
  max-width: 360px;
}

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

.notification-body {
  font-size: 12px;
  color: var(--text-secondary);
}
