/*
 * styles.css — Digital Wardrobe
 * Clueless/Cher wardrobe aesthetic — retro 90s vibe, fun colors
 * Responsive: 320px to 2560px
 * WCAG 2.1 Level AA contrast and target-size compliance
 */

/* ── CSS Custom Properties ── */
:root {
  /* 90s Clueless palette */
  --pink-hot: #ff69b4;
  --pink-light: #ffb6c1;
  --pink-pastel: #fce4ec;
  --yellow-90s: #fff176;
  --yellow-light: #fffde7;
  --purple-90s: #ce93d8;
  --purple-deep: #7b1fa2;
  --blue-baby: #90caf9;
  --blue-sky: #e3f2fd;
  --mint-green: #a5d6a7;
  --coral: #ff8a65;

  /* Neutrals */
  --white: #ffffff;
  --off-white: #fafafa;
  --gray-50: #f5f5f5;
  --gray-100: #eeeeee;
  --gray-200: #e0e0e0;
  --gray-300: #bdbdbd;
  --gray-500: #757575;
  --gray-700: #616161;
  --gray-800: #424242;
  --gray-900: #212121;

  /* Semantic */
  --bg-primary: var(--pink-pastel);
  --bg-card: var(--white);
  --bg-neutral: var(--gray-50);
  --text-primary: var(--gray-900);
  --text-secondary: var(--gray-700);
  --text-muted: var(--gray-500);
  --accent-primary: var(--pink-hot);
  --accent-secondary: var(--purple-deep);
  --accent-tertiary: var(--coral);
  --border-color: var(--gray-200);
  --error-color: #d32f2f;
  --error-bg: #ffebee;
  --success-color: #2e7d32;
  --success-bg: #e8f5e9;

  /* Typography */
  --font-display: 'Pacifico', cursive;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Sizing */
  --nav-height: 60px;
  --max-width: 1200px;
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --border-radius-lg: 20px;

  /* WCAG AA minimum target size */
  --min-target: 44px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --shadow-glow: 0 0 20px rgba(255,105,180,0.3);
}

/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent-secondary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* ── Screen Reader Only ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}


/* ── Auth Screen ── */
.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--pink-pastel) 0%, var(--yellow-light) 50%, var(--blue-sky) 100%);
}

.auth-card {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  padding: var(--space-2xl);
  text-align: center;
  box-shadow: var(--shadow-lg);
  max-width: 400px;
  width: 90%;
}

.auth-logo {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--accent-primary);
  margin-bottom: var(--space-sm);
}

.auth-tagline {
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: var(--space-lg);
}

.auth-error {
  background: var(--error-bg);
  color: var(--error-color);
  padding: var(--space-md);
  border-radius: var(--border-radius-sm);
  margin-bottom: var(--space-md);
  font-weight: 500;
}

.auth-loading {
  color: var(--text-muted);
}

/* ── Navigation ── */
.main-nav {
  background: var(--white);
  border-bottom: 2px solid var(--pink-light);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  color: var(--text-primary);
}

.nav-logo {
  font-size: 1.5rem;
}

.nav-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--accent-primary);
}

.nav-links {
  display: flex;
  gap: var(--space-xs);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--border-radius);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
  min-height: var(--min-target);
  min-width: var(--min-target);
  transition: background 0.2s, color 0.2s;
}

.nav-link:hover {
  background: var(--pink-pastel);
  color: var(--accent-primary);
  text-decoration: none;
}

.nav-link--active {
  background: var(--pink-pastel);
  color: var(--accent-primary);
  font-weight: 600;
}

.nav-icon {
  font-size: 1.1rem;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
  min-height: var(--min-target);
  min-width: var(--min-target);
  align-items: center;
  justify-content: center;
}

.nav-toggle-bar {
  display: block;
  width: 24px;
  height: 3px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.2s;
}

/* ── Main Content ── */
.app {
  min-height: 100vh;
}

.view-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md);
  min-height: calc(100vh - var(--nav-height));
}

