/* ============================================
   TRAVEL BUCKET LIST — Styles
   ============================================ */

:root {
  --bg-start: #e8f0fe;
  --bg-end: #f0faf5;
  --primary: #1a73e8;
  --primary-light: #8ab4f8;
  --primary-soft: #d2e3fc;
  --accent: #e8507e;
  --accent-light: #ffb6c8;
  --text: #1a2b3c;
  --text-soft: #5f6d7e;
  --cream: #fafcff;
  --white: #ffffff;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Quicksand', 'Segoe UI', sans-serif;
  color: var(--text);
  min-height: 100dvh;
  background: linear-gradient(160deg, var(--bg-start) 0%, var(--bg-end) 100%);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* --- App Nav Button (bottom-left) --- */
.app-nav-btn {
  position: fixed;
  bottom: 1.4rem;
  left: 1.4rem;
  z-index: 50;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 2px solid var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 4px 18px rgba(26, 115, 232, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  animation: fadeInUp 0.8s ease-out 0.8s both;
}

.app-nav-btn span {
  font-size: 1.4rem;
  line-height: 1;
}

.app-nav-btn:hover,
.app-nav-btn:focus-visible {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(26, 115, 232, 0.3);
  background: rgba(255, 255, 255, 0.9);
}

.app-nav-btn:active {
  transform: scale(0.93);
}

/* --- Floating Emojis Background --- */
.floating-emojis {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.floating-emoji {
  position: absolute;
  opacity: 0;
  animation: floatUp linear infinite;
  will-change: transform, opacity;
}

@keyframes floatUp {
  0% {
    transform: translateY(100vh) rotate(0deg) scale(0.7);
    opacity: 0;
  }
  10% { opacity: 0.35; }
  50% { opacity: 0.4; }
  90% { opacity: 0.3; }
  100% {
    transform: translateY(-10vh) rotate(360deg) scale(1.1);
    opacity: 0;
  }
}

/* --- Layout --- */
.container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100dvh;
  padding: 1.5rem 1rem 1rem;
  gap: 0.8rem;
}

/* --- Header --- */
.header {
  text-align: center;
  padding-bottom: 0.3rem;
  animation: fadeInDown 0.8s ease-out;
}

.title {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
  text-shadow: 0 2px 10px rgba(26, 115, 232, 0.12);
}

.subtitle {
  font-size: clamp(0.85rem, 2.2vw, 1rem);
  color: var(--text-soft);
  margin-top: 0.3rem;
  font-weight: 500;
}

/* --- Destination Card --- */
.card-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  gap: 0.8rem;
  width: 100%;
  animation: fadeInUp 1s ease-out 0.3s both;
}

.card-hint {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
  animation: pulse 2s ease-in-out infinite;
  letter-spacing: 0.05em;
}

.dest-card {
  width: 100%;
  max-width: 480px;
  border-radius: 24px;
  background: var(--white);
  border: 1px solid rgba(26, 115, 232, 0.12);
  box-shadow:
    0 20px 60px rgba(26, 115, 232, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dest-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 25px 70px rgba(26, 115, 232, 0.14),
    0 0 0 1px rgba(255, 255, 255, 0.5) inset;
}

/* --- Image Area --- */
.dest-image {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.dest-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.dest-image img.loaded {
  opacity: 1;
}

.dest-image-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to top, var(--white) 0%, transparent 100%);
  z-index: 2;
  pointer-events: none;
}

.dest-image-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  gap: 0.5rem;
  z-index: 1;
}

.dest-image-loading span {
  font-size: 2.5rem;
  animation: pulse 1.5s ease-in-out infinite;
}

.dest-image-loading.hidden {
  display: none;
}

/* --- Attribution & Google Link Bar --- */
.dest-attribution {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 1rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-soft);
  background: rgba(26, 115, 232, 0.03);
  border-bottom: 1px solid rgba(26, 115, 232, 0.06);
}

.dest-attribution a {
  color: var(--text-soft);
  text-decoration: none;
  transition: color 0.2s ease;
}

.dest-attribution a:hover,
.dest-attribution a:focus-visible {
  color: var(--primary);
  text-decoration: underline;
}

.dest-attribution > span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dest-google-link {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-soft);
  text-decoration: none;
  margin-left: 0.6rem;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.dest-google-link:hover,
.dest-google-link:focus-visible {
  color: var(--primary);
}

.dest-google-link svg {
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.dest-google-link:hover svg {
  opacity: 1;
}

/* --- Content Area --- */
.dest-content {
  padding: 0.8rem 1.4rem 1rem;
}

.dest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.dest-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 50px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.dest-name {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 0.15rem;
}

.dest-location {
  font-size: 0.85rem;
  color: var(--text-soft);
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.dest-description {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* Highlights */
.dest-highlights {
  margin-bottom: 0.8rem;
}

.dest-highlights h3 {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

.dest-highlights ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.dest-highlights li {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.5;
  padding-left: 1.2rem;
  position: relative;
}

.dest-highlights li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--primary-light);
  font-weight: 700;
}

/* Fun Fact */
.dest-funfact {
  background: linear-gradient(135deg, #f8f9ff 0%, #fff8f0 100%);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  margin-bottom: 0.6rem;
  border: 1px solid rgba(26, 115, 232, 0.08);
}

.dest-funfact h3 {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.3rem;
}

.dest-funfact p {
  font-size: 0.85rem;
  color: var(--text-soft);
  line-height: 1.5;
  font-style: italic;
}

/* Next Button */
.dest-next-btn {
  display: block;
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  background: linear-gradient(to top, rgba(26, 115, 232, 0.06) 0%, transparent 100%);
  border-top: 1px solid rgba(26, 115, 232, 0.08);
  transition: background 0.2s ease, color 0.2s ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.dest-next-btn:hover,
.dest-next-btn:focus-visible {
  background: linear-gradient(to top, rgba(26, 115, 232, 0.12) 0%, rgba(26, 115, 232, 0.03) 100%);
}

.dest-next-btn:active {
  background: rgba(26, 115, 232, 0.15);
}

/* --- Counter --- */
.counter {
  font-size: 0.8rem;
  color: var(--text-soft);
  opacity: 0.5;
  font-weight: 600;
  padding-bottom: 0.5rem;
  animation: fadeInUp 0.8s ease-out 0.5s both;
}

/* --- Card transition --- */
.dest-card.transitioning .dest-content,
.dest-card.transitioning .dest-image img {
  opacity: 0;
  transform: translateY(10px);
}

.dest-content {
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.dest-card.entering .dest-content {
  animation: contentFadeIn 0.5s ease-out forwards;
}

@keyframes contentFadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Animations --- */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.97); }
}

/* --- Responsive --- */
@media (min-width: 768px) {
  .dest-card {
    max-width: 540px;
  }
  .dest-image {
    height: 280px;
  }
  .dest-content {
    padding: 1rem 1.8rem 1.2rem;
  }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .floating-emoji { display: none; }
}
