/* system-window.css — macOS-style window frame for SwissTD system views */

/* ═══════════════════════════════════════════════════ */
/* System Window Frame                                 */
/* ═══════════════════════════════════════════════════ */

.swtd-window {
  background: var(--swtd-card);
  border: 1px solid var(--swtd-border);
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: var(--swtd-shadow);
}

/* System accent color mapping via data-system attribute */
.swtd-window[data-system="shop"]     { --system-accent: var(--swtd-red); }
.swtd-window[data-system="pay"]      { --system-accent: var(--swtd-success); }
.swtd-window[data-system="log"]      { --system-accent: var(--swtd-warning); }
.swtd-window[data-system="post"]     { --system-accent: var(--swtd-muted); }
.swtd-window[data-system="fin"]      { --system-accent: var(--swtd-red-light); }
.swtd-window[data-system="elements"] { --system-accent: var(--swtd-red); }
.swtd-window[data-system="play-info"]{ --system-accent: var(--swtd-red); }

/* Window Header */
.swtd-window-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--swtd-dark);
  user-select: none;
}

/* Traffic light dots */
.swtd-window-dots {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-shrink: 0;
}

.swtd-window-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 9999px;
}

.swtd-window-dot-red    { background: rgba(239, 68, 68, 0.7); }
.swtd-window-dot-yellow { background: rgba(234, 179, 8, 0.7); }
.swtd-window-dot-green  { background: rgba(34, 197, 94, 0.7); }

/* Title area */
.swtd-window-title {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--swtd-light);
  white-space: nowrap;
}

.swtd-window-subtitle {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 0.6875rem;
  color: var(--swtd-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Fullscreen button */
.swtd-window-fullscreen {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.375rem;
  border: 1px solid var(--swtd-border);
  background: transparent;
  color: var(--swtd-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  font-size: 0.875rem;
  line-height: 1;
}

.swtd-window-fullscreen:hover {
  border-color: var(--system-accent, var(--swtd-red));
  color: var(--swtd-light);
  background: rgba(255, 255, 255, 0.05);
}

/* Accent color line under header */
.swtd-window-accent {
  height: 2px;
  background: var(--system-accent, var(--swtd-red));
  opacity: 0.6;
}

/* Content area */
.swtd-window-content {
  padding: 1.5rem;
}

/* Entrance animation */
.swtd-window-entering {
  animation: swtd-windowEnter 0.4s ease forwards;
}

@keyframes swtd-windowEnter {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .swtd-window {
    margin: 0.5rem;
    border-radius: 0.5rem;
  }
  .swtd-window-header {
    padding: 0.625rem 0.75rem;
  }
  .swtd-window-content {
    padding: 1rem;
  }
  .swtd-window-subtitle {
    display: none;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .swtd-window-entering {
    animation: none;
    opacity: 1;
    transform: none;
  }
}
body.swtd-reduce-motion .swtd-window-entering {
  animation: none;
  opacity: 1;
  transform: none;
}
