/* ===== Experience Cards & Related Content ===== */

/* List wrapper (results page) */
.experience-list { margin-top: 20px; }

/* ===== KOREAN-THEMED SKELETON LOADERS ===== */

.ktpa-skeleton-card {
  border: 1px solid var(--ktpa-border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
  position: relative;
  background: var(--ktpa-bg);
  animation: ktpa-card-fade-in 0.6s ease-out forwards;
  opacity: 0;
  transform: translateY(20px);
}

.ktpa-skeleton-card.staggered-1 { animation-delay: 0.05s; }
.ktpa-skeleton-card.staggered-2 { animation-delay: 0.1s; }
.ktpa-skeleton-card.staggered-3 { animation-delay: 0.15s; }
.ktpa-skeleton-card.staggered-4 { animation-delay: 0.2s; }
.ktpa-skeleton-card.staggered-5 { animation-delay: 0.25s; }

@keyframes ktpa-card-fade-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ktpa-skeleton-image {
  width: 140px;
  height: 105px;
  background: linear-gradient(
    90deg,
    #f0f4f8 25%,
    #e2e8f0 50%,
    #f0f4f8 75%
  );
  background-size: 400% 100%;
  animation: ktpa-korean-shimmer 2s ease-in-out infinite;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.ktpa-skeleton-image::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23cbd5e0" stroke-width="1"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21,15 16,10 5,21"/></svg>') center/cover no-repeat;
  opacity: 0.4;
}

.ktpa-skeleton-content {
  flex: 1;
  padding-left: 16px;
}

.ktpa-skeleton-title {
  height: 20px;
  background: linear-gradient(
    90deg,
    #e2e8f0 25%,
    #cbd5e0 50%,
    #e2e8f0 75%
  );
  background-size: 400% 100%;
  animation: ktpa-korean-shimmer 2s ease-in-out infinite 0.1s;
  border-radius: 4px;
  margin-bottom: 12px;
  width: 75%;
}

.ktpa-skeleton-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
}

.ktpa-skeleton-badge {
  height: 18px;
  width: 60px;
  background: linear-gradient(
    135deg,
    #fef2e7 0%,
    #fed7aa 50%,
    #fef2e7 100%
  );
  background-size: 400% 100%;
  animation: ktpa-korean-shimmer 2s ease-in-out infinite 0.2s;
  border-radius: 12px;
}

.ktpa-skeleton-description {
  height: 14px;
  background: linear-gradient(
    90deg,
    #f1f5f9 25%,
    #e2e8f0 50%,
    #f1f5f9 75%
  );
  background-size: 400% 100%;
  animation: ktpa-korean-shimmer 2s ease-in-out infinite 0.3s;
  border-radius: 4px;
  margin-bottom: 6px;
  width: 90%;
}

.ktpa-skeleton-description:nth-child(2) { width: 60%; }

@keyframes ktpa-korean-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

@keyframes ktpa-enhanced-container-shimmer {
  0% {
    background-position: -100% 0;
  }
  100% {
    background-position: 100% 0;
  }
}

@keyframes ktpa-overlay-pulse {
  0% {
    opacity: 0.2;
  }
  100% {
    opacity: 0.4;
  }
}

/* Korean wave pattern overlay for loading states */
.ktpa-loading-pattern {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 25% 25%, rgba(219, 39, 119, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
  background-size: 100px 100px;
  background-position: 0 0, 50px 50px;
  animation: ktpa-pattern-drift 8s linear infinite;
  pointer-events: none;
  border-radius: 10px;
  opacity: 0;
  animation: ktpa-pattern-fade-in 1s ease-out 0.5s forwards,
             ktpa-pattern-drift 8s linear 1s infinite;
}

@keyframes ktpa-pattern-drift {
  from { transform: translateX(-100px); }
  to { transform: translateX(100px); }
}

@keyframes ktpa-pattern-fade-in {
  to { opacity: 1; }
}

/* Card shell */
.exp-card {
  border: 1px solid var(--ktpa-border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
  position: relative;
  background: var(--ktpa-bg);
}
.exp-card h3 {
  margin: 0 0 8px 0;
  color: #e65c00;
}
.exp-card img {
  width: 100%;
  height: auto;
  display: block;
  margin: 12px 0;  
}
.exp-card p { margin: 12px 0; color: var(--ktpa-text); }
.exp-card small { display: block; margin-bottom: 8px; color: var(--ktpa-muted); }
.exp-card .remove-exp {
  color: #d00;
  text-decoration: none;
  font-size: 1.2em;
  position: absolute;
  top: 16px; right: 16px;
  padding: 4px;
  border-radius: 4px;
  transition: background-color 0.2s;
}
.exp-card .remove-exp:hover { 
  background-color: rgba(221, 0, 0, 0.1);
  transform: scale(1.1);
}

/* Facts row inside card */
.exp-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 6px 14px;
  margin: 6px 0 8px;
  font-size: .95em;
}
.exp-facts > div strong { font-weight: 600; }

/* Duration and Cost row layout */
.exp-duration-cost-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  grid-column: 1 / -1; /* Span full width of grid */
  gap: 12px;
}