/* ── Section Titles ── */
.section-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--accent-primary);
  margin-bottom: var(--space-sm);
}

.section-subtitle {
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}


/* ── Forms ── */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--space-xs);
  color: var(--text-primary);
}

.form-label .optional {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.form-input,
.form-select {
  width: 100%;
  padding: 12px var(--space-md);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--white);
  min-height: var(--min-target);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(255,105,180,0.2);
}

.form-input--sm,
.form-select--sm {
  padding: 8px 12px;
  font-size: 0.9rem;
}

.form-hint {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

.form-error {
  color: var(--error-color);
  background: var(--error-bg);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--border-radius-sm);
  font-size: 0.9rem;
  margin-top: var(--space-sm);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px var(--space-lg);
  border: 2px solid transparent;
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  min-height: var(--min-target);
  min-width: var(--min-target);
  transition: all 0.2s;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--accent-primary);
  color: var(--white);
  border-color: var(--accent-primary);
}

.btn--primary:hover:not(:disabled) {
  background: #e91e8c;
  border-color: #e91e8c;
  box-shadow: var(--shadow-glow);
}

.btn--secondary {
  background: var(--white);
  color: var(--accent-secondary);
  border-color: var(--accent-secondary);
}

.btn--secondary:hover:not(:disabled) {
  background: #f3e5f5;
}

.btn--accent {
  background: var(--purple-deep);
  color: var(--white);
  border-color: var(--purple-deep);
}

.btn--accent:hover:not(:disabled) {
  background: #6a1b9a;
}

.btn--outline {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-color);
}

.btn--outline:hover:not(:disabled) {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.btn--danger {
  background: var(--white);
  color: var(--error-color);
  border-color: var(--error-color);
}

.btn--danger:hover:not(:disabled) {
  background: var(--error-bg);
}

.btn--sm {
  padding: 8px var(--space-md);
  font-size: 0.85rem;
}

.btn--full {
  width: 100%;
}

/* ── Upload Form ── */
.upload-form {
  max-width: 500px;
  margin: 0 auto;
  background: var(--bg-card);
  padding: var(--space-xl);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
}

.file-drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-xl);
  border: 3px dashed var(--pink-light);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  min-height: 120px;
}

.file-drop-zone:hover,
.file-drop-zone:focus {
  border-color: var(--accent-primary);
  background: var(--pink-pastel);
}

.file-drop-zone.drop-active {
  border-color: var(--accent-primary);
  background: var(--pink-pastel);
}

.drop-icon {
  font-size: 2rem;
}

.drop-text {
  font-weight: 500;
  color: var(--text-secondary);
}

.drop-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}

.file-preview {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--gray-50);
  border-radius: var(--border-radius-sm);
  margin-top: var(--space-sm);
}

.file-preview-img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--border-radius-sm);
}

.file-preview-name {
  font-weight: 500;
  font-size: 0.9rem;
}

.file-preview-size {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.upload-progress {
  margin-bottom: var(--space-md);
}

.progress-bar {
  height: 8px;
  background: var(--gray-100);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: var(--space-xs);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--purple-90s));
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}


/* ── Gallery ── */
.gallery-wrapper {
  width: 100%;
}

.gallery-controls {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
  align-items: center;
}

.gallery-filter {
  flex: 0 0 auto;
}

.gallery-search {
  flex: 1;
  min-width: 180px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}

.gallery-card {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.gallery-card:hover,
.gallery-card:focus {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.gallery-card__img-wrap {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--gray-50);
}

.gallery-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-card__info {
  padding: var(--space-sm) var(--space-md);
}

.gallery-card__name {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-card__category {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.gallery-empty {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-muted);
}

.empty-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: var(--space-md);
}

.gallery-loading {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-muted);
}

/* ── Placeholder Image ── */
.placeholder-image {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  background: var(--gray-50);
  color: var(--text-muted);
  width: 100%;
  height: 100%;
  min-height: 100px;
  padding: var(--space-md);
}

.placeholder-image--lg {
  min-height: 200px;
}

