/* desktop.css — Window chrome, taskbar, icons, wallpaper */

/* Desktop canvas */
.desktop {
  position: fixed;
  inset: 0;
  background: url('../assets/wallpaper.png') center/cover no-repeat;
  z-index: var(--z-desktop);
  overflow: hidden;
}

/* Grainy texture overlay */
.desktop::before {
  content: "";
  position: fixed;
  inset: 0;
  opacity: 0.22;
  pointer-events: none;
  z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Icon grid */
.desktop-icons {
  position: absolute;
  top: 24px;
  left: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: calc(var(--z-desktop) + 2);
}

.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 84px;
  padding: 10px 4px;
  border-radius: var(--radius-icon);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.desktop-icon:hover {
  background: var(--bg-icon-hover);
}
.desktop-icon:active {
  background: rgba(0, 0, 0, 0.07);
}

.desktop-icon .icon-img {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}

.desktop-icon .icon-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  line-height: 1.3;
  word-break: break-word;
  max-width: 80px;
}

/* Window — glass card */
.window {
  position: absolute;
  background: var(--bg-window);
  backdrop-filter: blur(25px) saturate(160%);
  -webkit-backdrop-filter: blur(25px) saturate(160%);
  border-radius: var(--radius-window);
  box-shadow: var(--shadow-window);
  border: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  min-width: 280px;
  min-height: 180px;
  overflow: hidden;
  transition: box-shadow var(--transition-fast);
}
.window.focused {
  box-shadow: var(--shadow-window-focused);
}
.window.minimizing {
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform: scale(0.5) translateY(100px);
  opacity: 0;
  pointer-events: none;
}
.window.maximized {
  border-radius: 0;
  transition: all 0.2s ease;
}

/* Window header */
.window-header {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 16px;
  background: var(--bg-window-header);
  border-bottom: 1px solid var(--border-subtle);
  cursor: default;
  flex-shrink: 0;
  gap: 10px;
}
.window.focused .window-header {
  background: var(--bg-window-header);
}
.window:not(.focused) .window-header {
  background: var(--bg-window-header-inactive);
}

/* Window controls — neutral monochrome */
.window-controls {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.window-control {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: none;
  padding: 0;
  cursor: pointer;
  position: relative;
  background: rgba(0, 0, 0, 0.12);
  transition: background var(--transition-fast);
}
.window-control:hover {
  background: rgba(0, 0, 0, 0.25);
}
.window-control::after {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-fast);
  color: rgba(0, 0, 0, 0.55);
  font-weight: 700;
}
.window:hover .window-control::after {
  opacity: 1;
}
.window-control.close::after {
  content: '\00D7';
  font-size: 11px;
  line-height: 13px;
  text-align: center;
}
.window-control.close:hover {
  background: rgba(0, 0, 0, 0.35);
}
.window-control.minimize::after {
  content: '\2013';
  font-size: 10px;
  line-height: 13px;
  text-align: center;
}
.window-control.maximize::after {
  content: '\002B';
  font-size: 10px;
  line-height: 13px;
  text-align: center;
}

.window:not(.focused) .window-control {
  background: rgba(0, 0, 0, 0.07);
}
.window:not(.focused) .window-control::after {
  color: rgba(0, 0, 0, 0.3);
}

.window-title {
  flex: 1;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}
.window:not(.focused) .window-title {
  color: var(--text-muted);
}

/* Spacer to balance traffic lights */
.window-header-spacer {
  width: 54px;
  flex-shrink: 0;
}

/* Window body */
.window-body {
  flex: 1;
  overflow: auto;
  padding: 24px;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-primary);
}
.window-body h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}
.window-body h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}
.window-body p {
  margin-bottom: 0.75rem;
}
.window-body ul, .window-body ol {
  margin-bottom: 0.75rem;
  padding-left: 1.5rem;
}
.window-body li {
  margin-bottom: 0.35rem;
}

/* Resize handles */
.window .resize-handle {
  position: absolute;
  z-index: 2;
}
.resize-handle.n  { top: -3px; left: 10px; right: 10px; height: 6px; cursor: n-resize; }
.resize-handle.s  { bottom: -3px; left: 10px; right: 10px; height: 6px; cursor: s-resize; }
.resize-handle.e  { right: -3px; top: 10px; bottom: 10px; width: 6px; cursor: e-resize; }
.resize-handle.w  { left: -3px; top: 10px; bottom: 10px; width: 6px; cursor: w-resize; }
.resize-handle.ne { top: -3px; right: -3px; width: 12px; height: 12px; cursor: ne-resize; }
.resize-handle.nw { top: -3px; left: -3px; width: 12px; height: 12px; cursor: nw-resize; }
.resize-handle.se { bottom: -3px; right: -3px; width: 12px; height: 12px; cursor: se-resize; }
.resize-handle.sw { bottom: -3px; left: -3px; width: 12px; height: 12px; cursor: sw-resize; }

