/* ============================================
   Fukuoka Travel Companion - Modern Zen Design
   Complete redesign: Dribbble-inspired UI
   ============================================ */

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

/* --- Shimmer animation for CTA buttons --- */
@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 200%; }
}

.btn-navigate::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 3s ease-in-out infinite;
}

/* --- Gentle pulse for live dot --- */
@keyframes gentle-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.3); }
}

.live-dot {
    animation: gentle-pulse 2s ease-in-out infinite;
}

/* --- Fade in animation --- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
    animation: fadeInUp 0.4s ease-out both;
}

/* --- Nav styles --- */
.nav-item {
    color: #94A3B8;
}

.nav-item .nav-icon-wrap {
    background: transparent;
}

.nav-item.active {
    color: #EE6C4D;
}

.nav-item.active .nav-icon-wrap {
    background: rgba(238, 108, 77, 0.1);
}

/* --- Map toggle active --- */
.map-toggle-btn {
    position: relative;
    z-index: 1;
}

.map-toggle-btn.active {
    background: #2D3A4A;
    color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(45, 58, 74, 0.25);
}

/* --- Timeline dynamic states --- */
.timeline-item {
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #E2E8F0;
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-item.completed .timeline-name {
    color: #94A3B8;
    text-decoration: line-through;
}

.timeline-item.completed .timeline-dot {
    background: #52B788;
    border-color: #52B788;
    box-shadow: 0 0 0 3px rgba(82, 183, 136, 0.15);
}

.timeline-item.completed .timeline-dot .timeline-icon {
    display: none;
}

.timeline-item.completed .timeline-dot::after {
    content: '';
    width: 10px;
    height: 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.timeline-item.current {
    background: linear-gradient(135deg, rgba(238,108,77,0.04), rgba(248,180,200,0.04));
    border-radius: 16px;
    margin-left: -8px;
    margin-right: -8px;
    padding-left: 20px;
    padding-right: 20px;
}

.timeline-item.current .timeline-dot {
    background: #EE6C4D;
    border-color: #EE6C4D;
    box-shadow: 0 0 0 4px rgba(238, 108, 77, 0.15);
}

.timeline-item.current .checkbox-custom {
    border-color: #EE6C4D;
}

.timeline-item.viewing {
    background: rgba(61, 90, 128, 0.04);
    border-radius: 16px;
    margin-left: -8px;
    margin-right: -8px;
    padding-left: 20px;
    padding-right: 20px;
}

/* --- Checkbox checkmark --- */
.peer:checked ~ .checkbox-custom {
    background: #52B788;
    border-color: #52B788;
}

.peer:checked ~ .checkbox-custom::after {
    content: '';
    width: 12px;
    height: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

/* --- Spot nav button states --- */
.spot-nav-btn:disabled {
    opacity: 0.25;
    cursor: default;
}

.spot-nav-btn:active:not(:disabled) {
    background: #2D3A4A;
    color: white;
    border-color: #2D3A4A;
    transform: scale(0.95);
}

/* --- Leaflet overrides --- */
.leaflet-dest-marker,
.leaflet-spot-marker {
    background: none !important;
    border: none !important;
}

#map .leaflet-container {
    height: 100%;
    width: 100%;
}

/* --- Transit badge/detail --- */
.transit-badge {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #2D3A4A, #3D5A80);
    color: white;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    margin-right: 6px;
    letter-spacing: 0.02em;
}

.transit-detail {
    color: #64748B;
    font-size: 12px;
}

/* --- Modal --- */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal.active .modal-content {
    animation: fadeInUp 0.3s ease-out;
}

/* --- Card hover lift --- */
.card-hover {
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.card-hover:active {
    transform: translateY(0);
}

/* --- Horizontal scroll no-scrollbar --- */
.scroll-hide::-webkit-scrollbar {
    display: none;
}
.scroll-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* --- Day selector scroll snap --- */
.day-selector {
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.day-selector > * {
    scroll-snap-align: center;
}

/* --- Glass card --- */
.glass {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* --- Header decorative wave --- */
.header-wave {
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 32px;
    background: #F7F7F5;
    border-radius: 24px 24px 0 0;
}

/* --- Section title line accent --- */
.section-title::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 16px;
    background: linear-gradient(180deg, #EE6C4D, #F4845F);
    border-radius: 2px;
    margin-right: 8px;
    vertical-align: middle;
    flex-shrink: 0;
}

/* --- Progress ring --- */
.progress-ring {
    transform: rotate(-90deg);
}

/* --- Flight route arrow --- */
.flight-route {
    position: relative;
}

.flight-route::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: repeating-linear-gradient(90deg, #CBD5E1 0, #CBD5E1 6px, transparent 6px, transparent 12px);
}

/* --- Item Detail Bottom Sheet Modal --- */
#item-detail-modal {
    align-items: flex-end;
    justify-content: center;
}

#item-detail-modal .spot-detail-sheet {
    position: relative;
    width: 100%;
    max-width: 430px;
    max-height: 90vh;
    overflow-y: auto;
    background: white;
    border-radius: 24px 24px 0 0;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

#item-detail-modal.active .spot-detail-sheet {
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Hero image carousel */
.spot-detail-hero-wrap {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.spot-detail-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    height: 100%;
}

.spot-detail-slide {
    width: 100%;
    height: 200px;
    object-fit: cover;
    scroll-snap-align: start;
    flex-shrink: 0;
}

.spot-detail-dots {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 2;
}

.spot-detail-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.2s;
}

.spot-detail-dot.active {
    background: white;
    transform: scale(1.3);
}

.spot-detail-hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to top, white, transparent);
}

.spot-detail-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1;
    transition: background 0.15s;
}

