/* ==========================================================================
   Itinerary Detail — TripTalk Style
   ========================================================================== */

/* Variables - TripTalk Purple Theme */
:root {
    --tt-primary: #7c3aed;
    --tt-primary-light: #a78bfa;
    --tt-primary-bg: rgba(124, 58, 237, 0.08);
    --tt-text: #1f2937;
    --tt-text-light: #6b7280;
    --tt-bg: #ffffff;
    --tt-bg-alt: #f9fafb;
    --tt-border: #e5e7eb;
    --tt-radius: 12px;
    --tt-shadow: 0 1px 3px rgba(0,0,0,0.08);
    --tt-shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
}

/* Timeline Container */
.itinerary-days {
    margin-bottom: 48px;
}

.timeline {
    position: relative;
    padding-left: 40px;
}

.timeline-item {
    position: relative;
    margin-bottom: 32px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -40px;
    top: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.day-number {
    display: inline-block;
    background: var(--tt-primary);
    color: white;
    font-size: 0.688rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 12px;
    white-space: nowrap;
    position: relative;
    left: -8px;
}

.timeline-content {
    background: var(--tt-bg);
    border-radius: var(--tt-radius);
    padding: 24px;
    box-shadow: var(--tt-shadow);
}

.day-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--tt-text);
}

.day-description {
    font-size: 0.938rem;
    line-height: 1.7;
    color: var(--tt-text);
    margin-bottom: 16px;
}

.day-description p:last-child {
    margin-bottom: 0;
}

.day-places {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

.places-label {
    font-size: 0.813rem;
    font-weight: 600;
    color: var(--tt-text-light);
}

.place-tag {
    display: inline-block;
    padding: 3px 10px;
    background: var(--tt-primary-bg);
    color: var(--tt-primary);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.day-tip {
    padding: 12px 16px;
    background: rgba(16, 185, 129, 0.08);
    border-radius: var(--tt-radius);
    font-size: 0.875rem;
    color: var(--tt-text);
}

/* ==========================================================================
   Day > Spot (TripTalk Style)
   ========================================================================== */

.day-block {
    margin-bottom: 40px;
}

.day-block:last-child {
    margin-bottom: 0;
}

/* Day Header */
.day-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--tt-border);
}

.day-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--tt-primary);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 24px;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.day-header-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--tt-text);
    margin: 0;
}

.day-summary {
    font-size: 0.875rem;
    color: var(--tt-text-light);
    margin: 0;
}

/* Spots Container */
.spots-timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Spot Card - TripTalk Style */
.spot-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: var(--tt-bg);
    border: 1px solid var(--tt-border);
    border-radius: var(--tt-radius);
    padding: 20px;
    transition: all 0.2s ease;
}

.spot-card:hover {
    border-color: var(--tt-primary-light);
    box-shadow: var(--tt-shadow-lg);
}

/* Spot Number Circle */
.spot-number-badge {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--tt-primary);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    border-radius: 50%;
}

/* Spot Content */
.spot-content {
    flex: 1;
    min-width: 0;
}

/* Spot Header with Name and Meta */
.spot-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.spot-name {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: var(--tt-text);
}

.spot-time {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: var(--tt-primary-bg);
    color: var(--tt-primary);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 12px;
}

.spot-duration {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: var(--tt-bg-alt);
    color: var(--tt-text-light);
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 12px;
}

.spot-cuisine {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: rgba(249, 115, 22, 0.1);
    color: #ea580c;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 12px;
}

/* Spot Description */
.spot-description {
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--tt-text-light);
    margin: 0 0 12px;
}

.spot-description:last-child {
    margin-bottom: 0;
}

.spot-description a {
    color: var(--tt-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Restaurant Meta */
.spot-restaurant-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.spot-menu,
.spot-price,
.spot-wait-tip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--tt-bg-alt);
    color: var(--tt-text-light);
    font-size: 0.75rem;
    border-radius: 8px;
}

/* Spot Tip Box */
.spot-tip {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 14px;
    background: rgba(16, 185, 129, 0.08);
    border-radius: 10px;
    font-size: 0.813rem;
    line-height: 1.6;
    color: var(--tt-text);
    margin-top: 12px;
}

.spot-tip .tip-icon {
    flex-shrink: 0;
}

.spot-tip .tip-text {
    flex: 1;
}

.spot-tip a {
    color: #059669;
    text-decoration: underline;
}

