/* =============================================
   UI Enhancement: Transitions, Hover, Micro-interactions
   ============================================= */

/* =============================================
   UI Enhancement Layer — Transitions, Focus,
   Hover Feedback, Micro-interactions
   ============================================= */

/* ── Global transition defaults ── */
input,
textarea,
select {
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(184, 92, 56, 0.5);
  box-shadow: 0 0 0 3px rgba(184, 92, 56, 0.12);
  background: rgba(255, 255, 255, 0.98);
}

button,
.ghost-link {
  transition: filter 0.16s ease, transform 0.14s ease, box-shadow 0.16s ease;
}

button:hover,
.ghost-link:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

button:active,
.ghost-link:active {
  transform: translateY(0px) scale(0.98);
  filter: brightness(0.96);
}

.secondary-link {
  transition: background 0.16s ease, color 0.16s ease, transform 0.14s ease, box-shadow 0.16s ease;
}

.secondary-link:hover {
  background: rgba(184, 92, 56, 0.22);
}

/* ── Space cards hover lift ── */
.space-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.space-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(74, 44, 24, 0.13);
  border-color: rgba(184, 92, 56, 0.2);
}

/* ── Module overview cards hover ── */
.module-overview-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  cursor: default;
}

.module-overview-card a,
.module-overview-card button {
  cursor: pointer;
}

/* ── Collection cards hover ── */
.media-collection-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.media-collection-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 44px rgba(74, 44, 24, 0.13);
}

/* ── Milestone, post, travel cards ── */
.milestone-card,
.post-detail-card,
.travel-entry-card,
.travel-detail-card,
.activity-compact-card,
.summary-entry-link {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.travel-entry-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(74, 44, 24, 0.11);
  border-color: rgba(184, 92, 56, 0.18);
}

.activity-compact-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(74, 44, 24, 0.1);
}

/* ── Module nav buttons ── */
.module-nav-button {
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.16s ease, box-shadow 0.18s ease;
}

.module-nav-button:hover {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(184, 92, 56, 0.16);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(74, 44, 24, 0.08);
}