/* Taskbar — floating dock pill */
.taskbar {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  right: auto;
  height: auto;
  background: var(--bg-taskbar);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 100px;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  z-index: var(--z-taskbar);
  box-shadow: var(--shadow-taskbar);
  gap: 6px;
  max-width: 90vw;
}

.taskbar-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px 0 6px;
  height: 34px;
  border-right: 1px solid rgba(0, 0, 0, 0.06);
  margin-right: 2px;
  flex-shrink: 0;
}
.taskbar-brand .brand-icon {
  font-size: 16px;
}
.taskbar-brand .brand-text {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.taskbar-windows {
  display: flex;
  gap: 2px;
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
}

.taskbar-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  height: 34px;
  border-radius: 100px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
}
.taskbar-item:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
}
.taskbar-item.active {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-primary);
  font-weight: 600;
}
.taskbar-item .item-icon {
  font-size: 14px;
}

.taskbar-clock {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0 8px 0 4px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* Mobile: stacked cards */
@media (max-width: 768px) {
  .desktop-icons {
    display: none;
  }

  .desktop {
    overflow-y: auto;
    padding: 16px;
    padding-bottom: 80px;
  }

  .window {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    margin-bottom: 12px;
    transform: none !important;
  }
  .window.minimizing {
    display: none;
  }

  .window-body {
    max-height: 60vh;
  }

  .resize-handle {
    display: none !important;
  }

  .taskbar {
    bottom: 16px;
    padding: 6px 10px;
  }
  .taskbar-windows {
    display: none;
  }
}

/* Comparison table */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  margin: 1rem 0;
}
.comparison-table th,
.comparison-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}
.comparison-table th {
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.comparison-table tr:last-child td {
  border-bottom: none;
}
.comparison-table .highlight {
  color: var(--text-primary);
  font-weight: 700;
}

/* Welcome window special styling */
.welcome-content {
  text-align: center;
  padding: 2rem 1.5rem;
}
.welcome-content h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}
.welcome-content .tagline {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 1.75rem;
}
.welcome-content .cta-group {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Getting started content */
.steps {
  counter-reset: step;
}
.steps .step {
  position: relative;
  padding-left: 2.5rem;
  margin-bottom: 1.25rem;
}
.steps .step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Example cards */
.example-list-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}
.example-card {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  padding: 14px 16px;
}
.example-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.example-icon {
  font-size: 24px;
}
.example-info {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.example-info strong {
  font-size: 0.95rem;
}
.example-size {
  font-size: 0.7rem;
  color: var(--text-primary);
  font-weight: 600;
  background: var(--accent-light);
  padding: 4px 10px;
  border-radius: 100px;
}
.example-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.4;
}
.example-code {
  background: rgba(0, 0, 0, 0.04);
  border-radius: 8px;
  padding: 10px 12px;
  overflow-x: auto;
  margin: 0;
}
.example-code code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--text-primary);
}

/* Showcase grid */
.showcase-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 16px;
}
@media (max-width: 768px) {
  .showcase-grid {
    grid-template-columns: 1fr;
  }
}
.showcase-card {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  padding: 14px 16px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.showcase-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}
.showcase-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.showcase-icon {
  font-size: 24px;
}
.showcase-meta {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.showcase-meta strong {
  font-size: 0.9rem;
}
.showcase-badge {
  font-size: 0.7rem;
  color: var(--text-primary);
  font-weight: 600;
  background: var(--accent-light);
  padding: 3px 9px;
  border-radius: 100px;
}
.showcase-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.4;
}
.showcase-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.showcase-tags span {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 100px;
}

/* Prompt cards */
.prompt-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}
.prompt-card {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  padding: 14px 16px;
}
.prompt-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.prompt-header strong {
  flex: 1;
  font-size: 0.9rem;
}
.prompt-icon {
  font-size: 20px;
}
.prompt-result {
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--accent-light);
  color: var(--text-primary);
  padding: 3px 9px;
  border-radius: 100px;
}
.prompt-text {
  background: rgba(0, 0, 0, 0.03);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.prompt-text p {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-secondary);
  font-style: italic;
  margin: 0;
}
.prompt-copy {
  font-size: 0.75rem;
  padding: 5px 14px;
}