/* Spot Link */
.spot-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 12px;
    padding: 8px 16px;
    background: var(--tt-primary);
    color: #fff;
    font-size: 0.813rem;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.spot-link:hover {
    background: #6d28d9;
    color: #fff;
}

/* Day Tip Box */
.day-tip-box {
    margin-top: 20px;
    padding: 18px 20px;
    background: var(--tt-bg-alt);
    border: 1px solid var(--tt-border);
    border-radius: var(--tt-radius);
}

.day-tip-content strong {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--tt-text);
    margin-bottom: 6px;
}

.day-tip-content p {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--tt-text-light);
    margin: 0;
}

/* ==========================================================================
   Gallery Grid
   ========================================================================== */

.itinerary-gallery {
    margin-bottom: 48px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.gallery-item {
    display: block;
    border-radius: var(--tt-radius);
    overflow: hidden;
    aspect-ratio: 4 / 3;
    position: relative;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
}

.gallery-item:hover::after {
    background: rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   Map
   ========================================================================== */

.itinerary-map {
    margin-bottom: 48px;
}

.map-container {
    width: 100%;
    height: 400px;
    border-radius: var(--tt-radius);
    overflow: hidden;
    background: var(--tt-bg-alt);
    box-shadow: var(--tt-shadow);
}

/* ==========================================================================
   Lightbox
   ========================================================================== */

.ft-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ft-lightbox.active {
    opacity: 1;
}

.ft-lightbox-img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
}

.ft-lightbox-caption {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 0.875rem;
    text-align: center;
    max-width: 600px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: var(--tt-radius);
}

.ft-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
    z-index: 1;
}

.ft-lightbox-prev,
.ft-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 16px;
    border-radius: 50%;
    z-index: 1;
    transition: background 0.2s ease;
}

.ft-lightbox-prev:hover,
.ft-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ft-lightbox-prev { left: 20px; }
.ft-lightbox-next { right: 20px; }

.ft-lightbox-counter {
    position: absolute;
    top: 24px;
    left: 24px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    /* 일정 컨테이너 패딩 */
    .itinerary-days {
        padding: 0 12px;
    }

    .days-spots-container {
        padding: 0;
    }

    /* 스팟 타임라인 - 중앙 정렬 및 간격 */
    .spots-timeline {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 12px;
        border: none;
        border-radius: 0;
        overflow: visible;
    }

    /* 스팟 카드 - 중앙 배치, 개별 카드 스타일 */
    .spot-card {
        position: relative;
        flex-direction: row;
        align-items: flex-start;
        gap: 12px;
        padding: 16px;
        width: 100%;
        max-width: 100%;
        border: 1px solid var(--tt-border);
        border-radius: 12px;
        margin-bottom: 0;
        background: var(--tt-bg);
    }

    .spot-card:first-child {
        border-top: 1px solid var(--tt-border);
    }

    .spot-card:last-child {
        border-bottom: 1px solid var(--tt-border);
    }

    .spot-card:hover {
        border-color: var(--tt-border);
        box-shadow: none;
    }

    /* 번호 배지 - 인라인 표시 */
    .spot-number-badge {
        display: flex;
        position: static;
        flex-shrink: 0;
        width: 28px;
        height: 28px;
        font-size: 0.813rem;
    }

    /* 스팟 콘텐츠 */
    .spot-content {
        flex: 1;
        width: auto;
        padding: 0;
        box-shadow: none;
        border-radius: 0;
        background: transparent;
    }

    .spot-content:hover {
        box-shadow: none;
        transform: none;
    }

    .spot-header {
        position: relative;
        margin-bottom: 12px;
    }

    .spot-name {
        font-size: 1.063rem;
        margin-bottom: 6px;
    }

    .spot-time,
    .spot-duration {
        font-size: 0.75rem;
    }

    .spot-description {
        font-size: 0.875rem;
        line-height: 1.7;
        margin-bottom: 12px;
    }

    .spot-tip {
        padding: 14px 16px;
        margin-top: 12px;
        border-radius: 10px;
    }

    .day-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding-bottom: 16px;
        margin-bottom: 16px;
    }

    .day-badge {
        font-size: 0.813rem;
        padding: 6px 14px;
    }

    .day-header-title {
        font-size: 1rem;
    }

    .day-block {
        margin-bottom: 32px;
        border: none;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .day-tip-box {
        padding: 16px;
        margin-top: 16px;
    }
}
