/* ===================================
   TOUR ITINERARY - DESKTOP ONLY
   =================================== */

/* Only apply on desktop screens */
@media (min-width: 769px) {

    /* Itinerary Section Container - Constrained to main content column */
    .tour-itinerary-section {
        max-width: 100%;
        margin: 60px 0;
        padding: 0;
        width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
        min-width: 0;
    }

    /* Section Title */
    .tour-itinerary-section .section-title {
        font-size: 28px;
        font-weight: 700;
        color: #2c3e50;
        margin-bottom: 30px;
        padding-bottom: 15px;
        border-bottom: 2px solid #e0e0e0;
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .tour-itinerary-section .section-title i {
        color: #007bff;
        font-size: 24px;
    }

    /* Summary Bar */
    .itinerary-summary-bar {
        display: flex;
        justify-content: space-between;
        gap: 20px;
        padding: 20px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border-radius: 12px;
        margin-bottom: 50px;
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }

    .summary-item {
        display: flex;
        align-items: center;
        gap: 8px;
        color: white;
        font-size: 14px;
        font-weight: 600;
    }

    .summary-item i {
        font-size: 18px;
        opacity: 0.9;
    }

    /* Timeline Container */
    .itinerary-timeline {
        position: relative;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    /* Individual Day */
    .itinerary-day {
        display: flex !important;
        gap: 25px;
        margin-bottom: 60px;
        position: relative;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .itinerary-day:last-child {
        margin-bottom: 0;
    }

    /* Day Indicator (Badge + Timeline Line) */
    .day-indicator {
        display: flex;
        flex-direction: column;
        align-items: center;
        flex-shrink: 0;
        position: relative;
        padding: 5px 8px;
        /* Space for scale expansion */
        margin-right: 15px;
        /* Space from content */
    }

    .day-badge {
        width: 60px;
        height: 60px;
        border-radius: 50%;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 2;
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
        transition: all 0.3s;
        flex-shrink: 0;
        position: relative;
        /* Needed for z-index */
    }

    .itinerary-day:hover .day-badge {
        transform: scale(1.05) translateY(-2px);
        /* Scale + move up */
        box-shadow: 0 3px 12px rgba(102, 126, 234, 0.5);
        z-index: 10;
        /* Bring to front */
    }

    .day-number {
        font-size: 24px;
        font-weight: bold;
        color: white;
    }

    /* Timeline Connecting Line */
    .timeline-line {
        width: 3px;
        flex: 1;
        background: linear-gradient(to bottom, #667eea, #764ba2);
        margin-top: 10px;
        min-height: 100px;
        position: relative;
    }

    /* Animated pulse on timeline */
    .timeline-line::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 8px;
        height: 8px;
        background: #764ba2;
        border-radius: 50%;
        animation: pulse 2s infinite;
    }

    @keyframes pulse {

        0%,
        100% {
            opacity: 0;
            transform: translateX(-50%) translateY(0);
        }

        50% {
            opacity: 1;
            transform: translateX(-50%) translateY(50px);
        }
    }

    /* Content Wrapper (Text + Image) */
    .day-content-wrapper {
        flex: 1;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 30px;
        align-items: start;
        min-width: 0;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
        padding: 8px 0;
        /* Vertical padding for hover effects */
    }

    /* Ensure grid items don't overflow */
    .day-content-wrapper>* {
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Reverse layout for zigzag effect */
    .day-content-wrapper.reverse {
        direction: rtl;
    }

    .day-content-wrapper.reverse>* {
        direction: ltr;
    }

    /* Text Content */
    .day-text-content {
        background: white;
        padding: 25px;
        border-radius: 12px;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
        transition: all 0.3s;
        border: 1px solid #f0f0f0;
        min-width: 0;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        overflow-wrap: break-word;
        word-wrap: break-word;
    }

    .day-text-content:hover {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
        transform: translateY(-2px);
        /* Reduced from -4px */
        border-color: #e0e0e0;
    }

    .day-title {
        font-size: 16px;
        font-weight: 600;
        color: #2c3e50;
        margin-bottom: 15px;
        line-height: 1.4;
    }

    /* Day Label - Overlay on Image (Top-Left Corner) */
    .day-label {
        position: absolute;
        top: 15px;
        left: 15px;
        padding: 8px 16px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: #ffffff;
        border-radius: 20px;
        font-size: 14px;
        font-weight: 600;
        letter-spacing: 0.5px;
        z-index: 10;
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
        display: inline-block;
        white-space: nowrap;
    }

    /* For zigzag layout - even items (image on right) */
    .itinerary-day.layout-reverse .day-label {
        left: auto;
        right: 15px;
    }

    /* Remove day-label from content area if it exists there */
    .day-text-content .day-label {
        display: none;
    }

    .day-description {
        font-size: 15px;
        line-height: 1.7;
        color: #555;
    }

    .day-description p {
        margin-bottom: 12px;
    }

    .day-description p:last-child {
        margin-bottom: 0;
    }

    /* Image Content */
    .day-image-content {
        position: relative;
        min-width: 0;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }

    .image-wrapper {
        position: relative;
        border-radius: 16px;
        overflow: hidden;
        box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        background: #f8f9fa;
    }

    .image-wrapper:hover {
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
        transform: translateY(-3px) scale(1.01);
        /* Reduced from -6px and 1.02 */
    }

    .image-wrapper img {
        width: 100%;
        height: 380px;
        object-fit: cover;
        display: block;
        cursor: pointer;
        transition: all 0.4s;
    }

    .image-wrapper:hover img {
        transform: scale(1.03);
        /* Reduced from 1.05 */
    }

    /* Image Overlay */
    .image-overlay {
        position: absolute;
        inset: 0;
        background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.7) 100%);
        display: flex;
        align-items: flex-end;
        justify-content: center;
        padding: 30px;
        opacity: 0;
        transition: all 0.3s;
    }

    .image-wrapper:hover .image-overlay {
        opacity: 1;
    }

    /* View Fullscreen Button */
    .view-fullscreen-btn {
        padding: 14px 28px;
        background: white;
        border: none;
        border-radius: 30px;
        font-size: 15px;
        font-weight: 600;
        color: #333;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 10px;
        transform: translateY(20px);
        transition: all 0.3s;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    }

    .image-wrapper:hover .view-fullscreen-btn {
        transform: translateY(0);
    }

    .view-fullscreen-btn:hover {
        background: #007bff;
        color: white;
        transform: translateY(0) scale(1.05);
    }

    .view-fullscreen-btn i {
        font-size: 14px;
    }

    /* No Image Placeholder */
    .image-wrapper.no-image {
        height: 380px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    }

    .no-image-placeholder {
        text-align: center;
        color: #999;
    }

    .no-image-placeholder i {
        font-size: 60px;
        margin-bottom: 15px;
        opacity: 0.5;
    }

    .no-image-placeholder p {
        font-size: 16px;
        font-weight: 500;
    }

    /* FORCE DESKTOP LAYOUT - Override mobile styles */
    .itinerary-day {
        display: flex !important;
        flex-direction: row !important;
        gap: 25px !important;
    }

    .day-content-wrapper {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 30px !important;
        max-height: none !important;
        padding: 8px 0 !important;
        /* Vertical padding for hover effects */
    }

    /* HIDE MOBILE ELEMENTS ON DESKTOP */
    .mobile-itinerary-summary,
    .accordion-header,
    .toggle-icon,
    .image-expand-btn,
    .day-header-content {
        display: none !important;
    }

    /* SHOW DESKTOP ELEMENTS */
    .day-indicator {
        display: flex !important;
    }

    .timeline-line {
        display: block !important;
    }

    .itinerary-summary-bar {
        display: flex !important;
    }

    .day-text-content .day-title {
        display: block !important;
    }

    .image-overlay,
    .view-fullscreen-btn {
        display: flex !important;
    }
}

/* Lightbox Modal (for fullscreen image view) */
.image-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.image-lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    display: inline-block;
    max-width: 95vw;
    max-height: 95vh;
    animation: zoomIn 0.3s;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.lightbox-content img {
    display: block;
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 14px 18px;
    text-align: left;
    color: white;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.45) 60%, rgba(0, 0, 0, 0) 100%);
    border-radius: 0 0 8px 8px;
    pointer-events: none;
    z-index: 2;
}

