/* ==========================================================================
   DriftingDane Interactive Travel Map Styles
   File: static/css/travelMap.css
   ========================================================================== */

/* Page Header Spacing */
.dd-nav-spacer {
    height: 125px;
}

.color-orange-text {
    color: #f39c12 !important;
}

/* === MAIN MAP 2-COLUMN LAYOUT CONTAINER === */
.dd-map-layout-wrapper {
    display: flex;
    gap: 16px;
    position: relative;
    height: calc(100vh - 180px);
    min-height: 600px;
}

/* === STORIES-STYLE COLLAPSIBLE LEFT SIDEBAR === */
.dd-map-sidebar {
    width: 320px;
    flex-shrink: 0;
    display: flex !important;
    flex-direction: column;
    padding: 0 !important;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: margin-left 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
    position: relative;
    z-index: 10;
}

.dd-map-sidebar.collapsed {
    margin-left: -336px;
    opacity: 0;
    pointer-events: none;
}

/* Sidebar Header */
.dd-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 14px 18px;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
}

.dd-sidebar-header .widget-title {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    text-transform: capitalize;
}

.dd-sidebar-subtitle {
    font-size: 0.8rem;
    color: #878787;
    font-weight: normal;
}

.dd-sidebar-toggle-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    cursor: pointer;
    transition: all 0.18s ease;
}

.dd-sidebar-toggle-btn:hover {
    background: #ffffff;
    color: #0f172a;
    border-color: #cbd5e1;
    transform: scale(1.05);
}

/* Scrollable Category Track inside Sidebar */
.dd-sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    scrollbar-width: thin;
    scrollbar-color: rgba(243, 156, 18, 0.35) transparent;
}

.dd-sidebar-scroll::-webkit-scrollbar {
    width: 4px;
}

.dd-sidebar-scroll::-webkit-scrollbar-thumb {
    background: rgba(243, 156, 18, 0.4);
    border-radius: 4px;
}

/* Sidebar Continent / Regional Groups */
.sidebar-region-group {
    margin-bottom: 14px;
}

.sidebar-region-group:last-child {
    margin-bottom: 4px;
}

.sidebar-region-heading {
    display: flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #94a3b8;
    padding: 8px 0 4px 0;
    margin-bottom: 4px;
    border-bottom: 1px solid #f1f5f9;
}

.sidebar-region-group:first-child .sidebar-region-heading {
    padding-top: 2px;
}

.sidebar-region-group ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Story Sidebar Active Selection State */
.dd-map-sidebar .widget-text__content ul li a.active {
    color: #f39c12 !important;
    font-weight: 700;
}

.dd-map-sidebar .widget-text__content ul li a.active i {
    transform: scale(1.15);
    filter: brightness(1.2);
}

.dd-map-sidebar .widget-text__content ul li a .badge {
    color: inherit;
    font-size: 85%;
    font-weight: normal;
}

/* Sidebar Footer */
.dd-sidebar-footer {
    padding: 10px 14px;
    border-top: 1px solid #f1f5f9;
    background: #ffffff;
}

.dd-sidebar-gallery-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    background: #f8fafc;
    color: #475569 !important;
    border: 1px solid #e2e8f0;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
}

