﻿/* ui.css - Modals, Fullscreen Viewer, Toast, Skeleton, Theme Toggle, Tabs */

/* =======================================================================
   23. MODALS & DIALOGS
   ======================================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: hsl(var(--card));
  border-radius: 0.75rem;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: fadeIn 0.2s;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid hsl(var(--border));
}

.modal-body {
  padding: 1.25rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid hsl(var(--border));
}

/* =======================================================================
   24. FULLSCREEN VIEWER
   ======================================================================= */
.fullscreen-viewer {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.fullscreen-viewer.active {
  display: flex;
}

.fullscreen-viewer img {
  max-width: 95%;
  max-height: 95vh;
  object-fit: contain;
  cursor: default;
}

.fullscreen-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =======================================================================
   25. TOAST NOTIFICATIONS
   ======================================================================= */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 0.875rem 1.125rem;
  box-shadow: var(--shadow-lg), 0 0 0 1px hsl(var(--border) / 0.5);
  min-width: 300px;
  animation: toastSlideIn 0.5s var(--spring);
  pointer-events: auto;
  display: flex;
  align-items: start;
  gap: 0.625rem;
  transition: all 0.3s var(--spring);
}

.toast.success {
  border-left: 3px solid hsl(var(--primary));
}

.toast.error {
  border-left: 3px solid hsl(var(--destructive));
}

.toast-title {
  font-weight: 600;
  font-size: 0.875rem;
}

.toast-message {
  font-size: 0.8125rem;
  color: hsl(var(--muted-fg));
}

/* =======================================================================
   26. SKELETON LOADING
   ======================================================================= */
.skeleton {
  background: linear-gradient(90deg, hsl(var(--muted)) 25%, hsl(var(--muted-fg) / 0.05) 50%, hsl(var(--muted)) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

/* =======================================================================
   27. THEME TOGGLE
   ======================================================================= */
.theme-toggle {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: hsl(var(--fg));
  cursor: pointer;
  transition: all 0.3s var(--spring);
}

.theme-toggle:hover {
  background: hsl(var(--accent));
  transform: rotate(15deg);
}

.theme-toggle:active {
  transform: rotate(-15deg) scale(0.9);
}

/* Swap moon/sun icons based on dark mode */
.dark .theme-icon-moon {
  display: none !important;
}

.dark .theme-icon-sun {
  display: block !important;
}

html:not(.dark) .theme-icon-moon {
  display: block;
}

html:not(.dark) .theme-icon-sun {
  display: none !important;
}

/* =======================================================================
   28. TABS
   ======================================================================= */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid hsl(var(--border));
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: hsl(var(--muted-fg));
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  transition: all 0.15s;
}

.tab:hover {
  color: hsl(var(--fg));
}

.tab.active {
  color: hsl(var(--primary));
  border-bottom-color: hsl(var(--primary));
}