/* ── Upload field ── */
.upload-field input[type="file"] {
  padding: 20px 14px;
  border: 2px dashed rgba(184, 92, 56, 0.3);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.upload-field input[type="file"]:hover {
  border-color: rgba(184, 92, 56, 0.55);
  background: rgba(255, 255, 255, 0.88);
}

.upload-field input[type="file"]:focus {
  border-color: rgba(184, 92, 56, 0.6);
  box-shadow: 0 0 0 3px rgba(184, 92, 56, 0.1);
}

/* ── Post calendar day hover ── */
.post-calendar-day {
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.post-calendar-day:not(.has-post):hover {
  border-color: rgba(184, 92, 56, 0.15);
  background: rgba(255, 255, 255, 0.88);
}

.post-calendar-day.has-post {
  cursor: pointer;
}

.post-calendar-day.has-post:hover {
  border-color: rgba(184, 92, 56, 0.36);
  box-shadow: 0 8px 20px rgba(74, 44, 24, 0.1);
  background: rgba(255, 255, 255, 0.95);
}

/* ── Post day chips ── */
.post-day-chip {
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.post-day-chip:hover {
  transform: translateY(-1px);
  background: rgba(184, 92, 56, 0.1);
  border-color: rgba(184, 92, 56, 0.18);
}

/* ── Back link with arrow ── */
.back-link::before {
  content: "←\00a0";
  opacity: 0.7;
}

.back-link {
  transition: color 0.15s ease, opacity 0.15s ease;
}

.back-link:hover {
  color: var(--brand);
  opacity: 0.85;
}

.back-link-inline {
  display: inline-block;
  margin-bottom: 10px;
}

/* ── Tag pills subtle hover ── */
.tag {
  transition: background 0.15s ease;
}

/* ── Auth tabs smooth active ── */
.auth-tabs button {
  transition: background 0.18s ease, color 0.18s ease, transform 0.14s ease;
}

.auth-tabs button:hover {
  background: rgba(184, 92, 56, 0.22);
}

/* ── Avatar choice cards ── */
.avatar-choice-card {
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.14s ease;
}

.avatar-choice-card:hover {
  border-color: rgba(184, 92, 56, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(74, 44, 24, 0.1);
}

.avatar-choice-card.is-active {
  border-color: rgba(184, 92, 56, 0.5);
  box-shadow: 0 0 0 3px rgba(184, 92, 56, 0.14);
}

/* ── Photo preview button ── */
.photo-preview-button {
  transition: opacity 0.15s ease;
  overflow: hidden;
}

.photo-preview-button img {
  transition: transform 0.25s ease;
}

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

/* ── Travel album cover photo ── */
.travel-album-cover-photo img {
  transition: transform 0.25s ease;
}

.travel-album-card:hover .travel-album-cover-photo img {
  transform: scale(1.04);
}

/* ── Collection cover grid images ── */
.collection-cover-grid img {
  transition: transform 0.25s ease;
}

.media-collection-card:hover .collection-cover-grid img {
  transform: scale(1.04);
}

/* ── Emoji chips ── */
.emoji-chip {
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.emoji-chip:hover {
  transform: scale(1.18) translateY(-1px);
  box-shadow: 0 4px 12px rgba(74, 44, 24, 0.12);
  background: rgba(255, 255, 255, 0.98);
}

.emoji-chip:active {
  transform: scale(1.05);
}

/* ── Danger button ── */
.danger-button {
  transition: filter 0.16s ease, transform 0.14s ease, box-shadow 0.16s ease;
}

.danger-button:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 18px rgba(166, 59, 50, 0.28);
}

/* ── Form card hover highlight ── */
.module-form-card {
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

/* ── Compact timeline entries ── */
.compact-timeline-entry {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.compact-timeline-entry:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(74, 44, 24, 0.09);
}

/* ── Summary entry cards ── */
.summary-entry-card {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.summary-entry-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(74, 44, 24, 0.1);
}

/* ── Photo & video cards ── */
.photo-card,
.video-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.photo-card:hover,
.video-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(74, 44, 24, 0.11);
}

/* ── Custom scrollbar for lightbox comments ── */
.lightbox-comment-list {
  scrollbar-width: thin;
  scrollbar-color: rgba(184, 92, 56, 0.25) transparent;
}

.lightbox-comment-list::-webkit-scrollbar {
  width: 5px;
}

.lightbox-comment-list::-webkit-scrollbar-track {
  background: transparent;
}

.lightbox-comment-list::-webkit-scrollbar-thumb {
  background: rgba(184, 92, 56, 0.25);
  border-radius: 999px;
}

.lightbox-comment-list::-webkit-scrollbar-thumb:hover {
  background: rgba(184, 92, 56, 0.45);
}

/* ── Space settings popover smooth appear ── */
.space-settings-popover[open] .space-settings-popover-card {
  animation: popover-in 0.18s ease;
}

@keyframes popover-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Space intro modal backdrop ── */
.space-intro-modal:not(.hidden) {
  animation: fade-in 0.2s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Lightbox smooth open ── */
.lightbox:not(.hidden) {
  animation: fade-in 0.2s ease;
}

.lightbox-dialog {
  animation: dialog-slide-in 0.22s ease;
}

@keyframes dialog-slide-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── Workspace panel transition ── */
.workspace-panel.is-active {
  animation: panel-reveal 0.22s ease;
}

@keyframes panel-reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Hero stats card pulse-on-load ── */
.stat-card {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(74, 44, 24, 0.1);
}

/* ── Wish status tags ── */
.wish-status-completed,
.wish-status-pending {
  transition: background 0.15s ease;
}

/* ── Search entry hover ── */
.search-entry {
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.16s ease;
}

.search-entry:hover {
  border-color: rgba(184, 92, 56, 0.3);
  background: rgba(255, 255, 255, 0.88);
  transform: translateY(-1px);
}

/* ── Homepage hero text improvement ── */
.hero-text {
  font-size: 1rem;
  line-height: 1.75;
}

/* ── Form labels smooth feel ── */
.space-form label span,
.filter-item span,
.upload-field span {
  transition: color 0.15s ease;
}

.space-form label:focus-within span,
.filter-item:focus-within span,
.upload-field:focus-within span {
  color: var(--brand-dark);
}

/* ── Space card password lock indicator ── */
.space-card[data-locked="true"] {
  opacity: 0.88;
}

/* ── Module form card reveal animation ── */
.module-form-card:not(.hidden) {
  animation: form-reveal 0.2s ease;
}

@keyframes form-reveal {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Reduce motion for accessibility ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