.dd-sidebar-gallery-btn i {
    color: #94a3b8;
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

.dd-sidebar-gallery-btn:hover {
    background: #f1f5f9;
    color: #0f172a !important;
    border-color: #cbd5e1;
    text-decoration: none;
}

.dd-sidebar-gallery-btn:hover i {
    color: #64748b;
}

/* === FULL-VIEWPORT MODERN MAP CONTAINER === */
.dd-map-stage {
    flex: 1;
    min-width: 0;
    position: relative;
    height: 100%;
    overflow: hidden;
    background: #dbe4eb;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

#worldTravelMap {
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Floating Expand Button (When sidebar is collapsed, placed beside Leaflet zoom controls) */
.dd-sidebar-expand-btn {
    position: absolute;
    top: 10px;
    left: 56px;
    z-index: 500;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.9);
    color: #334155;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
    cursor: pointer;
    transition: all 0.18s ease;
    display: inline-flex;
    align-items: center;
}

.dd-sidebar-expand-btn:hover {
    background: #ffffff;
    color: #0f172a;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}

/* Floating Top-Right Controls on Map Canvas */
.dd-map-top-actions {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dd-map-layer-group {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 50rem;
    padding: 3px;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
}

.dd-map-layer-btn {
    background: transparent;
    border: none;
    outline: none;
    color: #64748b;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 5px 12px;
    border-radius: 50rem;
    cursor: pointer;
    transition: all 0.18s ease;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    line-height: 1.2;
}

.dd-map-layer-btn i {
    color: #94a3b8;
    transition: color 0.18s ease;
}

.dd-map-layer-btn:hover:not(.active) {
    color: #0f172a;
    background: rgba(241, 245, 249, 0.9);
}

.dd-map-layer-btn:hover:not(.active) i {
    color: #475569;
}

.dd-map-layer-btn.active {
    background: #1e293b;
    color: #ffffff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.18);
}

.dd-map-layer-btn.active i {
    color: #ffffff;
}

.dd-map-action-btn {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.9);
    color: #334155;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 6px 13px;
    border-radius: 50rem;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
    cursor: pointer;
    transition: all 0.18s ease;
    display: inline-flex;
    align-items: center;
}

.dd-map-action-btn i {
    color: #64748b;
    transition: color 0.18s ease;
}

.dd-map-action-btn:hover {
    background: #ffffff;
    color: #0f172a;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}

.dd-map-action-btn:hover i {
    color: #0f172a;
}

.dd-map-action-btn.active {
    background: #1e293b;
    color: #ffffff;
    border-color: #1e293b;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.22);
}

.dd-map-action-btn.active i {
    color: #ffffff;
}

.dd-map-action-btn.active:hover {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

/* Journey Story Route Tooltip & Popups */
.dd-route-tooltip {
    background: rgba(30, 41, 59, 0.95) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 6px 10px !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25) !important;
    font-size: 0.78rem !important;
    line-height: 1.3 !important;
}

.dd-route-tooltip::before {
    border-top-color: rgba(30, 41, 59, 0.95) !important;
}

.dd-route-tip-sub {
    display: block;
    font-size: 0.7rem;
    color: #cbd5e1;
    margin-top: 2px;
}

.dd-route-popup {
    padding: 12px 14px;
    min-width: 200px;
    max-width: 260px;
}

.dd-route-popup-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #d35400;
    background: rgba(230, 126, 34, 0.12);
    padding: 2px 7px;
    border-radius: 4px;
    margin-bottom: 6px;
}

.dd-route-popup-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
    line-height: 1.25;
}

.dd-route-popup-sub {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 2px;
}

.dd-route-popup-title {
    font-size: 0.72rem;
    color: #94a3b8;
    font-style: italic;
    margin-bottom: 10px;
}

.dd-route-popup-link {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #d35400;
    font-size: 0.76rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
}

.dd-route-popup-link:hover {
    background: #f39c12;
    color: #ffffff;
    border-color: #f39c12;
    text-decoration: none;
}

/* Distinct Story Milestone Marker along Route */
.dd-milestone-badge-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.35));
    transition: transform 0.18s ease;
}

.dd-milestone-badge-marker:hover {
    transform: scale(1.2);
    z-index: 9999 !important;
}

.dd-milestone-badge-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f39c12 0%, #d35400 100%);
    border: 2px solid #ffffff;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    box-shadow: 0 2px 6px rgba(211, 84, 0, 0.4);
}

/* Mobile Off-Canvas Responsive Styles */
@media (max-width: 991.98px) {
    .dd-map-layout-wrapper {
        height: calc(100vh - 160px);
        min-height: 520px;
    }

    .dd-map-sidebar {
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1050;
        width: 305px;
        max-width: 86vw;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
        margin-left: 0;
    }

    .dd-map-sidebar.collapsed {
        margin-left: -310px;
        opacity: 0;
        pointer-events: none;
    }

    .dd-sidebar-backdrop {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.35);
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
        z-index: 1040;
        border-radius: 16px;
    }
}

/* === BRANDED MARKER CLUSTER STYLING === */
.dd-cluster-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 700;
    color: #ffffff;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease;
}
.dd-cluster-icon:hover {
    transform: scale(1.15);
    box-shadow: 0 0 0 8px rgba(243, 156, 18, 0.35), 0 8px 24px rgba(0, 0, 0, 0.3) !important;
    z-index: 1000 !important;
}

/* Small Cluster (< 10) */
.dd-cluster-small {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    border: 3px solid #ffffff;
    box-shadow: 0 4px 16px rgba(243, 156, 18, 0.45);
    font-size: 0.82rem;
}

/* Medium Cluster (10 - 30) */
.dd-cluster-medium {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    border: 3.5px solid #ffffff;
    box-shadow: 0 6px 20px rgba(230, 126, 34, 0.5);
    font-size: 0.88rem;
}

