/**
 * PSP Route Map Styles - Complete Production Version
 * Using Palm Springs International Airport brand colors
 */

:root {
    --psp-green: #7B913B;
    --psp-blue: #58B0BB;
    --psp-yellow: #F6B243;
    --psp-orange: #E98056;
    --psp-gray: #484D56;
    --psp-light-gray: #f8f8f8;
    --psp-border: #e9e9e9;
}

/* Container */
.psp-route-map-container {
    display: flex;
    width: 100%;
    height: 700px;
    background-color: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Fix for theme overrides */
.psp-route-map-container * {
    box-sizing: border-box;
}

.psp-route-map-container img {
    max-width: none !important; /* Override theme's max-width: 100% */
    height: auto;
}

.psp-route-map-container ul {
    margin: 0;
    padding: 0;
}

.psp-route-map-container li {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Override any theme styles that might add underlines */
.psp-route-map-container a {
    text-decoration: none !important;
}

.psp-route-map-container a:hover,
.psp-route-map-container a:focus,
.psp-route-map-container a:active,
.psp-route-map-container a:visited {
    text-decoration: none !important;
}

/* Sidebar - Slimmed down */
.psp-route-map-sidebar {
    width: 320px;
    min-width: 320px;
    background-color: #fff;
    border-right: 1px solid var(--psp-border);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.psp-route-map-sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Header */
.psp-route-map-header {
    padding: 20px;
    border-bottom: 1px solid var(--psp-border);
    background: linear-gradient(135deg, var(--psp-light-gray) 0%, #fff 100%);
}

.psp-route-map-header h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--psp-gray);
}

/* Search */
.psp-route-map-search {
    margin-bottom: 15px;
}

.psp-route-map-search-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--psp-border);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.psp-route-map-search-input:focus {
    outline: none;
    border-color: var(--psp-green);
    box-shadow: 0 0 0 3px rgba(123, 145, 59, 0.1);
}

/* Filters */
.psp-route-map-airline-filter,
.psp-route-map-seasonal-filter {
    margin-bottom: 15px;
}

.psp-route-map-airline-filter label,
.psp-route-map-seasonal-filter label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--psp-gray);
}

.psp-route-map-airline-select,
.psp-route-map-seasonal-select {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid var(--psp-border);
    border-radius: 8px;
    font-size: 14px;
    background-color: #fff;
    transition: all 0.3s ease;
}

.psp-route-map-airline-select:focus,
.psp-route-map-seasonal-select:focus {
    outline: none;
    border-color: var(--psp-green);
}

/* Destinations List - Clean and Compact */
.psp-route-map-destinations-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.psp-route-map-destinations {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Destination Cards - Clean Minimal Design */
.psp-route-map-destination {
    margin-bottom: 8px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.psp-route-map-destination:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateX(2px);
    border-color: #d0d0d0;
}

.psp-route-map-destination.active {
    border-color: var(--psp-gray);
    background: #fafafa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Destination Link - Clean Layout */
.psp-route-map-destination-link {
    display: block;
    padding: 12px 14px;
    text-decoration: none;
    color: var(--psp-gray);
}

/* City and State - Clean Typography */
.psp-route-map-destination-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.psp-route-map-destination-city {
    font-weight: 500;
    font-size: 14px;
    color: var(--psp-gray);
    flex: 1;
}

.psp-route-map-destination-state {
    font-size: 12px;
    color: #999;
    font-weight: 400;
}

/* Schedule Badges - Clean and Small */
.psp-route-map-schedule-info {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.psp-route-map-schedule-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
    line-height: 1;
}

.psp-route-map-schedule-badge.year-round {
    background: rgba(123, 145, 59, 0.15);
    color: var(--psp-green);
}

.psp-route-map-schedule-badge.seasonal {
    background: rgba(233, 128, 86, 0.15);
    color: var(--psp-orange);
}

/* Legend */
.psp-route-map-legend {
    padding: 20px;
    border-top: 1px solid var(--psp-border);
    background: var(--psp-light-gray);
}

.psp-route-map-legend h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--psp-gray);
}

.psp-route-map-legend ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.psp-route-map-legend li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #666;
}

.psp-route-map-legend-line {
    display: inline-block;
    width: 30px;
    height: 3px;
    margin-right: 12px;
    border-radius: 2px;
}

.psp-route-map-legend-yearround {
    background: var(--psp-green);
}

.psp-route-map-legend-seasonal {
    background: repeating-linear-gradient(
        90deg,
        var(--psp-orange),
        var(--psp-orange) 5px,
        transparent 5px,
        transparent 10px
    );
}

