/* ==========================================================================
   Package Customizer Styles
   Based on the timeline + sidebar layout for public-facing canvas7 theme.
   ========================================================================== */

:root {
    --trawy-primary: #2c5282;
    --trawy-secondary: #4299e1;
    --trawy-accent: #63b3ed;
    --trawy-dark: #1a202c;
    --trawy-light: #f7fafc;
    --trawy-gray: #718096;
    --trawy-green: #38a169;
    --trawy-orange: #ed8936;
}

/* Hero Section */
.customize-hero {
    min-height: 35vh;
    background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)),
                url('https://images.unsplash.com/photo-1539650116574-75c0c6d0b3b7?w=1600&h=800&fit=crop') center/cover;
    display: flex;
    align-items: center;
    color: white;
    padding-top: 80px;
}

.customize-hero .hero-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.customize-hero .hero-subtitle {
    font-size: 1.15rem;
    opacity: 0.9;
}

/* Main Content */
.trip-customization {
    padding: 2rem 0 4rem;
}

.customizer-heading {
    color: var(--trawy-dark);
    font-weight: 700;
    font-size: 1.5rem;
}

/* Timeline Sections */
.timeline-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04), 0 4px 8px rgba(0,0,0,0.03);
    padding: 1.5rem 2rem;
    margin-bottom: 1.25rem;
    overflow: visible;
}

.section-title {
    color: var(--trawy-dark);
    font-weight: 600;
    font-size: 1.25rem;
    margin-bottom: 0;
}

/* Timeline Day */
.timeline-day {
    margin-bottom: 0.5rem;
}

/* Day number badge */
.day-number {
    background: var(--trawy-primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    display: inline-block;
    margin-bottom: 0.75rem;
}

/* Activity Cards */
.activity-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 0.75rem;
    margin-top: 0.75rem;
    transition: all 0.2s ease;
    position: relative;
    overflow: visible;
}

.activity-card:hover {
    border-color: var(--trawy-secondary);
    box-shadow: 0 2px 8px rgba(66, 153, 225, 0.12);
}

.activity-card.included {
    border-color: var(--trawy-green);
    background: rgba(56, 161, 105, 0.02);
}

.activity-badge {
    position: absolute;
    top: -10px;
    right: 14px;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    z-index: 1;
}

.activity-badge.included {
    background: var(--trawy-green);
    color: white;
}

.activity-badge.fixed {
    background: var(--trawy-primary);
    color: white;
}

.activity-badge.optional {
    background: var(--trawy-orange);
    color: white;
}

/* Ensure space for badges above cards */
.timeline-section .activity-card:first-of-type {
    margin-top: 0.75rem;
}

/* Flight/Hotel/Transfer sections need extra top space for badges */
#flight-section .activity-card,
#hotel-section .activity-card,
#transfer-section .activity-card {
    margin-top: 1rem;
}

.activity-image {
    width: 180px;
    height: 120px;
    border-radius: 10px;
    object-fit: cover;
    margin-right: 1.25rem;
    flex-shrink: 0;
}

.activity-content h6 {
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--trawy-dark);
    font-size: 1.1rem;
}

.activity-meta {
    color: var(--trawy-gray);
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
    line-height: 1.5;
}

.activity-meta i {
    font-size: 0.9rem;
    opacity: 0.8;
}

.activity-description {
    color: var(--trawy-gray);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 0;
}

/* Trip Summary Sidebar */
.trip-summary {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    padding: 1.75rem;
    position: sticky;
    top: 100px;
}

.summary-header {
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 1.25rem;
}

.summary-header h5 {
    color: var(--trawy-dark);
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 0;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f7fafc;
    font-size: 1rem;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-total {
    background: var(--trawy-light);
    padding: 1.25rem;
    border-radius: 12px;
    margin: 1.25rem 0;
}

.price-large {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--trawy-primary);
}

.btn-book-now {
    background: var(--trawy-primary);
    border: none;
    color: white;
    font-weight: 600;
    padding: 1rem 1.75rem;
    border-radius: 12px;
    width: 100%;
    font-size: 1.15rem;
    transition: all 0.3s ease;
}