.exp-duration {
  flex: 1;
}

.exp-cost {
  font-weight: 600;
  color: var(--ktpa-accent);
  white-space: nowrap;
}

/* Metro info styling */
.exp-metro {
  color: var(--ktpa-text);
  font-size: 0.9em;
  margin: 8px 0;
  padding: 6px 12px;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 8px;
  border-left: 3px solid var(--ktpa-brand);
}

/* Shortcode wrapper layouts */
/* Shortcode wrapper layouts */
.ktpa-expcards.is-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

/* Horizontal list layout for shortcodes */
.ktpa-expcards.is-list { display: block; }

.ktpa-expcards.is-list .exp-card {
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 14px;
  align-items: start;
}

/* Place image in the left column, SMALL size */
.ktpa-expcards.is-list .exp-card img {
  grid-column: 1;
  grid-row: 1 / span 4;
  width: 120px;   /* ↓ smaller */
  height: 90px;   /* ↓ smaller */
  object-fit: cover;
  margin: 0;                 /* override vertical layout margin */
  border-radius: 8px;
}

/* Move text content to the right column */
.ktpa-expcards.is-list .exp-card h3,
.ktpa-expcards.is-list .exp-card p,
.ktpa-expcards.is-list .exp-card .exp-facts,
.ktpa-expcards.is-list .exp-card .ktpa-related-guides-wrap,
.ktpa-expcards.is-list .exp-card .ktpa-related-products-wrap,
.ktpa-expcards.is-list .exp-card .debug-info {
  grid-column: 2;
}
.ktpa-expcards.is-list .exp-card h3 { margin: 0 0 6px 0; }

/* Responsive: stack on small screens */
@media (max-width: 680px) {
  .ktpa-expcards.is-list .exp-card {
    display: block;
  }
  .ktpa-expcards.is-list .exp-card img {
    width: 100%;
    height: auto;
    margin: 12px 0;
  }
}


/* Related content blocks */
.ktpa-related-guides, .ktpa-related-products { margin: 10px 0 12px; }
.ktpa-related-guides strong, .ktpa-related-products strong {
  display: inline-block; margin-bottom: 6px;
}

/* Itinerary item card - Related content heading color */
.ktpa-enhanced-itinerary .ktpa-related-guides strong, .ktpa-enhanced-itinerary .ktpa-related-products strong {
  color: #cbd5e0;
}

/* Related content row layout - horizontal container */
.ktpa-related-content-row {
  display: flex;
  flex-direction: row;
  gap: 20px;
  margin-top: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}

/* Wrapper expansion - when one section is hidden, the other takes full width */
.ktpa-related-guides-wrap,
.ktpa-related-products-wrap {
  flex: 0 1 auto;
  min-width: 0;
  align-self: flex-start;
}

/* Hide entire row if both wrappers are empty */
.ktpa-related-content-row:has(.ktpa-related-guides-wrap:empty):has(.ktpa-related-products-wrap:empty) {
  display: none;
}

/* Each section (guides/products) - vertical flex for heading above cards */
.ktpa-related-guides,
.ktpa-related-products {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  min-width: 160px;
}

/* Section headings */
.ktpa-related-guides strong,
.ktpa-related-products strong {
  display: block;
  font-weight: bold;
  font-size: 0.9em;
  color: var(--ktpa-text);
  margin-bottom: 8px;
  white-space: nowrap;
}


/* Card grids within each section - horizontal flex */
.ktpa-related-guides .ktpa-card-grid,
.ktpa-related-products .ktpa-card-grid {
  display: flex !important;
  flex-direction: row;
  gap: 12px;
  flex-wrap: nowrap;
  width: fit-content;
  max-width: 100%;
}

