/* ============================================= */
/* ITINERARY MASTER STYLESHEET - FINAL v2.0     */
/* Centered Cards + Responsive + Print + Slideshow */
/* ============================================= */

/* Global & Background Slideshow */
body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    color: #1f2937;
    background: #f9fafb;
    overflow-x: hidden;
    line-height: 1.6;
    position: relative;
}

.bg-slideshow {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -2;
    overflow: hidden;
}

.bg-slideshow img {
    position: absolute;
    width: 100%; height: 100%;
    object-fit: cover;
    filter: blur(10px) brightness(0.6);
    opacity: 0;
    transform: scale(1.1);
    transition: opacity 3s ease-in-out, transform 20s linear;
}

.bg-slideshow img.active {
    opacity: 1;
    transform: scale(1);
}

.bg-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(3px);
    z-index: -1;
}

/* Header */
header {
    background: rgba(25, 118, 210, 0.9);
    color: #fff;
    text-align: center;
    padding: 1.5rem 1rem;
    backdrop-filter: blur(6px);
    position: relative;
    z-index: 100;
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
}

/* Tabs Navigation */
.tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    background: rgba(227, 242, 253, 0.9);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(6px);
    padding: 4px 0;
}

.tab {
    padding: 10px 16px;
    margin: 4px;
    border-radius: 8px;
    background: rgba(187, 222, 251, 0.9);
    color: #0d47a1;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    text-align: center;
    min-width: 100px;
    max-width: 180px;
    font-weight: 500;
}

.tab:hover {
    background: rgba(167, 202, 231, 0.9);
}

.tab.active {
    background: #1976d2;
    color: #fff;
    font-weight: 600;
}

/* Highlights Section */
.highlights {
    background: rgba(255, 255, 255, 0.9);
    margin: 20px;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(4px);
}

.highlights h2 {
    color: #0d47a1;
    margin-top: 0;
    font-size: 1.3rem;
}

.highlights ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin: 0.8rem 0;
}

.highlights li {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

/* Responsive Grid - PERFECTLY CENTERED */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    padding: 1rem;
    justify-items: center;          /* Centers each card in its cell */
    justify-content: center;        /* Centers entire row if not full */
}

/* Fallback for very old browsers */
@supports not (display: grid) {
    .grid {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Card Design - Centered & Responsive */
.card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    max-width: 500px;
    min-width: 260px;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(4px);
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

/* Uniform Images */
.card img,
.day .card img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: block;
    transition: transform 0.3s ease;
}

.card img:hover,
.day .card img:hover {
    transform: scale(1.03);
}

/* Card Content */
.card-content {
    padding: 4%;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-content h3 {
    margin: 0 0 0.5rem 0;
    color: #0d47a1;
    font-size: 1.1rem;
    font-weight: 600;
}

.card-content p {
    font-size: 0.95rem;
    margin: 0.4rem 0;
    color: #374151;
}

.card-content a {
    color: #1976d2;
    text-decoration: none;
    font-weight: 500;
    word-break: break-word;
}

.card-content a:hover {
    text-decoration: underline;
}

.price {
    font-weight: bold;
    color: #2e7d32;
    margin-top: 8px;
    font-size: 0.95rem;
}

/* Hotel Recommendations */
.hotel-recommendations {
    margin-top: 20px;
    padding: 15px;
    background: rgba(240, 248, 255, 0.9);
    border-radius: 8px;
    font-size: 0.95rem;
}

.hotel-recommendations h4 {
    margin: 0 0 10px 0;
    color: #0d47a1;
    font-size: 1rem;
}

.hotel-recommendations ul {
    list-style-type: disc;
    padding-left: 20px;
    margin: 0;
}

.hotel-recommendations li {
    margin-bottom: 8px;
}

/* Print Button */
.print-btn {
    display: block;
    margin: 20px auto;
    padding: 12px 20px;
    background: #1976d2;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    width: 90%;
    max-width: 300px;
    transition: background 0.3s ease;
}

.print-btn:hover {
    background: #0d47a1;
}

/* Responsive Adjustments */
@media (max-width: 900px) {
    .card {
        max-width: 100%;
    }
    header h1 {
        font-size: 1.5rem;
    }
    .tab {
        min-width: 90px;
        font-size: 0.9rem;
        padding: 8px 12px;
    }
}

@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr;
        padding: 0.5rem;
    }
    .card {
        width: 100%;
        min-width: 0;
    }
    .card img,
    .day .card img {
        aspect-ratio: 16 / 10;
    }
    header h1 {
        font-size: 1.3rem;
    }
    .highlights {
        margin: 1rem;
        padding: 1rem;
    }
}

@media (max-width: 600px) {
    .tabs {
        flex-direction: column;
        align-items: stretch;
    }
    .tab {
        margin: 2px 10px;
        border-radius: 6px;
    }
    .card-content h3 {
        font-size: 1rem;
    }
    .card-content p {
        font-size: 0.9rem;
    }
}

/* Print Styles */
@media print {
    .tabs, .print-btn, .bg-slideshow, .bg-overlay {
        display: none !important;
    }
    body, header {
        background: #fff !important;
        color: #000 !important;
    }
    header {
        border-bottom: 2px solid #1976d2;
        padding: 1rem;
    }
    .highlights, .card {
        background: #fff !important;
        box-shadow: none !important;
        break-inside: avoid;
    }
    .grid, .day {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }
    .card {
        width: 100% !important;
        max-width: none !important;
        page-break-inside: avoid;
    }
    .card img {
        height: 120px !important;
        object-fit: cover;
    }
    a {
        color: #000 !important;
        text-decoration: underline;
    }
}

/* ────────────────── MOBILE: 2×3 GRID LAYOUT ────────────────── */
@media (max-width: 768px) {
    .tabs { display: none; }
    .tabs-dropdown-wrapper { 
        display: block; 
        margin-bottom: 1rem;
    }

    .day {
        display: grid !important;
        grid-template-columns: 1fr 1fr;   /* 2 cards per row */
        gap: 1rem;
        padding: 0.5rem;
    }

    .grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 1rem;
        padding: 0;
        justify-content: center;
    }

    .card {
        width: 100% !important;
        min-width: 0;
    }

    /* Optional: limit visible height to 3 rows */
    .day {
        max-height: calc((100vw / 2 - 1rem) * 1.2 * 3 + 2rem);
        overflow-y: auto;
        padding-bottom: 1rem;
    }
}

/* Dropdown styling */
.day-select {
    width: 100%;
    padding: 0.9rem 1rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: white;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23666'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
    -webkit-appearance: none;
    appearance: none;
}

.tabs-dropdown-wrapper {
    display: none;
}