/**
 * Ocean Map Route - Frontend Styles
 * Designed to work with Salient theme
 */

/* Container */
.ocean-map-route-container {
    position: relative;
    width: 100%;
    margin: 0 auto;
}

/* Wrapper */
.omr-wrapper {
    position: relative;
    min-height: 600px;
}

/* Accordion Column - Overlaid on desktop */
.omr-accordion-column {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 350px;
    max-width: calc(100% - 40px);
    max-height: calc(100% - 40px);
    overflow-y: auto;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 0;
}

/* Map Column - Full width */
.omr-map-column {
    width: 100%;
    position: relative;
}

/* No Accordion Layout */
.ocean-map-route-container.no-accordion .omr-accordion-column {
    display: none;
}

.ocean-map-route-container.no-accordion .omr-map-column {
    flex: 1 1 100%;
    max-width: 100%;
}

/* Accordion Styles */
.omr-accordion {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    overflow: hidden;
    background: transparent;
}

.omr-accordion-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

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

.omr-accordion-header {
    padding: 20px 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    position: relative;
    outline: none;
}

.omr-accordion-header:hover {
    background: rgba(0, 0, 0, 0.02);
}

.omr-accordion-header:focus {
    box-shadow: inset 0 0 0 2px var(--nectar-accent-color, #0066CC);
}

.omr-accordion-header.active {
    background: rgba(0, 0, 0, 0.03);
}

.omr-accordion-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c2c2c;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: inherit;
}

.route-color-indicator {
    width: 4px;
    height: 24px;
    border-radius: 2px;
    flex-shrink: 0;
}

.omr-accordion-toggle {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.omr-accordion-toggle.rotated {
    transform: rotate(180deg);
}

.omr-accordion-toggle svg {
    width: 12px;
    height: 8px;
    stroke: #666;
}

/* Accordion Content */
.omr-accordion-content {
    display: none;
    background: rgba(250, 250, 250, 0.95);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.omr-accordion-content.active {
    display: block;
}

.omr-accordion-inner {
    padding: 25px;
}

.omr-route-description {
    color: #666;
    line-height: 1.7;
    margin-bottom: 20px;
    font-size: 15px;
}

/* Locations List */
.omr-locations {
    margin-top: 20px;
}

.omr-locations-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    margin: 0 0 15px 0;
}

.omr-locations-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.omr-location-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
}

.omr-location-item:hover {
    background: rgba(0, 0, 0, 0.02);
    margin: 0 -10px;
    padding-left: 10px;
    padding-right: 10px;
}

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

.omr-location-marker {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.omr-location-content {
    flex: 1;
}

.omr-location-content strong {
    display: block;
    font-weight: 600;
    color: #2c2c2c;
    margin-bottom: 4px;
    font-size: 15px;
}

.omr-location-desc {
    color: #888;
    font-size: 14px;
    line-height: 1.5;
}

/* CTA Button - Salient Style */
.omr-cta-wrapper {
    margin-top: 25px;
}

.omr-cta-button {
    display: inline-block;
    padding: 12px 28px;
    background: var(--nectar-accent-color, #0066CC);
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 3px;
    font-weight: 500;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.omr-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    opacity: 0.9;
}

/* Map Container */
.omr-map-container {
    position: relative;
    width: 100%;
    height: 600px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.omr-map {
    width: 100%;
    height: 100%;
    background: #e5e3df;
}

/* Map Controls */
.omr-map-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.omr-control-btn {
    width: 40px;
    height: 40px;
    background: #fff;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.omr-control-btn:hover {
    background: #f8f8f8;
    border-color: rgba(0, 0, 0, 0.2);
}

.omr-control-btn svg {
    width: 20px;
    height: 20px;
    stroke: #333;
}

/* Map Loading */
.omr-map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 100;
    display: none;
}

.ocean-map-route-container:not(.loaded) .omr-map-loading {
    display: block;
}

.omr-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 15px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--nectar-accent-color, #0066CC);
    border-radius: 50%;
    animation: omr-spin 1s linear infinite;
}

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

.omr-map-loading span {
    color: #666;
    font-size: 14px;
}

/* Map Markers */
.omr-marker-icon {
    background: transparent !important;
    border: none !important;
}

.omr-marker {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
}

.omr-marker:hover {
    transform: scale(1.2);
}

.omr-marker-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
}