/* Individual cards in sections */
.ktpa-related-guides .ktpa-card,
.ktpa-related-products .ktpa-card {
  width: 160px;
  flex-shrink: 0;
  scroll-snap-align: start;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .ktpa-related-content-row {
    gap: 15px;
  }

  .ktpa-related-guides-wrap,
  .ktpa-related-products-wrap {
    flex-shrink: 0;
  }

  .ktpa-related-guides .ktpa-card,
  .ktpa-related-products .ktpa-card {
    width: 140px;
  }
}

/* Style for empty state messages */
.ktpa-related-content-row .no-guides,
.ktpa-related-content-row .no-products {
  color: #9ca3af;
  font-size: 0.875em;
  font-style: italic;
  opacity: 0.7;
}


/* Related items grid (guides/products) */
.ktpa-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}


.ktpa-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  border: 1px solid #eee;
  padding: 10px;
  border-radius: 8px;
  background: #fff;
  height: 240px; /* Increased height to contain all content including price */
  width: 160px; /* Fixed width for consistency */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden; /* Ensure nothing overflows outside the card */
  box-sizing: border-box; /* Include padding in height calculation */
}
.ktpa-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border-color: #ccc;
}
.ktpa-card img {
  width: 100%;
  height: 100px; /* Fixed image height */
  object-fit: cover; /* Maintain aspect ratio while fitting */
  border-radius: 6px;
  display: block;
  flex-shrink: 0;
  margin-bottom: 8px;
}
.ktpa-card-title { 
  font-size: .85em; /* Slightly smaller to ensure everything fits */
  margin: 0 0 8px 0; 
  line-height: 1.3; 
  color: var(--ktpa-text);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3; /* Limit to 3 lines */
  -webkit-box-orient: vertical;
  height: 3.6em; /* Fixed height for title area */
  flex-shrink: 0; /* Prevent title from shrinking */
}
.ktpa-card-price { 
  font-weight: 600; 
  margin-top: auto; /* Push to bottom but stay within card */
  padding: 6px 0 0 0; /* Reduced padding to fit within card */
  font-size: .9em;
  color: var(--ktpa-accent);
  text-align: center;
  flex-shrink: 0; /* Prevent price from shrinking */
  border-top: 1px solid #f0f0f0;
  line-height: 1.2;
}

/* ===== Results page: improved card layout ===== */
.experience-list .exp-card {
  display: block;
  position: relative;
}

/* Main content wrapper - places image and content in one row */
.experience-list .exp-main-content {
  display: flex;
  gap: 16px;
  align-items: start;
}

/* Card padding adjustment for full-width image */
.experience-list .exp-card {
  padding: 0; /* Remove default padding */
  overflow: hidden; /* Ensure content stays within rounded corners */
}

/* Content area with restored padding */
.experience-list .exp-content {
  padding: 16px;
  flex: 1;
  min-width: 0; /* Allow content to shrink if needed */
}

/* ===== KTPA: Enhanced Responsive Image Container ===== */

/* Base image container - supports both old and new responsive images */
.experience-list .exp-image-container {
  flex-shrink: 0;
  position: relative;
  margin: 0;
  overflow: hidden;
  background: #f5f5f5; /* Loading placeholder color */

  /* Aspect ratio to prevent layout shift */
  aspect-ratio: 4 / 3;
}

/* Desktop: Fixed size container */
@media (min-width: 769px) {
  .experience-list .exp-image-container {
    width: 200px;
    height: 150px;
    border-radius: 8px 0 0 0;
  }
}

/* Mobile: Full width container */
@media (max-width: 768px) {
  .experience-list .exp-image-container {
    width: calc(100% + 32px); /* Account for card padding */
    height: 200px; /* Fixed height for consistent layout */
    margin: 0 -16px; /* Extend to card edges */
    border-radius: 0;
  }

  .experience-list .exp-main-content {
    flex-direction: column;
    gap: 0;
  }

  /* Adjust card padding for mobile */
  .experience-list .exp-card {
    padding: 0 16px 16px 16px;
    margin: 0 -8px;
  }

  .experience-list .exp-content {
    padding: 16px 0 0 0;
  }
}

/* ===== KTPA: Universal Image Styling ===== */