.btn-book-now:hover {
    background: var(--trawy-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(44, 82, 130, 0.3);
}

/* Search Panels */
.search-panel .timeline-section {
    background: #f8fbff;
}

/* Experience Search Panel */
.experience-search-panel .card {
    border: 1px solid #e8ecf0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    background: #fafbfc;
}

.experience-search-panel .experience-results {
    max-height: 320px;
    overflow-y: auto;
}

.experience-search-panel .btn-close-exp-search {
    font-size: 0.8rem;
}

.experience-search-panel .btn-do-exp-search {
    font-size: 0.75rem;
}

/* Search Result Cards (populated by JS) */
.search-result-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-result-card:hover {
    border-color: var(--trawy-primary);
    box-shadow: 0 2px 8px rgba(44, 82, 130, 0.1);
}

.search-result-card:last-child {
    margin-bottom: 0;
}

.search-result-card .activity-image {
    width: 160px;
    height: 110px;
    border-radius: 8px;
    object-fit: cover;
    margin-right: 1rem;
    flex-shrink: 0;
}

.search-result-card strong {
    font-size: 1rem;
    font-weight: 600;
    color: var(--trawy-dark);
    display: block;
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.search-result-card .activity-meta {
    font-size: 0.9rem;
    color: var(--trawy-gray);
    line-height: 1.5;
    margin-bottom: 0;
}

.search-result-card .btn-select-experience {
    font-size: 0.85rem;
    padding: 0.35rem 0.75rem;
    white-space: nowrap;
}

.search-result-card .match-score {
    display: inline-block;
    background: var(--trawy-secondary);
    color: white;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.search-result-card .match-score.high {
    background: var(--trawy-green);
}

.search-result-card .match-reason {
    font-size: 0.85rem;
    color: var(--trawy-gray);
}

/* Loading States */
.loading-overlay {
    position: relative;
}

.loading-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

/* Timeline event times */
.day-events-list {
    margin-bottom: 0.75rem;
}

.timeline-event {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f4f8;
}

.timeline-event:last-child {
    border-bottom: none;
}

.timeline-event:first-child {
    padding-top: 0;
}

.event-time .badge {
    font-size: 0.9rem;
    min-width: 55px;
    font-variant-numeric: tabular-nums;
    padding: 0.35rem 0.5rem;
}

.event-icon {
    margin-right: 0.4rem;
    font-size: 1.1rem;
}

.event-content {
    font-size: 1rem;
    line-height: 1.5;
}

.event-content strong {
    font-weight: 600;
    color: var(--trawy-dark);
}

/* Event thumbnails in day program */
.event-thumbnail {
    width: 140px;
    height: 95px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

/* Thumbnail slider for multiple images */
.event-thumbnail-slider {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    max-width: 220px;
    margin-right: 1rem;
}

.event-thumbnail-slider::-webkit-scrollbar {
    display: none;
}

.event-thumbnail-slider img {
    width: 100px;
    height: 70px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    scroll-snap-align: start;
}

/* Add experience button */
.btn-add-experience {
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

/* Remove experience button */
.btn-remove-experience {
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.btn-remove-experience:hover {
    opacity: 1;
}

/* Tour/experience in timeline */
.timeline-event[data-activity-type="tour"] .event-content {
    background: rgba(99, 179, 237, 0.05);
    border-radius: 6px;
    padding: 0.5rem;
    margin: -0.25rem 0;
}

.timeline-event[data-activity-type="tour"] .activity-description {
    font-size: 0.8rem;
    color: var(--trawy-gray);
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}

/* Differential pricing badges */
.diff-price {
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
    margin-top: 0.15rem;
}

.diff-price.text-success {
    color: var(--trawy-green) !important;
}

.diff-price.text-danger {
    color: #e53e3e !important;
}

/* Adjustment row in pricing sidebar */
#price-adjustment-row {
    border-top: 1px dashed #e2e8f0;
    padding-top: 0.5rem;
}

/* Collapse chevron rotation */
.collapse-chevron {
    transition: transform 0.2s ease;
    display: inline-block;
    font-size: 0.75rem;
}

[aria-expanded="true"] .collapse-chevron {
    transform: rotate(90deg);
}

/* Empty state in timeline */
.day-events-list > .text-muted {
    font-size: 0.8rem;
    padding: 0.15rem 0;
    font-style: italic;
}

/* Compact add button area */
.timeline-day > .mt-2 {
    margin-top: 0.5rem !important;
}

/* Tighter card body in search panel */
.experience-search-panel .card-body.py-2 {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

/* Responsive */
@media (max-width: 992px) {
    .trip-summary {
        position: static;
        margin-top: 2rem;
    }
}

@media (max-width: 768px) {
    .customize-hero .hero-content h1 {
        font-size: 1.6rem;
    }

    .timeline-section {
        padding: 0.875rem 1rem;
    }

    .activity-image {
        width: 120px;
        height: 80px;
    }


    .price-large {
        font-size: 1.25rem;
    }

    .search-result-card {
        padding: 0.625rem;
    }

    .search-result-card .activity-image {
        width: 100px;
        height: 70px;
    }

    .event-thumbnail {
        width: 100px;
        height: 70px;
    }

    .event-thumbnail-slider {
        max-width: 150px;
    }

    .event-thumbnail-slider img {
        width: 70px;
        height: 50px;
    }
}