/* Leaflet Popup Overrides */
.leaflet-popup .omr-popup,
.leaflet-popup .omr-location-popup {
    padding: 15px;
    min-width: 200px;
}

.leaflet-popup .omr-popup h4,
.leaflet-popup .omr-location-popup h5 {
    margin: 0 0 10px 0;
    color: #2c2c2c;
    font-size: 16px;
    font-weight: 600;
}

.leaflet-popup .omr-popup p,
.leaflet-popup .omr-location-popup p {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.leaflet-popup-content-wrapper {
    border-radius: 4px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.leaflet-popup-tip {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

/* Route Line Styles */
.omr-route-line {
    stroke-linecap: round;
    stroke-linejoin: round;
}

.omr-route-line:hover {
    stroke-opacity: 1;
}

/* Responsive Design */
@media (max-width: 1199px) {
    .omr-accordion-column {
        width: 320px;
    }
}

@media (max-width: 991px) {
    /* Stack layout on mobile */
    .omr-wrapper {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .omr-accordion-column {
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        max-width: 100%;
        max-height: 400px;
        background: #fff;
        backdrop-filter: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        order: 2; /* Accordion comes after map on mobile */
    }

    /* Reset backgrounds for mobile stacked layout */
    .omr-accordion {
        background: #fff;
    }

    .omr-accordion-header {
        background: #fff;
    }

    .omr-accordion-content {
        background: #fafafa;
    }

    .omr-map-column {
        order: 1; /* Map comes first on mobile */
    }

    .omr-map-container {
        height: 500px;
    }
}

@media (max-width: 767px) {
    .omr-wrapper {
        gap: 20px;
    }

    .omr-accordion-header {
        padding: 15px 20px;
    }

    .omr-accordion-title {
        font-size: 16px;
    }

    .omr-accordion-inner {
        padding: 20px;
    }

    .omr-map-container {
        height: 400px;
    }

    .omr-map-controls {
        top: 10px;
        right: 10px;
    }

    .omr-control-btn {
        width: 36px;
        height: 36px;
    }
}

/* Dark Theme Support (Salient) */
body[data-color-scheme="dark"] .omr-accordion,
body.material[data-header-color="dark"] .omr-accordion {
    background: #1a1a1a;
    border-color: rgba(255, 255, 255, 0.1);
}

body[data-color-scheme="dark"] .omr-accordion-item,
body.material[data-header-color="dark"] .omr-accordion-item {
    border-color: rgba(255, 255, 255, 0.1);
}

body[data-color-scheme="dark"] .omr-accordion-header,
body.material[data-header-color="dark"] .omr-accordion-header {
    background: #1a1a1a;
}

body[data-color-scheme="dark"] .omr-accordion-header:hover,
body.material[data-header-color="dark"] .omr-accordion-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

body[data-color-scheme="dark"] .omr-accordion-title,
body.material[data-header-color="dark"] .omr-accordion-title {
    color: #fff;
}

body[data-color-scheme="dark"] .omr-accordion-content,
body.material[data-header-color="dark"] .omr-accordion-content {
    background: #0f0f0f;
    border-color: rgba(255, 255, 255, 0.05);
}

body[data-color-scheme="dark"] .omr-route-description,
body[data-color-scheme="dark"] .omr-location-desc,
body.material[data-header-color="dark"] .omr-route-description,
body.material[data-header-color="dark"] .omr-location-desc {
    color: #aaa;
}

/* Full Width Section Support */
.full-width-section .ocean-map-route-container {
    max-width: none;
    padding: 0;
}

/* Fullscreen Mode */
.omr-map-container:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
}

.omr-map-container:fullscreen {
    width: 100vw;
    height: 100vh;
}
/* Route Locations Section - Updated Styles */
.location-color-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    flex-shrink: 0;
}

.omr-route-locations {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.omr-route-locations .omr-locations-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    margin: 0 0 12px 0;
}

.omr-route-locations .omr-locations-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.omr-route-locations .omr-location-item {
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    display: flex;
    align-items: flex-start;
}

.omr-route-locations .omr-location-item:last-child {
    border-bottom: none;
}

.omr-location-description {
    font-size: 13px;
    color: #777;
    margin-top: 4px;
    margin-left: 16px;
}