/* Base image styles - applies to all images (responsive and fallback) */
.experience-list .exp-image-container img,
.ktpa-responsive-image,
.ktpa-fallback-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  background: #f5f5f5;

  /* Consistent aspect ratio for all contexts */
  aspect-ratio: 4 / 3;
}

/* Specific aspect ratios for different contexts */
.ktpa-responsive-image[data-context="card"],
.ktpa-fallback-image[data-context="card"] {
  aspect-ratio: 4 / 3;
}

.ktpa-responsive-image[data-context="itinerary"],
.ktpa-fallback-image[data-context="itinerary"] {
  aspect-ratio: 4 / 3;
}

.ktpa-responsive-image[data-context="modal"],
.ktpa-fallback-image[data-context="modal"] {
  aspect-ratio: 4 / 3;
}

/* Responsive image enhancements */
.ktpa-responsive-image {
  /* Better image rendering on scaling */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;

  /* Hardware acceleration for smooth loading */
  transform: translateZ(0);
  backface-visibility: hidden;

  /* Smooth transitions */
  transition: opacity 0.3s ease;

  /* Prevent disappearing during viewport changes */
  min-height: 1px;
  min-width: 1px;
}

/* Ensure attachment-based images don't get removed */
[data-attachment-id] .ktpa-responsive-image,
[data-loading="wp-responsive"] img {
  /* Prevent accidental removal */
  visibility: visible !important;
  display: block !important;
}

/* ===== ENHANCED IMAGE LOADING STATES ===== */

/* Images start invisible until loaded */
.ktpa-responsive-image {
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 2; /* Ensure images appear above loading overlays */
}

.ktpa-responsive-image.loaded {
  opacity: 1;
}

/* Enhanced Korean-themed loading placeholder */
.exp-image-container {
  position: relative;
  overflow: hidden;
  background: linear-gradient(
    110deg,
    #f0f4f8 0%,
    #e2e8f0 25%,
    #ffffff 50%,
    #e2e8f0 75%,
    #f0f4f8 100%
  );
  background-size: 300% 100%;
  animation: ktpa-korean-shimmer 1.8s ease-in-out infinite;
}

/* Add a subtle overlay for extra visual feedback */
.exp-image-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    45deg,
    rgba(99, 102, 241, 0.1) 0%,
    rgba(219, 39, 119, 0.1) 100%
  );
  animation: ktpa-overlay-pulse 2.5s ease-in-out infinite alternate;
  z-index: 1;
}

/* Stop animation when image is loaded */
.exp-image-container.loaded {
  animation: none;
  background: #f8fafc;
}

.exp-image-container.loaded::before {
  display: none;
}

/* Critical images get priority styling */
.ktpa-critical-image,
.ktpa-high-priority-load {
  /* Ensure critical images render immediately */
  will-change: transform;
  transform: translateZ(0); /* Force hardware acceleration */
}

.ktpa-critical-image .ktpa-responsive-image,
.ktpa-high-priority-load .ktpa-responsive-image {
  /* Critical images appear faster */
  transition: opacity 0.2s ease; /* Faster transition for critical images */
}

/* High priority images get even faster loading */
.ktpa-high-priority-load {
  /* Priority processing for intersection ratio > 50% */
  contain: layout style paint;
  isolation: isolate;
}

.exp-image-container.loading::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    rgba(248, 250, 252, 0) 0%,
    rgba(248, 250, 252, 0.8) 50%,
    rgba(248, 250, 252, 0) 100%
  );
  animation: ktpa-image-loading-sweep 1.5s ease-in-out infinite;
  z-index: 2;
}

@keyframes ktpa-image-loading-sweep {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Subtle Ken Burns effect on loaded images */
.ktpa-responsive-image.loaded.ken-burns {
  animation: ktpa-ken-burns 20s ease-in-out infinite alternate;
  transform-origin: center center;
}

@keyframes ktpa-ken-burns {
  0% {
    transform: scale(1) translateX(0) translateY(0);
  }
  100% {
    transform: scale(1.05) translateX(-2%) translateY(-1%);
  }
}

/* Card loading states */
.exp-card.ktpa-loading {
  animation: ktpa-card-pulse 2s ease-in-out infinite;
}

@keyframes ktpa-card-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.1);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(59, 130, 246, 0);
  }
}

