/* ================================
   13 - TRIPS PAGE STYLES (ORIGINALE)
   Your Trips page specific styles
   ================================ */

/* --- Trips Hero --- */
.trips-hero {
    position: relative;
    height: 55vh;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-top: 0;
}

.trips-hero .hero-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.trips-hero .slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.trips-hero .slide.active {
    opacity: 1;
}

.trips-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 0%, rgba(15, 23, 42, 0.85) 100%);
    z-index: 1;
}

.trips-hero .hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
}

.trips-hero .hero-content h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.trips-hero .gradient-accent {
    background: linear-gradient(135deg, var(--primary-sky, #00f2fe), var(--primary-green, #4fad55));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.trips-hero .hero-divider {
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, var(--primary-sky, #00f2fe), var(--primary-green, #4fad55));
    margin: 1rem auto;
    border-radius: 2px;
}

.trips-hero .hero-content p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* --- Dashboard Section --- */
.trips-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem 6rem;
}

/* --- Section Header --- */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark-blue, #0f172a);
    margin-bottom: 0.5rem;
}

/* --- Trips Grid --- */
.trips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

/* --- Trip Card --- */
.trip-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
    cursor: pointer;
}

.trip-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 242, 254, 0.15);
}

.trip-card-image {
    height: 200px;
    aspect-ratio: 16/9;
    object-fit: cover;
    width: 100%;
    position: relative;
}

.trip-card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 1;
}