@media (max-width: 768px) {
    .lightbox-caption {
        padding: 12px 14px;
        font-size: 14px;
    }
}

.lightbox-close {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 20px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s;
    backdrop-filter: blur(8px);
    z-index: 10010;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* ===================================
   TOUR ITINERARY - MOBILE ONLY
   =================================== */

@media (max-width: 768px) {

    /* FORCE MOBILE LAYOUT - Override desktop styles */
    .itinerary-day {
        display: block !important;
        flex-direction: column !important;
        gap: 0 !important;
    }

    .day-content-wrapper {
        display: block !important;
        grid-template-columns: unset !important;
        flex: unset !important;
        gap: 0 !important;
    }

    /* Hide Desktop Elements on Mobile */
    .itinerary-summary-bar,
    .timeline-line,
    .day-indicator {
        display: none !important;
    }

    /* Mobile Container - Match vendor-card width by removing horizontal padding */
    .tour-itinerary-section {
        padding: 20px 0 !important;
        /* No horizontal padding - matches vendor-card width */
        margin: 30px 0;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Section Title - Mobile - Add padding to match vendor-card alignment */
    .tour-itinerary-section .section-title {
        font-size: 22px;
        font-weight: 700;
        color: #2c3e50;
        margin-bottom: 8px;
        padding: 0 16px 0 16px !important;
        /* Match service-detail-container padding */
        padding-bottom: 0;
        border-bottom: none;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .tour-itinerary-section .section-title i {
        color: #667eea;
        font-size: 20px;
    }

    /* Mobile Summary (below title) - Add padding to match vendor-card alignment */
    .mobile-itinerary-summary {
        font-size: 13px;
        color: #666;
        margin-bottom: 20px;
        padding: 0 16px !important;
        /* Match service-detail-container padding */
        display: flex;
        align-items: center;
        gap: 12px;
        flex-wrap: wrap;
    }

    .mobile-itinerary-summary span {
        display: inline-flex;
        align-items: center;
        gap: 5px;
    }

    .mobile-itinerary-summary i {
        font-size: 12px;
        color: #667eea;
    }

    /* Accordion Container - Full Width */
    .itinerary-timeline {
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Individual Day - Accordion Item - Match vendor-card width exactly */
    /* Cards expand to use full available width and match vendor-card alignment */
    .itinerary-day {
        background: white;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        overflow: hidden;
        transition: all 0.3s;
        display: block !important;
        margin-bottom: 0;
        gap: 0;
        /* Match vendor-card width: 100% - no padding on card itself */
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 0 !important;
        /* No padding on card - children handle padding */
        box-sizing: border-box !important;
    }

    .itinerary-day.active {
        box-shadow: 0 4px 16px rgba(102, 126, 234, 0.15);
    }

    /* Accordion Header (Clickable) - Full Width - Match vendor-card padding */
    .accordion-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 16px !important;
        /* Match vendor-card padding: 20px 16px (using 16px vertical for header) */
        cursor: pointer;
        user-select: none;
        background: white;
        transition: background 0.2s;
        position: relative;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .accordion-header:active {
        background: #f8f9fa;
    }

    /* Day Badge (Left) - Mobile */
    .accordion-header .day-badge {
        width: 42px;
        height: 42px;
        border-radius: 50%;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        box-shadow: 0 3px 12px rgba(102, 126, 234, 0.3);
        margin-right: 12px !important;
        /* Add spacing between badge and title */
    }

    .accordion-header .day-number {
        font-size: 18px;
        font-weight: bold;
        color: white;
    }

    /* Day Title (Center) */
    .day-header-content {
        flex: 1;
        padding: 0 12px;
    }

    .day-header-content .day-title {
        font-size: 16px;
        font-weight: 600;
        color: #2c3e50;
        margin: 0;
        line-height: 1.3;
    }

    .day-header-content .day-label {
        display: none;
        /* Hide "Day 1" label on mobile */
    }

    /* Toggle Icon (Right) */
    .toggle-icon {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: #f0f0f0;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        transition: all 0.3s;
    }

    .toggle-icon i {
        font-size: 14px;
        color: #666;
        transition: transform 0.3s;
    }

    .itinerary-day.active .toggle-icon {
        background: #667eea;
    }

    .itinerary-day.active .toggle-icon i {
        color: white;
        transform: rotate(180deg);
    }

    /* Accordion Content (Expandable) - Full Width - Match vendor-card padding */
    .day-content-wrapper {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-out;
        display: block;
        padding: 0 16px !important;
        /* Match vendor-card horizontal padding: 16px left/right */
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .itinerary-day.active .day-content-wrapper {
        max-height: 2000px;
        /* Large enough for content */
        padding-bottom: 16px !important;
        /* Bottom padding */
        padding-top: 0 !important;
        padding-left: 16px !important;
        /* Match vendor-card horizontal padding */
        padding-right: 16px !important;
        /* Match vendor-card horizontal padding */
    }

    /* Image Preview - Mobile - Full Width */
    .day-image-content {
        width: 100%;
        max-width: 100%;
        margin-bottom: 16px;
        margin-top: 12px;
        box-sizing: border-box;
    }

    .day-image-content .image-wrapper {
        position: relative;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .day-image-content .image-wrapper img {
        width: 100%;
        max-width: 100%;
        height: 200px;
        object-fit: cover;
        display: block;
        box-sizing: border-box;
        cursor: pointer;
    }

    /* Day Label - Mobile - Smaller size */
    .day-label {
        top: 10px;
        left: 10px;
        padding: 6px 12px;
        font-size: 12px;
    }

    /* For zigzag layout - even items (image on right) - Mobile */
    .itinerary-day.layout-reverse .day-label {
        left: auto;
        right: 10px;
    }

    /* View Full Size Button - Mobile */
    .image-expand-btn {
        position: absolute;
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: rgba(0, 0, 0, 0.6);
        border: none;
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        backdrop-filter: blur(4px);
        transition: all 0.2s;
    }

    .image-expand-btn:active {
        background: rgba(0, 0, 0, 0.8);
        transform: scale(0.95);
    }

    .image-expand-btn i {
        font-size: 14px;
    }

    /* Text Content - Mobile - Full Width */
    .day-text-content {
        background: transparent;
        padding: 0;
        border-radius: 0;
        box-shadow: none;
        border: none;
        margin-bottom: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .day-text-content .day-title {
        display: none;
        /* Hide duplicate title in mobile */
    }

    .day-description {
        font-size: 14px;
        line-height: 1.6;
        color: #555;
        margin-bottom: 0;
    }

    .day-description p {
        margin-bottom: 10px;
    }

    .day-description p:last-child {
        margin-bottom: 0;
    }

    /* Hide overlay on mobile */
    .image-overlay,
    .view-fullscreen-btn {
        display: none;
    }

    /* No Image Placeholder - Mobile */
    .day-image-content .image-wrapper.no-image {
        height: 200px;
        background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    }

    .day-image-content .no-image-placeholder i {
        font-size: 40px;
    }

    .day-image-content .no-image-placeholder p {
        font-size: 14px;
    }
}

/* ===== PUBLIC ITINERARY MAP WIDGET ===== */
.itinerary-map-widget {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.10);
    overflow: hidden;
    margin-top: 20px;
}

.itinerary-map-widget-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-weight: 600;
    font-size: 15px;
}

.itinerary-map-widget-header i {
    font-size: 16px;
}

#publicItineraryMap {
    width: 100%;
    height: 320px;
}

.itinerary-map-legend {
    padding: 12px 16px;
    max-height: 260px;
    overflow-y: auto;
    border-top: 1px solid #f0f0f0;
}

.map-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 8px;
    font-size: 13px;
    color: #444;
    border-bottom: 1px solid #f5f5f5;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
    margin: 1px 0;
}

.map-legend-item:last-child {
    border-bottom: none;
}

.map-legend-item:hover {
    background: #f3f4ff;
    color: #667eea;
}

.map-legend-item:hover .map-legend-dot {
    transform: scale(1.12);
}

.map-legend-item.active {
    background: linear-gradient(90deg, #ede9fe 0%, #f3f4ff 100%);
    color: #5a4fcf;
    font-weight: 600;
}

.map-legend-item.active .map-legend-dot {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.map-legend-label {
    flex: 1;
}

.map-legend-arrow {
    font-size: 13px;
    color: #c5c9e8;
    transition: color 0.18s, transform 0.18s;
    display: flex;
    align-items: center;
}

.map-legend-item:hover .map-legend-arrow,
.map-legend-item.active .map-legend-arrow {
    color: #667eea;
    transform: scale(1.2);
}

.map-legend-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    min-width: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
}



/* InfoWindow */
.map-info-window {
    font-size: 13px;
    line-height: 1.5;
    min-width: 120px;
}

/* Remove focus outline from Google Maps InfoWindow close button */
.gm-ui-hover-effect {
    outline: none !important;
}

/* Mobile — map smaller */
@media (max-width: 768px) {
    #publicItineraryMap {
        height: 220px;
    }

    .itinerary-map-widget {
        margin-top: 16px;
    }
}

.itinerary-map-sticky {
    position: fixed;
    top: 80px;
    z-index: 900;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    width: var(--map-widget-width, 340px);
    right: var(--map-widget-right, 20px);
}

.itinerary-map-placeholder {
    display: block;
    width: 100%;
}

@media (max-width: 1024px) {
    .itinerary-map-sticky {
        position: static;
        width: 100%;
        right: auto;
        top: auto;
    }
}

@media (max-width: 768px) {
    .itinerary-map-mobile-slot {
        margin: 30px 0;
    }

    .itinerary-map-mobile-slot .itinerary-map-widget {
        margin-top: 0;
    }

    .itinerary-map-mobile-slot #publicItineraryMap {
        height: 250px;
    }
}