/* Smooth appearance for real cards replacing skeleton */
.exp-card.ktpa-loaded {
  animation: ktpa-card-materialize 0.5s ease-out forwards;
  opacity: 0;
  transform: scale(0.95) translateY(10px);
}

@keyframes ktpa-card-materialize {
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.ktpa-responsive-image.loaded {
  opacity: 1;
}

/* High DPI display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .ktpa-responsive-image,
  .ktpa-fallback-image {
    /* Better subpixel rendering on retina displays */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* Fallback image specific styles */
.ktpa-fallback-image {
  /* Ensure fallback images get sharpening on mobile */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* Fit score badge overlay on image - floating design */
.exp-fit-badge {
  position: absolute;
  top: 8px;  
  background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
  color: white;
  padding: 2px 12px;
  border-radius: 20px;
  font-size: 0.75em;
  font-weight: 700;
  white-space: nowrap;
  z-index: 15;
  box-shadow: 0 4px 12px rgba(251, 80, 25, 0.4), 0 2px 4px rgba(0, 0, 0, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
  transition: all 0.2s ease;
  cursor: default;
}

/* Badge hover effect for extra emphasis */
.exp-card:hover .exp-fit-badge {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 6px 16px rgba(251, 80, 25, 0.5), 0 3px 6px rgba(0, 0, 0, 0.3);
}

/* Remove duplicate - now defined above with padding */

/* Title row - remove button now overlaid on image */
.exp-title-row {
  margin-bottom: 8px;
}

.exp-title-row h3 {
  margin: 0;
  overflow-wrap: break-word;
  padding-right: 8px; /* Space for potential overflow from overlaid button */
}

/* Remove link styling (trash icon) - positioned over image */
.experience-list .exp-card .remove-exp {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 10;
  text-decoration: none;
  font-size: 1.2em;
  padding: 6px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(2px);
}

.experience-list .exp-card .remove-exp::before {
  content: "🗑️";
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.experience-list .exp-card .remove-exp:hover {
  background: rgba(0, 0, 0, 0.6);
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* City badge styling */
.exp-city-badge {
  display: inline-block;
  background: #f0f8ff;
  color: #1e40af;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8em;
  font-weight: 500;
  margin-bottom: 8px;
  border: 1px solid #bfdbfe;
}

/* === PHASE 3: Budget Match Badge Styling === */
.exp-budget-badge {
  display: inline-block;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  color: #16a34a;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 12px;
  border: 1px solid #bbf7d0;
  margin: 4px 0;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Budget badge color variations */
.exp-budget-badge:contains('Perfect') {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  color: #16a34a;
  border-color: #bbf7d0;
}

.exp-budget-badge:contains('Within') {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  color: #d97706;
  border-color: #fde68a;
}

.exp-budget-badge:contains('stretch') {
  background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
  color: #dc2626;
  border-color: #fca5a5;
}

.exp-budget-badge:contains('Premium') {
  background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
  color: #9333ea;
  border-color: #d8b4fe;
}

/* Bottom row with address/tags on left and button on right */
.exp-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-top: 12px;
}

/* Left side info container */
.exp-info-left {
  flex: 1;
}

/* Address styling */
.exp-address {
  margin: 8px 0;
  font-size: 0.9em;
  color: var(--ktpa-text);
}

/* Tag chips container */
.exp-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 8px 0;
}

/* Individual tag chips */
.exp-tag-chip {
  background-color: #ffc700;
  color: #000;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.75em;
  font-weight: 500;
  white-space: nowrap;
}

/* Toggle button container */
.exp-toggle-container {
  flex-shrink: 0;
  align-self: flex-end;
}

/* Details content (hidden when collapsed) - spans full width */
.experience-list .ktpa-expanded-content {
  margin-top: 16px;
  width: 100%;
}

/* Additional details styling */
.exp-hours, .exp-contact {
  margin: 8px 0;
  font-size: 0.9em;
}

/* Toggle button styling */
.exp-toggle {
  font-size: .9em;
  padding: 6px 12px;
}

/* Additional mobile responsive adjustments */
@media (max-width: 768px) {
  .exp-bottom-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .exp-toggle-container {
    align-self: stretch;
    text-align: center;
  }

  /* Mobile remove button stays overlaid on image */
  .experience-list .exp-card .remove-exp {
    top: 14px;
    right: 0;    
    position: absolute; /* Ensure it stays positioned over image */
  }
}

/* Foldable cards - hide details when collapsed */
.exp-card.collapsed .exp-details-content {
  display: none;
}

/* ===== ITINERARY-STYLE EXPANSION PATTERNS ===== */

/* Expandable content functionality */
.ktpa-expand-chevron {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px;
  margin-top: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  width: 100%;
}

.ktpa-expand-chevron:hover {
  background: rgba(0, 0, 0, 0.05);
}

.ktpa-chevron-icon {
  font-size: 14px;
  color: #667eea;
  transition: all 0.3s ease;
  user-select: none;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.exp-card.expanded .ktpa-chevron-icon {
  color: #4f46e5;
}

.exp-card.expanded .ktpa-chevron-icon::before {
  content: "Less Info ▲";
}

.ktpa-chevron-icon::before {
  content: "More Info ▼";
}

.ktpa-expanded-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  padding: 0 28px;
}

.exp-card.expanded .ktpa-expanded-content {
  max-height: none;
  padding: 20px 28px;
}

.exp-card.expanded .ktpa-detail-item {
  color: var(--ktpa-text);
  font-size: 14px;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 8px;
  border-left: 3px solid #667eea;
}

.ktpa-related-content {
  margin-top: 8px;
  padding-top: 0;
  margin-bottom: 8px; /* Add space before expand chevron */
}

/* Mobile expandable content adjustments */
@media (max-width: 768px) {
  .ktpa-expanded-content {
    padding: 0 20px;
  }

  .exp-card.expanded .ktpa-expanded-content {
    padding: 16px 0;
  }

  .ktpa-expand-chevron {
    padding: 10px;
    margin-top: 12px;
  }
}

/* ===== TITLE LINKING SYSTEM STYLES ===== */

/* Experience card title links */
.ktpa-title-link {
  color: inherit;
  text-decoration: none;
  transition: var(--ktpa-transition-base);
  position: relative;
}

.ktpa-title-link:hover {
  color: var(--ktpa-brand);
  text-decoration: underline;
  text-decoration-color: var(--ktpa-brand);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.ktpa-title-link:focus {
  outline: 2px solid var(--ktpa-brand);
  outline-offset: 2px;
  border-radius: var(--ktpa-radius-xs);
}

/* Visual indicator for linked titles */
.ktpa-title-link::after {
  content: " ↗";
  font-size: 0.75em;
  opacity: 0.6;
  margin-left: 4px;
  transition: var(--ktpa-transition-fast);
  display: inline-block;
  transform: scale(0.9);
}

.ktpa-title-link:hover::after {
  opacity: 1;
  transform: scale(1) translateY(-1px);
  color: var(--ktpa-brand);
}

/* Itinerary activity title links */
.ktpa-activity-title .ktpa-title-link {
  color: inherit;
}

.ktpa-activity-title .ktpa-title-link:hover {
  color: var(--ktpa-accent);
  text-decoration-color: var(--ktpa-accent);
}

.ktpa-activity-title .ktpa-title-link:hover::after {
  color: var(--ktpa-accent);
}

/* Dark theme support for itinerary context */
.ktpa-enhanced-itinerary .ktpa-activity-title .ktpa-title-link {
  color: #ffffff;
}

.ktpa-enhanced-itinerary .ktpa-activity-title .ktpa-title-link:hover {
  color: var(--ktpa-accent);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .ktpa-title-link::after {
    font-size: 0.7em;
    margin-left: 3px;
  }
  
  .ktpa-title-link:hover {
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .ktpa-title-link,
  .ktpa-title-link::after {
    transition: none;
  }
  
  .ktpa-title-link:hover::after {
    transform: scale(1);
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .ktpa-title-link:hover {
    background-color: var(--ktpa-brand);
    color: white;
    padding: 2px 4px;
    margin: -2px -4px;
    border-radius: var(--ktpa-radius-xs);
  }

  .ktpa-enhanced-itinerary .ktpa-activity-title .ktpa-title-link:hover {
    background-color: var(--ktpa-accent);
  }
}

/* ===== LOADING SPINNER FOR REMOVE BUTTON ===== */

/* Loading state for remove experience button */
.remove-exp.loading {
  pointer-events: none;
  opacity: 0.6;
  position: relative;
}

.remove-exp.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #667eea;
  border-radius: 50%;
  animation: ktpa-spinner 0.6s linear infinite;
}

@keyframes ktpa-spinner {
  to { transform: rotate(360deg); }
}
