/* ==========================================================================
   SATURDAYS — Component Styles
   ========================================================================== */

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: currentColor;
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-out);
}

.btn:hover::after {
  opacity: 0.08;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--color-brown);
  color: var(--color-cream);
}

.btn-primary:hover {
  background: var(--color-brown-dark);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: transparent;
  color: var(--color-brown);
  border: 1.5px solid var(--color-border-strong);
}

.btn-secondary:hover {
  border-color: var(--color-brown);
  background: var(--color-gold-muted);
}

.btn-warm {
  background: var(--color-terracotta);
  color: var(--color-white);
}

.btn-warm:hover {
  background: var(--color-terracotta-light);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  padding: var(--space-sm) var(--space-md);
}

.btn-ghost:hover {
  color: var(--color-brown);
}

.btn-sm {
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--text-xs);
}

.btn-lg {
  padding: var(--space-lg) var(--space-2xl);
  font-size: var(--text-base);
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-full);
  font-size: var(--text-lg);
}

.btn-block {
  width: 100%;
}

/* --- Cards --- */
.card {
  background: var(--color-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-out);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-body {
  padding: var(--space-lg);
}

.card-flat {
  background: var(--color-cream-dark);
  box-shadow: none;
  border: 1px solid var(--color-border);
}

.card-flat:hover {
  box-shadow: var(--shadow-sm);
}

/* --- Photo Frame --- */
.photo-frame {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-photo);
  background: var(--color-parchment);
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slower) var(--ease-out);
}

.photo-frame:hover img {
  transform: scale(1.03);
}

.photo-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
  border-radius: inherit;
  pointer-events: none;
}

.photo-frame--portrait {
  aspect-ratio: 3 / 4;
}

.photo-frame--landscape {
  aspect-ratio: 4 / 3;
}

.photo-frame--square {
  aspect-ratio: 1 / 1;
}

/* --- Inputs --- */
.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.input-group label {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--color-text-secondary);
}

.input-field {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  background: var(--color-white);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  color: var(--color-text);
  transition: all var(--duration-fast) var(--ease-out);
}

.input-field::placeholder {
  color: var(--color-text-faint);
}

.input-field:focus {
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px var(--color-gold-muted);
}

.input-field--textarea {
  min-height: 100px;
  resize: vertical;
  line-height: var(--leading-relaxed);
}

/* --- Tags / Chips --- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md);
  background: var(--color-gold-muted);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--color-brown);
  letter-spacing: var(--tracking-wide);
}

.tag--sage {
  background: rgba(139, 158, 126, 0.15);
  color: #5A6F50;
}

.tag--rose {
  background: rgba(196, 145, 138, 0.15);
  color: #8E5C55;
}

.tag--terracotta {
  background: rgba(198, 123, 92, 0.15);
  color: #8E5030;
}

/* --- Avatar --- */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--color-gold-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-weight: var(--weight-bold);
  color: var(--color-brown);
  font-size: var(--text-sm);
  flex-shrink: 0;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar--sm { width: 32px; height: 32px; font-size: var(--text-xs); }
.avatar--lg { width: 56px; height: 56px; font-size: var(--text-lg); }
.avatar--xl { width: 72px; height: 72px; font-size: var(--text-xl); }

.avatar-pair {
  display: flex;
  align-items: center;
}

.avatar-pair .avatar:last-child {
  margin-left: -12px;
  border: 2px solid var(--color-cream);
}

/* --- Divider --- */
.divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-xl) 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.divider span {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  color: var(--color-text-faint);
  white-space: nowrap;
}

/* --- Bottom Navigation --- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: rgba(253, 246, 236, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 var(--space-md);
  padding-bottom: env(safe-area-inset-bottom, 0);
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: var(--space-sm);
  color: var(--color-text-faint);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  transition: color var(--duration-fast) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  background: none;
  border: none;
}

.nav-item:hover,
.nav-item.active {
  color: var(--color-brown);
}

.nav-item svg,
.nav-item .nav-icon {
  font-size: 22px;
  margin-bottom: 1px;
}

.nav-item.active .nav-icon {
  transform: scale(1.1);
}

/* --- FAB (Floating Action Button) --- */
.fab {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + var(--space-lg));
  right: var(--space-lg);
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--color-brown);
  color: var(--color-cream);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  border: none;
  transition: all var(--duration-normal) var(--ease-spring);
  z-index: 90;
  -webkit-tap-highlight-color: transparent;
}

.fab:hover {
  transform: scale(1.08);
  box-shadow: var(--shadow-xl);
  background: var(--color-brown-dark);
}

.fab:active {
  transform: scale(0.95);
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--ease-out);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  width: 100%;
  max-width: var(--content-width);
  max-height: 85vh;
  background: var(--color-cream);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  padding: var(--space-xl) var(--space-lg) var(--space-3xl);
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform var(--duration-slow) var(--ease-out);
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-handle {
  width: 36px;
  height: 4px;
  background: var(--color-border-strong);
  border-radius: var(--radius-full);
  margin: 0 auto var(--space-lg);
}

/* --- Toast --- */
.toast-container {
  position: fixed;
  top: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}

.toast {
  background: var(--color-brown-dark);
  color: var(--color-cream);
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  box-shadow: var(--shadow-lg);
  animation: fadeInDown var(--duration-normal) var(--ease-out) both;
  pointer-events: auto;
  white-space: nowrap;
}

.toast.toast-exit {
  animation: fadeInDown var(--duration-fast) var(--ease-out) reverse both;
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: var(--space-4xl) var(--space-xl);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: var(--space-lg);
  opacity: 0.6;
}

.empty-state h3 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-sm);
}

.empty-state p {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  max-width: 280px;
  margin: 0 auto var(--space-xl);
}

/* --- Badge --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 2px var(--space-sm);
  background: var(--color-gold);
  color: var(--color-white);
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}

/* --- Progress --- */
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--color-gold);
  border-radius: var(--radius-full);
  transition: width var(--duration-slow) var(--ease-out);
}

/* --- Stat --- */
.stat {
  text-align: center;
}

.stat-value {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--color-ink);
  line-height: 1;
}

.stat-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--color-text-faint);
  margin-top: var(--space-xs);
}

/* --- Spacing utility for bottom nav --- */
.has-bottom-nav {
  padding-bottom: calc(var(--bottom-nav-height) + var(--space-xl));
}
