/* ═══════ Trip Planner Modal ═══════ */

/* Overlay */
.trip-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}
.trip-modal-overlay.active {
    display: flex;
}

/* Modal container */
.trip-modal {
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(107, 114, 128, 0.3);
    border-radius: 12px;
    width: 90%;
    max-width: 720px;
    max-height: 85vh;
    overflow-y: auto;
    animation: fadeInUp 0.3s ease-out;
}

/* Header */
.trip-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(107, 114, 128, 0.2);
}
.trip-modal-header h2 {
    color: #fff;
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}
.trip-modal-header .subtitle {
    color: #9ca3af;
    font-size: 0.75rem;
    margin-top: 2px;
}
.trip-modal-close {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
.trip-modal-close:hover {
    background: rgba(107, 114, 128, 0.2);
    color: #e5e7eb;
}

/* Form */
.trip-modal-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(107, 114, 128, 0.2);
}
.trip-modal-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.75rem;
    color: #9ca3af;
    flex: 1;
    min-width: 120px;
}
.trip-modal-form input,
.trip-modal-form select {
    background: rgba(31, 41, 55, 0.6);
    border: 1px solid rgba(75, 85, 99, 0.5);
    border-radius: 6px;
    color: #e5e7eb;
    padding: 8px 10px;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.15s;
}
.trip-modal-form input:focus,
.trip-modal-form select:focus {
    border-color: var(--accent-500, #0c87f0);
}
.trip-search-btn {
    align-self: flex-end;
    background: var(--accent-600, #0969d6);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
    min-width: 90px;
}
.trip-search-btn:hover {
    background: var(--accent-500, #0c87f0);
}
.trip-search-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Tabs */
.trip-tabs {
    display: flex;
    gap: 0;
    padding: 0 20px;
    border-bottom: 1px solid rgba(107, 114, 128, 0.2);
}
.trip-tab {
    padding: 10px 16px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #9ca3af;
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}
.trip-tab:hover {
    color: #e5e7eb;
}
.trip-tab.active {
    color: var(--accent-400, #38a3ff);
    border-bottom-color: var(--accent-500, #0c87f0);
}

/* Results area */
.trip-results {
    padding: 16px 20px;
    min-height: 120px;
}
.trip-results-section {
    display: none;
}
.trip-results-section.active {
    display: block;
}

/* Result cards */
.trip-offer-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    margin-bottom: 8px;
    background: rgba(31, 41, 55, 0.5);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 8px;
    transition: border-color 0.15s;
}
.trip-offer-card:hover {
    border-color: rgba(107, 114, 128, 0.5);
}
.trip-offer-info {
    flex: 1;
    min-width: 0;
}
.trip-offer-title {
    color: #e5e7eb;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.trip-offer-detail {
    color: #9ca3af;
    font-size: 0.75rem;
    margin-top: 2px;
}
.trip-offer-price {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    margin-left: 16px;
    white-space: nowrap;
}
.trip-offer-price .currency {
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 400;
}
.trip-book-link {
    display: inline-block;
    margin-left: 12px;
    color: var(--accent-400, #38a3ff);
    font-size: 0.75rem;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s;
}
.trip-book-link:hover {
    color: var(--accent-300, #6fbbff);
}

/* Drive time note */
.trip-drive-note {
    padding: 8px 12px;
    margin-bottom: 12px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 6px;
    font-size: 0.75rem;
    color: #93c5fd;
}

/* Disclaimer */
.trip-disclaimer {
    padding: 12px 20px;
    border-top: 1px solid rgba(107, 114, 128, 0.2);
    font-size: 0.6875rem;
    color: #6b7280;
    text-align: center;
}

/* States: loading, empty, error */
.trip-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
    color: #9ca3af;
    font-size: 0.875rem;
}
.trip-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(107, 114, 128, 0.3);
    border-top-color: var(--accent-500, #0c87f0);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.trip-empty {
    text-align: center;
    padding: 24px;
    color: #6b7280;
    font-size: 0.8125rem;
}
.trip-error {
    text-align: center;
    padding: 16px;
    color: #f87171;
    font-size: 0.8125rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 6px;
    margin-bottom: 8px;
}

/* Scrollbar inside modal */
.trip-modal::-webkit-scrollbar { width: 6px; }
.trip-modal::-webkit-scrollbar-track { background: transparent; }
.trip-modal::-webkit-scrollbar-thumb {
    background: rgba(107, 114, 128, 0.4);
    border-radius: 3px;
}

/* Responsive */
@media (max-width: 640px) {
    .trip-modal {
        width: 95%;
        max-height: 90vh;
    }
    .trip-modal-form {
        flex-direction: column;
    }
    .trip-offer-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .trip-offer-price {
        margin-left: 0;
    }
}