.trip-card-badge.planned {
    background: var(--primary-sky, #00f2fe);
    color: white;
}

.trip-card-badge.completed {
    background: var(--primary-green, #4fad55);
    color: white;
}

.trip-card-body {
    padding: 1.25rem;
}

.trip-card-destination {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark-blue, #0f172a);
    margin-bottom: 0.5rem;
}

.trip-card-dates {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.trip-card-dates i {
    color: var(--primary-sky, #00f2fe);
}

.trip-card-stats,
.trip-card-stat {
    display: flex;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
}

.trip-stat,
.trip-card-stat {
    font-size: 0.8rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 4px;
}

.trip-stat i,
.trip-card-stat i {
    color: var(--primary-sky, #00f2fe);
}

/* --- Section Title Trips (used in modal) --- */
.section-title-trips {
    font-size: 1.1rem;
    color: #0f172a;
    margin: 1.5rem 0 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title-trips i {
    color: var(--primary-sky, #00f2fe);
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 5rem 2rem;
}

.empty-globe {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 2px dashed rgba(0, 242, 254, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    animation: gentle-float 4s ease-in-out infinite;
}

@keyframes gentle-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.empty-globe i {
    font-size: 4rem;
    background: linear-gradient(135deg, var(--primary-sky, #00f2fe), var(--primary-green, #4fad55));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.empty-planes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    animation: orbit 8s linear infinite;
}

@keyframes orbit {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.empty-planes i {
    position: absolute;
    font-size: 1.5rem;
    color: var(--primary-green, #4fad55);
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: var(--dark-blue, #0f172a);
    margin-bottom: 0.75rem;
}

.empty-state p {
    color: #64748b;
    max-width: 400px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.9rem 2rem;
    background: linear-gradient(135deg, var(--primary-sky, #00f2fe), var(--primary-green, #4fad55));
    color: white;
    text-decoration: none;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 242, 254, 0.4);
}

/* --- Loading State --- */
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 242, 254, 0.2);
    border-top-color: var(--primary-sky, #00f2fe);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Trip Modal --- */
.trip-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem 1rem;
    overflow-y: auto;
}

.trip-modal-overlay.active {
    display: flex;
}

.trip-modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 1100px;
    max-height: none;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    margin: 0 auto;
}

.trip-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.trip-modal-close:hover {
    background: rgba(0, 0, 0, 0.2);
    color: var(--dark-blue, #0f172a);
}

.trip-modal-content {
    padding: 2rem;
}

/* --- Itinerary Matrix (Drag & Drop) --- */
.itinerary-matrix-container {
    overflow-x: auto;
    padding: 1rem 0;
}

.itinerary-matrix {
    display: flex;
    gap: 16px;
    min-width: max-content;
    padding: 0.5rem;
}

.matrix-day-column {
    min-width: 260px;
    max-width: 300px;
    background: #f8fafc;
    border-radius: 16px;
    overflow: hidden;
}

.matrix-day-header {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: white;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.matrix-day-header .day-number {
    background: linear-gradient(135deg, var(--primary-sky, #00f2fe), var(--primary-green, #4fad55));
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

.matrix-cards {
    padding: 12px;
    min-height: 200px;
}

.matrix-card {
    background: white;
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid transparent;
    cursor: grab;
    transition: all 0.2s;
}

.matrix-card:hover {
    border-color: var(--primary-sky, #00f2fe);
    box-shadow: 0 4px 12px rgba(0, 242, 254, 0.15);
}

.matrix-card.dragging {
    opacity: 0.4;
    transform: rotate(2deg);
    cursor: grabbing;
}

.matrix-card-placeholder {
    border: 2px dashed #e2e8f0;
    background: transparent;
    min-height: 80px;
}

.matrix-time-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.badge-morning {
    background: rgba(0, 180, 216, 0.1);
    color: #00b4d8;
}

.badge-afternoon {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.badge-evening {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.matrix-card-img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 8px;
}

.matrix-card-icon-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(0, 242, 254, 0.1), rgba(79, 173, 85, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    color: var(--primary-sky, #00f2fe);
    font-size: 1.2rem;
}

.matrix-card h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 4px;
}

.matrix-card p {
    font-size: 0.78rem;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
}

.matrix-card .matrix-desc {
    font-size: 0.78rem;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
}

.matrix-card-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.matrix-action-btn {
    /* Vedi 19-lab.css: larghezza sul contenuto, se no in tedesco
       "Tickets & Touren" va a capo tre volte accanto a "Karte". */
    flex: 1 1 auto;
    min-width: 0;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.btn-map {
    background: linear-gradient(135deg, var(--primary-sky, #00f2fe), var(--primary-green, #4fad55));
    color: white;
}

.btn-ticket {
    background: rgba(0, 242, 254, 0.1);
    color: var(--primary-sky, #00f2fe);
    border: 1px solid rgba(0, 242, 254, 0.2);
}

.matrix-day-body {
    padding: 12px;
    min-height: 120px;
}

.chunk-card-enter {
    animation: chunkFadeIn 0.3s ease-out;
}

@keyframes chunkFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Travel Documents --- */

/* --- Trip Cost Banner --- */
.trip-cost-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: white;
    padding: 14px 20px;
    border-radius: 12px;
    margin: 12px 0 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    gap: 16px;
    flex-wrap: wrap;
}

.trip-cost-banner .cost-banner-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.trip-cost-banner .cost-banner-left i {
    font-size: 1.6rem;
    color: #fbbf24;
}

.trip-cost-banner .cost-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
}

.trip-cost-banner .cost-value {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
}

.trip-cost-banner .cost-banner-right {
    text-align: right;
}

.trip-cost-banner .budget-label {
    display: block;
    font-size: 0.8rem;
    opacity: 0.9;
}

.trip-cost-banner .budget-status {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 2px;
}

.trip-cost-banner .within-budget .budget-status {
    color: #4ade80;
}

.trip-cost-banner .over-budget .budget-status {
    color: #f87171;
}

.cost-disclaimer {
    display: block;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 4px;
    font-weight: 400;
}

/* --- Budget Summary Grid (from server total_trip_budget) --- */
.trip-cost-banner .budget-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px 20px;
    width: 100%;
    align-items: center;
}

.budget-summary-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.budget-summary-item .budget-summary-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.75;
}

.budget-summary-item .budget-summary-value {
    font-size: 1.1rem;
    font-weight: 700;
}

.budget-summary-item.flight .budget-summary-value,
.budget-summary-item.activities .budget-summary-value {
    opacity: 0.85;
}

.budget-summary-item.grand-total .budget-summary-value {
    font-size: 1.3rem;
    color: #fbbf24;
}

.budget-summary-item.savings .budget-summary-value {
    color: #4ade80;
}

.budget-summary-item.over .budget-summary-value {
    color: #f87171;
}

.budget-summary-divider {
    grid-column: 1 / -1;
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
    margin: 2px 0;
}

@media (max-width: 600px) {
    .trip-cost-banner .budget-summary-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.doc-section {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.doc-section summary {
    padding: 1rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--dark-blue, #0f172a);
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    transition: background 0.2s;
}

.doc-section summary:hover {
    background: #f1f5f9;
}

.doc-section summary::before {
    content: '▶';
    font-size: 0.7rem;
    color: var(--primary-sky, #00f2fe);
    transition: transform 0.2s;
}

.doc-section[open] summary::before {
    transform: rotate(90deg);
}

/* WebKit-specific disclosure marker */
.doc-section summary::-webkit-details-marker {
    display: none;
}

.doc-section-content {
    padding: 1rem;
}

.doc-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.doc-section li {
    padding: 8px 0;
    font-size: 0.9rem;
    color: #475569;
    border-bottom: 1px solid #f1f5f9;
}

.doc-section li:last-child {
    border-bottom: none;
}

.doc-section li::before {
    content: '\2022';
    color: #00f2fe;
    font-weight: 700;
    margin-right: 8px;
}

.refresh-docs-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary-sky, #00f2fe), var(--primary-green, #4fad55));
    color: white;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 1rem;
}

.refresh-docs-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 242, 254, 0.3);
}

/* --- Pulsanti in fondo al dettaglio viaggio (07-trips.js) --- */
.trip-detail-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.trip-action-btn {
    padding: 10px 24px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.9rem;
}

.trip-action-export-pdf {
    color: #00f2fe;
    border-color: #00f2fe;
}

.trip-action-delete {
    color: #ef4444;
    border-color: #ef4444;
}

.trip-action-save {
    background: linear-gradient(135deg, #00f2fe, #4fad55);
    color: white;
    border: none;
}

.trip-action-continue {
    background: linear-gradient(135deg, #00a8e8, #3ddc84);
    color: white;
    border: none;
}

/* --- Trips Footer --- */
.trips-footer {
    background: var(--dark-blue, #0f172a);
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
}

.trips-footer a {
    color: var(--primary-sky, #00f2fe);
    text-decoration: none;
}

.trips-footer a:hover {
    text-decoration: underline;
}

/* --- Save Warning Banner --- */
#save-warning-banner {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 242, 254, 0.95);
    color: white;
    padding: 20px 25px;
    border-radius: 12px;
    box-shadow: 0 0 25px rgba(0, 242, 254, 0.4);
    z-index: 2001;
    text-align: center;
    font-weight: 500;
    border-left: 4px solid #00b4d8;
    backdrop-filter: blur(8px);
    max-width: 90vw;
    width: 500px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Watermark hidden on screen, shown only when printing */
.print-watermark {
    display: none;
}

/* --- Print Styles --- */
@media print {
    .navbar,
    .trips-hero,
    .trip-modal-overlay,
    #save-warning-banner {
        display: none !important;
    }

    body {
        background: white;
    }

    .trips-dashboard {
        padding: 0;
        margin: 0;
    }

    .trip-card-image {
        aspect-ratio: 16/9;
    }

    .trips-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
    }

    .print-watermark {
        display: block;
        text-align: center;
        font-size: 0.7rem;
        color: #94a3b8;
        margin-top: 2rem;
    }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .trips-hero {
        height: 45vh;
        min-height: 300px;
    }

    .trips-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .trips-dashboard {
        padding: 2rem 1rem 4rem;
    }

    .section-header h2 {
        font-size: 1.8rem;
    }

    .trip-modal {
        max-height: 95vh;
        border-radius: 16px;
    }

    .itinerary-matrix {
        flex-direction: column;
    }

    .matrix-day-column {
        min-width: 100%;
        max-width: 100%;
    }
}
/* Cestino nella card e conferma dentro la card (29/09/2026). */
.trip-card-actions[hidden] { display: none; }
.trip-delete-btn {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    padding: 6px 10px;
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 8px;
    color: #ef4444;
    cursor: pointer;
    transition: all 0.15s;
}
.trip-delete-btn:hover { background: rgba(239, 68, 68, 0.08); border-color: #ef4444; }
.trip-delete-confirm {
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.06);
    cursor: default;
}
.trip-delete-question { margin: 0 0 8px; font-size: 0.85rem; font-weight: 600; color: #b91c1c; }
.trip-delete-error { margin: 0 0 8px; font-size: 0.8rem; color: #b91c1c; }
.trip-delete-buttons { display: flex; gap: 8px; }
.trip-delete-buttons button {
    flex: 1;
    min-height: 40px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}
.trip-delete-yes { background: #ef4444; border: 1px solid #ef4444; color: #fff; }
.trip-delete-no { background: transparent; border: 1px solid rgba(0, 0, 0, 0.15); color: inherit; }
.trip-delete-buttons button:disabled { opacity: .6; cursor: default; }
[data-theme="dark"] .trip-delete-question,
[data-theme="dark"] .trip-delete-error { color: #fca5a5; }
[data-theme="dark"] .trip-delete-no { border-color: rgba(255, 255, 255, 0.2); }
