/* === Senior UX Foundation === */

html {
  font-size: 18px;
}
html.text-large {
  font-size: 21px;
}
html.text-xl {
  font-size: 24px;
}
html.text-xxl {
  font-size: 28px;
}

/* Ensure small text scales proportionally */
.badge, .text-muted, small, .small, .breadcrumb {
  font-size: max(0.85rem, 14px);
}

/* Skip to content link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: #ffc107;
  color: #000;
  padding: 0.75rem 1.5rem;
  z-index: 9999;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 0.375rem 0;
}
.skip-link:focus {
  top: 0;
}

/* Text-size toggle button — base sizing (colors in app-theme.css) */
.text-size-toggle {
  min-width: 44px;
  min-height: 44px;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Focus styles - visible 3px yellow outline */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn:focus-visible,
.nav-link:focus-visible,
.carousel-control-prev:focus-visible,
.carousel-control-next:focus-visible {
  outline: 3px solid #ffc107;
  outline-offset: 2px;
  box-shadow: none;
}

/* Touch targets — 48px minimum */
.btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-sm {
  min-height: 48px;
}
.nav-link {
  padding: 0.75rem !important;
}
.form-control,
.form-select {
  min-height: 48px;
}
.form-check-input {
  width: 1.25em;
  height: 1.25em;
}
.carousel-indicators button {
  width: 20px !important;
  height: 20px !important;
  border-radius: 50%;
  margin: 0 4px !important;
}

/* Admin dropdown larger touch targets */
.dropdown-item {
  padding: 0.6rem 1rem;
}

/* Password visibility toggle */
.password-wrapper {
  position: relative;
}
.password-toggle {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  background: transparent;
  border: none;
  padding: 0 0.75rem;
  color: #666;
  cursor: pointer;
  display: flex;
  align-items: center;
  min-height: 48px;
}
.password-toggle:hover {
  color: #333;
}

/* Image counter below carousel */
.carousel-counter {
  text-align: center;
  padding: 0.5rem 0;
  color: #666;
  font-size: 0.95rem;
}

/* Saved toast */
.saved-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #3d8b5e;
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}
.saved-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Breadcrumb mobile touch targets */
@media (max-width: 768px) {
  .breadcrumb-item a {
    padding: 0.25rem 0.1rem;
    display: inline-block;
  }
}

/* Memory/Story styles */
.family-story {
  transition: background-color 0.2s;
}
.family-story:hover {
  background-color: #faf0dc !important;
}

/* Spinner animation for loading state */
.bi-arrow-repeat.spin {
  display: inline-block;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Card breathing room */
.card-body {
  padding: 1rem;
}
.card-body .small, .card-body small {
  font-size: 0.9rem;
}

/* (Dark navbar + btn-success overrides removed — now in app-theme.css) */

/* === Card Image Areas === */

.card-img-top-wrap {
  height: 200px;
  overflow: hidden;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-img-top-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-img-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: #ccc;
  font-size: 3rem;
}

.card-img-placeholder.large {
  height: 400px;
  background: #f0f0f0;
  border-radius: 0.375rem;
  font-size: 4rem;
}

.card-img-placeholder.large div {
  font-size: 1rem;
  margin-top: 0.5rem;
}

.category-card {
  transition: transform 0.15s, box-shadow 0.15s;
}

.category-card:hover,
.category-card:focus-within {
  transform: translateY(-3px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

/* Always-visible selection buttons */
.item-card .select-btn {
  opacity: 1;
}

.select-btn.btn-success {
  opacity: 1;
}

#itemCarousel img {
  max-height: 500px;
  object-fit: contain;
  background: #f8f8f8;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
  background-color: rgba(0,0,0,0.5);
  border-radius: 50%;
  padding: 1.75rem;
  width: 56px;
  height: 56px;
}

.carousel-control-prev,
.carousel-control-next {
  width: 70px;
  opacity: 0.9;
}

/* Admin image grid */
.admin-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.admin-image-card {
  position: relative;
  border: 2px solid #dee2e6;
  border-radius: 0.375rem;
  padding: 0.25rem;
  text-align: center;
}

.admin-image-card.border-primary {
  border-color: #0d6efd;
}

.admin-image-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 0.25rem;
}

.admin-image-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
}

.admin-image-actions {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.25rem;
  justify-content: center;
}

/* Batch upload - drop zone */
.batch-drop-zone {
  border: 2px dashed #ccc;
  border-radius: 0.5rem;
  padding: 3rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}

.batch-drop-zone:hover,
.batch-drop-zone.dragover {
  border-color: #0d6efd;
  background-color: #f0f7ff;
}

/* Batch upload - preview grid */
.batch-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
}

.batch-preview-card {
  text-align: center;
}

.batch-preview-card img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 0.25rem;
  border: 1px solid #dee2e6;
}

/* Batch review cards */
.batch-review-img {
  height: 200px;
  object-fit: cover;
}

.batch-review-card {
  transition: opacity 0.2s;
}

.batch-review-card.batch-excluded {
  opacity: 0.45;
}

.confidence-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 0.75rem;
}

.batch-classifying-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem 0.375rem 0 0;
}

/* Video scan - drop zone */
.video-drop-zone {
  border: 2px dashed #ccc;
  border-radius: 0.5rem;
  padding: 3rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}

.video-drop-zone:hover,
.video-drop-zone.dragover {
  border-color: #0d6efd;
  background-color: #f0f7ff;
}

/* Voice-to-text button alignment within input-group */
.voice-to-text-btn {
  align-self: flex-start;
  min-height: 48px;
}

/* Voice pulse animation for recording indicator */
.voice-pulse {
  animation: voicePulse 1.2s ease-in-out infinite;
}
@keyframes voicePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* === Print Styles === */
@media print {
  .app-nav, .navbar, footer, .btn, .select-btn,
  .carousel-control-prev, .carousel-control-next,
  .carousel-indicators, .text-size-toggle {
    display: none !important;
  }
  .container {
    max-width: 100% !important;
    padding: 0 !important;
  }
  .row > [class*="col-"] {
    flex: 0 0 33.333%;
    max-width: 33.333%;
  }
  .card {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  body {
    font-size: 12pt;
    color: #000;
  }
  a {
    text-decoration: none !important;
    color: #000 !important;
  }
}