.placeholder-icon {
  font-size: 2rem;
}

.placeholder-text {
  font-size: 0.8rem;
}

/* ── Loading Spinner ── */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Modals ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: var(--space-md);
  backdrop-filter: blur(4px);
}

.modal-content {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  padding: var(--space-xl);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.modal-content--wide {
  max-width: 700px;
}

.modal-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  min-height: var(--min-target);
  min-width: var(--min-target);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.modal-close:hover {
  background: var(--gray-100);
  color: var(--text-primary);
}

.modal-img-wrap {
  border-radius: var(--border-radius);
  overflow: hidden;
  margin-bottom: var(--space-lg);
  background: var(--gray-50);
}

.modal-img {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--accent-primary);
  margin-bottom: var(--space-md);
  padding-right: var(--space-xl);
}

.modal-category,
.modal-date {
  margin-bottom: var(--space-sm);
  color: var(--text-secondary);
}

.modal-tags {
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
}

.color-tag {
  display: inline-block;
  background: var(--yellow-light);
  color: var(--gray-800);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  margin: 2px;
  border: 1px solid var(--yellow-90s);
}

.modal-actions {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-lg);
  flex-wrap: wrap;
}

.edit-form .form-group {
  margin-bottom: var(--space-md);
}


/* ── Outfit Builder ── */
.builder-wrapper {
  width: 100%;
}

.builder-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: start;
}

.builder-lanes {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.builder-loading {
  text-align: center;
  padding: var(--space-xl);
  color: var(--text-muted);
}

.builder-lane {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  border: 2px solid transparent;
  transition: border-color 0.2s;
}

.builder-lane--selected {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

.lane-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}

.lane-category {
  font-weight: 600;
  font-size: 0.95rem;
}

.lane-counter {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.lane-content {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: 100px;
}

.lane-nav {
  background: var(--white);
  border: 2px solid var(--border-color);
  border-radius: 50%;
  width: var(--min-target);
  height: var(--min-target);
  min-width: var(--min-target);
  min-height: var(--min-target);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
  flex-shrink: 0;
}

.lane-nav:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--pink-pastel);
}

.lane-item {
  flex: 1;
  text-align: center;
}

.lane-img-wrap {
  width: 100px;
  height: 100px;
  margin: 0 auto var(--space-xs);
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  background: var(--gray-50);
}

.lane-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lane-item-name {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
  margin: 0 auto;
}

.lane-empty {
  flex: 1;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: var(--space-lg);
}

.lane-select-btn {
  margin-top: var(--space-sm);
  width: 100%;
}

/* ── Outfit Preview Panel ── */
.builder-preview-panel {
  position: sticky;
  top: calc(var(--nav-height) + var(--space-lg));
}

.preview-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--accent-primary);
  margin-bottom: var(--space-md);
}

.builder-preview {
  background: var(--bg-neutral);
  border-radius: var(--border-radius);
  padding: var(--space-lg);
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.preview-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
}

.preview-item {
  text-align: center;
  width: 100%;
  max-width: 200px;
}

.preview-item-img {
  width: 100%;
  max-height: 150px;
  object-fit: contain;
  border-radius: var(--border-radius-sm);
}

.preview-item-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.builder-save {
  margin-top: var(--space-lg);
}

/* ── Saved Outfits ── */
.outfits-wrapper {
  width: 100%;
}

.outfits-controls {
  margin-bottom: var(--space-lg);
}

.outfits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-md);
}