/* Main Map Area */
.psp-route-map-main {
    flex: 1;
    position: relative;
    background: #f5f7fa;
}

.psp-route-map {
    width: 100%;
    height: 100%;
}

/* Loading Overlay */
.psp-route-map-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.psp-route-map-loading-content {
    text-align: center;
    padding: 30px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.psp-route-map-spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 4px solid var(--psp-border);
    border-radius: 50%;
    border-top-color: var(--psp-orange);
    animation: psp-spin 1s ease-in-out infinite;
}

@keyframes psp-spin {
    to { transform: rotate(360deg); }
}

.psp-route-map-loading {
    padding: 20px;
    text-align: center;
    color: #888;
}

/* Map Markers - Consistent Colors */
.psp-route-map-marker {
    background: none !important;
    border: none !important;
}

.psp-route-map-marker-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

.psp-route-map-marker-inner:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Origin marker - PSP */
.psp-route-map-origin-marker .psp-route-map-marker-inner {
    width: 48px;
    height: 48px;
    font-size: 16px;
    background: var(--psp-blue); /* Blue (#58B0BB) for PSP origin airport */
}

/* Destination markers - Year-round destinations */
.psp-route-map-destination-marker .psp-route-map-marker-inner {
    width: 32px;
    height: 32px;
    font-size: 11px;
    background: var(--psp-green); /* GREEN for year-round */
}

/* Seasonal-only destination markers */
.psp-route-map-destination-marker.seasonal .psp-route-map-marker-inner {
    background: var(--psp-orange); /* ORANGE for seasonal-only */
}

/* Popup Styles */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 0;
    width: 280px !important;
}

.psp-route-map-popup {
    padding: 20px;
}

.psp-route-map-popup h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--psp-gray);
}

.psp-route-map-popup h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 500;
    color: #666;
}

.psp-route-map-popup-airlines {
    margin: 15px 0;
}

.psp-route-map-popup-airlines h5 {
    margin: 0 0 10px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--psp-gray);
}

.psp-route-map-popup-airlines ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.psp-route-map-popup-airlines li {
    margin-bottom: 6px;
    font-size: 13px;
    color: #666;
}

.psp-route-map-popup-schedule {
    margin: 12px 0;
    padding: 10px;
    background: var(--psp-light-gray);
    border-radius: 8px;
}

.psp-route-map-popup-schedule p {
    margin: 0 0 4px 0;
    font-size: 12px;
    color: #666;
}

.psp-route-map-popup-book {
    margin-top: 15px;
}

.psp-route-map-book-button {
    display: inline-block;
    padding: 10px 20px;
    background: var(--psp-orange);
    color: #fff !important;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.psp-route-map-book-button:hover {
    background: #d66d45;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(233, 128, 86, 0.3);
}

/* No results message */
.psp-route-map-no-results {
    padding: 30px;
    text-align: center;
    color: #888;
    font-style: italic;
}

/* Error message */
.psp-route-map-error {
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    margin-top: 20px;
    color: #856404;
}

/* Mobile Responsive */
@media screen and (max-width: 768px) {
    .psp-route-map-container {
        flex-direction: column;
        height: var(--mobile-height, 800px) !important;
    }
    
    .psp-route-map-sidebar {
        width: 100%;
        min-width: 100%;
        max-height: 50vh;
        border-right: none;
        border-bottom: 1px solid var(--psp-border);
    }
    
    .psp-route-map-header {
        padding: 15px;
    }
    
    .psp-route-map-header h3 {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .psp-route-map-destinations-list {
        padding: 15px;
    }
    
    .psp-route-map-legend {
        padding: 15px;
    }
    
    .psp-route-map-destination-city {
        font-size: 15px;
    }
    
    .psp-route-map-origin-marker .psp-route-map-marker-inner {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .psp-route-map-destination-marker .psp-route-map-marker-inner {
        width: 28px;
        height: 28px;
        font-size: 10px;
    }
}

/* Scrollbar Styling */
.psp-route-map-destinations-list::-webkit-scrollbar {
    width: 8px;
}

.psp-route-map-destinations-list::-webkit-scrollbar-track {
    background: var(--psp-light-gray);
    border-radius: 4px;
}

.psp-route-map-destinations-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.psp-route-map-destinations-list::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* Accessibility */
.psp-route-map-search-input:focus,
.psp-route-map-airline-select:focus,
.psp-route-map-seasonal-select:focus,
.psp-route-map-book-button:focus,
.psp-route-map:focus {
    outline: 2px solid var(--psp-orange);
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .psp-route-map-marker-inner,
    .psp-route-map-legend-line,
    .psp-route-map-book-button {
        forced-color-adjust: none;
    }
}