/* Large Cluster (> 30) */
.dd-cluster-large {
    width: 58px;
    height: 58px;
    background: linear-gradient(135deg, #d35400 0%, #c0392b 100%);
    border: 4px solid #ffffff;
    box-shadow: 0 8px 24px rgba(211, 84, 0, 0.55);
    font-size: 0.94rem;
}

/* === UNCLUSTERED LEAFLET PINS === */
.dd-pin-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.dd-pin-wrapper:hover,
.dd-pin-wrapper.active {
    transform: scale(1.22);
    z-index: 1000 !important;
}

.dd-photo-pin {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2.5px solid #ffffff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    background: #ffffff;
    position: relative;
}
.dd-photo-pin img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.dd-photo-pin-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    background: #f39c12;
    color: #ffffff;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    font-size: 8px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #ffffff;
}
.dd-pin-arrow {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #e67e22;
    margin-top: -1px;
}

/* === ELEVATED CARD POPUP === */
.leaflet-popup-content-wrapper {
    padding: 0 !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22) !important;
    border: 1px solid rgba(0, 0, 0, 0.06);
}
.leaflet-popup-content {
    margin: 0 !important;
    line-height: 1.4 !important;
    min-width: 250px !important;
    max-width: 280px !important;
}
.leaflet-popup-tip {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15) !important;
}

.dd-popup-hero {
    position: relative;
    width: 100%;
    height: 140px;
    background: #2c3e50;
    overflow: hidden;
}
.dd-popup-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}
.dd-popup-hero:hover img {
    transform: scale(1.05);
}

.dd-popup-hero-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(15, 23, 42, 0.68);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    color: #ffffff !important;
    font-size: 0.58rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 50rem;
    line-height: 1.2;
    z-index: 2;
}

.dd-popup-category-tag {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(15, 23, 42, 0.68);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    color: #ffffff !important;
    font-size: 0.58rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 50rem;
    text-transform: uppercase;
    letter-spacing: 0.35px;
    text-decoration: none !important;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
    z-index: 2;
}
.dd-popup-category-tag:hover,
.dd-popup-category-tag:focus,
.dd-popup-category-tag:active,
.dd-popup-category-tag:visited,
.leaflet-popup-content a.dd-popup-category-tag,
.leaflet-popup-content a.dd-popup-category-tag:hover,
.leaflet-popup-content a.dd-popup-category-tag:focus,
.leaflet-popup-content a.dd-popup-category-tag:active,
.leaflet-popup-content a.dd-popup-category-tag:visited {
    color: #ffffff !important;
    text-decoration: none !important;
}
.dd-popup-category-tag:hover {
    background: rgba(230, 126, 34, 0.88);
    border-color: rgba(255, 255, 255, 0.4);
}

.dd-popup-body {
    padding: 12px 14px 14px 14px;
    background: #ffffff;
}
.dd-popup-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #1a252f;
    margin-bottom: 4px;
    line-height: 1.25;
}
.dd-popup-desc {
    font-size: 0.72rem;
    color: #64748b;
    margin-bottom: 10px;
    line-height: 1.35;
}
.dd-popup-strip {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 6px 0;
    margin-bottom: 10px;
    border-top: 1px solid #f1f5f9;
    scrollbar-width: none;
}
.dd-popup-strip::-webkit-scrollbar {
    display: none;
}
.dd-popup-strip a img {
    width: 38px;
    height: 38px;
    border-radius: 6px;
    object-fit: cover;
    transition: opacity 0.15s ease;
}
.dd-popup-strip a:hover img {
    opacity: 0.8;
}

.dd-popup-open-btn {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: #ffffff !important;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 8px;
    border: none;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.18s ease;
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.35);
}
.dd-popup-open-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(243, 156, 18, 0.5);
}

@media (max-width: 576px) {
    .dd-map-top-actions {
        top: 10px;
        right: 10px;
        gap: 6px;
    }
    .dd-map-layer-btn {
        padding: 5px 8px;
        font-size: 0.72rem;
    }
    .dd-map-layer-btn span {
        display: none;
    }
    .dd-map-layer-btn i {
        margin-right: 0 !important;
    }
    .dd-map-action-btn {
        padding: 5px 9px;
        font-size: 0.72rem;
    }
    .dd-map-action-btn span {
        display: none;
    }
    .dd-map-action-btn i {
        margin-right: 0 !important;
    }
}