.outfit-card {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.outfit-card:hover,
.outfit-card:focus {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.outfit-card__preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  aspect-ratio: 1;
  background: var(--gray-50);
  overflow: hidden;
}

.outfit-card__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.outfit-card__info {
  padding: var(--space-sm) var(--space-md);
}

.outfit-card__name {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.outfit-card__count {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Outfit Detail Modal ── */
.outfit-detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.outfit-detail-preview {
  background: var(--bg-neutral);
  border-radius: var(--border-radius);
  padding: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.outfit-detail-items h4 {
  font-size: 0.95rem;
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
}

.outfit-detail-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--gray-100);
}

.outfit-detail-item:last-child {
  border-bottom: none;
}

.outfit-detail-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--border-radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.outfit-detail-item-name {
  display: block;
  font-weight: 500;
  font-size: 0.9rem;
}

.outfit-detail-item-cat {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
}


/* ── Toast Notifications ── */
.toast {
  position: fixed;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--border-radius);
  font-weight: 500;
  font-size: 0.95rem;
  z-index: 300;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  box-shadow: var(--shadow-lg);
  max-width: 90%;
  text-align: center;
}

.toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast--info {
  background: var(--blue-sky);
  color: #1565c0;
  border: 1px solid var(--blue-baby);
}

.toast--success {
  background: var(--success-bg);
  color: var(--success-color);
  border: 1px solid var(--mint-green);
}

.toast--error {
  background: var(--error-bg);
  color: var(--error-color);
  border: 1px solid #ef9a9a;
}

/* ── Focus Styles (WCAG) ── */
:focus-visible {
  outline: 3px solid var(--accent-primary);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--accent-primary);
  outline-offset: 2px;
}

/* ── Responsive: Mobile (< 768px) ── */
@media (max-width: 767px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: var(--space-md);
    border-bottom: 2px solid var(--pink-light);
    box-shadow: var(--shadow-md);
  }

  .nav-links--open {
    display: flex;
  }

  .nav-link {
    padding: var(--space-md);
    border-radius: var(--border-radius-sm);
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }

  .gallery-controls {
    flex-direction: column;
  }

  .gallery-filter,
  .gallery-search {
    width: 100%;
  }

  .builder-layout {
    grid-template-columns: 1fr;
  }

  .builder-preview-panel {
    position: static;
  }

  .lane-img-wrap {
    width: 80px;
    height: 80px;
  }

  .outfit-detail-layout {
    grid-template-columns: 1fr;
  }

  .modal-content {
    padding: var(--space-lg);
    margin: var(--space-sm);
  }

  .modal-content--wide {
    max-width: 100%;
  }

  .section-title {
    font-size: 1.4rem;
  }

  .upload-form {
    padding: var(--space-lg);
  }

  .outfits-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Responsive: Small mobile (< 375px) ── */
@media (max-width: 374px) {
  :root {
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 24px;
  }

  .nav-title {
    font-size: 1rem;
  }

  .section-title {
    font-size: 1.2rem;
  }

  .gallery-grid {
    gap: var(--space-xs);
  }

  .gallery-card__info {
    padding: var(--space-xs) var(--space-sm);
  }
}

/* ── Responsive: Tablet (768px - 1023px) ── */
@media (min-width: 768px) and (max-width: 1023px) {
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .builder-layout {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Responsive: Large desktop (≥ 1440px) ── */
@media (min-width: 1440px) {
  :root {
    --max-width: 1400px;
  }

  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
  }
}

/* ── Responsive: Ultra-wide (≥ 2560px) ── */
@media (min-width: 2560px) {
  :root {
    --max-width: 1800px;
  }

  html {
    font-size: 18px;
  }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Print ── */
@media print {
  .main-nav,
  .gallery-controls,
  .modal-overlay,
  .toast,
  .btn {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }
}

/* ── Bulk Select Bar ── */
.gallery-bulk-bar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--yellow-light);
  border: 2px solid var(--yellow-90s);
  border-radius: var(--border-radius);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

#gallery-selected-count {
  font-weight: 600;
  color: var(--text-primary);
}

/* ── Selected Card State ── */
.gallery-card--selected {
  outline: 3px solid var(--accent-primary);
  outline-offset: 2px;
  box-shadow: var(--shadow-glow);
}

.gallery-card__checkbox {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  font-size: 1.4rem;
  z-index: 2;
  background: rgba(255,255,255,0.85);
  border-radius: 4px;
  padding: 0 4px;
  line-height: 1;
}

.gallery-card {
  position: relative;
}