.spot-detail-close:active {
    background: rgba(0, 0, 0, 0.6);
}

.spot-detail-category {
    position: absolute;
    bottom: 16px;
    left: 16px;
    background: rgba(45, 58, 74, 0.85);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1;
}

/* No image fallback hero */
.spot-detail-hero-fallback {
    position: relative;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #2D3A4A 0%, #3D5A80 50%, #4A6FA5 100%);
    border-radius: 24px 24px 0 0;
}

/* Star rating */
.star-filled { color: #E9C46A; }
.star-half { color: #E9C46A; }
.star-empty { color: #E2E8F0; }

/* Highlight tags */
.highlight-tag {
    background: rgba(45, 58, 74, 0.06);
    color: #3D5A80;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

/* --- Search Overlay --- */
.search-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #F7F7F5;
    z-index: 60;
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

.search-overlay.active {
    display: block;
    opacity: 1;
}

.search-input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border-radius: 14px;
    border: 1.5px solid #E2E8F0;
    background: white;
    font-size: 15px;
    font-family: 'Noto Sans JP', sans-serif;
    color: #1A1A2E;
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: #3D5A80;
}

.search-input::placeholder {
    color: #94A3B8;
}

.search-tab {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: #E2E8F0;
    color: #64748B;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
    flex-shrink: 0;
}

.search-tab.active {
    background: #2D3A4A;
    color: white;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: white;
    border-radius: 16px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.15s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.search-result-item:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.search-result-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F1F5F9;
    border-radius: 12px;
    flex-shrink: 0;
}

.search-result-text {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-size: 14px;
    font-weight: 600;
    color: #1A1A2E;
    line-height: 1.4;
}

.search-result-sub {
    font-size: 12px;
    color: #64748B;
    margin-top: 2px;
}

.search-result-item mark {
    background: #FEF08A;
    color: inherit;
    padding: 0 1px;
    border-radius: 2px;
}

.search-empty {
    text-align: center;
    padding: 48px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- Search highlight flash --- */
@keyframes highlightFlash {
    0% { box-shadow: 0 0 0 3px rgba(238,108,77,0.5); }
    100% { box-shadow: 0 0 0 0 rgba(238,108,77,0); }
}

.search-highlight {
    animation: highlightFlash 1.5s ease-out;
}

/* Image skeleton loading */
.img-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: imgShimmer 1.5s infinite;
}

@keyframes imgShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
