/* ===================================================
   Ferrata Page - Pure Vanilla CSS (no Bootstrap)
   =================================================== */

/* Reset and base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: "Nunito", "Segoe UI", system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #214a37;
}

/* Layout */
.ferrata-layout {
    position: relative;
    width: 100%;
    height: 100vh;
}

.ferrata-map {
    width: 100%;
    height: 100vh;
}

/* ===================================================
   OpenLayers Zoom Controls - Apple Glass Style
   =================================================== */
.ol-zoom {
    top: auto;
    left: auto;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    box-shadow:
        0 8px 32px rgba(31, 38, 35, 0.12),
        0 2px 8px rgba(31, 38, 35, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    overflow: hidden;
    padding: 0;
}

.ol-zoom .ol-zoom-in,
.ol-zoom .ol-zoom-out {
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    font-size: 1.25rem;
    font-weight: 300;
    line-height: 36px;
    color: #1d3d2a;
    background: transparent;
    border: none !important;
    border-radius: 0;
    cursor: pointer;
    transition: background 0.15s;
    outline: none !important;
    box-shadow: none !important;
}

.ol-zoom .ol-zoom-in:hover,
.ol-zoom .ol-zoom-out:hover {
    background: rgba(0, 0, 0, 0.06);
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.ol-zoom .ol-zoom-in:focus,
.ol-zoom .ol-zoom-out:focus,
.ol-zoom .ol-zoom-in:focus-visible,
.ol-zoom .ol-zoom-out:focus-visible {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

.ol-zoom .ol-zoom-in:active,
.ol-zoom .ol-zoom-out:active {
    background: rgba(0, 0, 0, 0.1);
}

.ol-zoom .ol-zoom-in {
    border-bottom: 1px solid rgba(60, 100, 80, 0.12) !important;
}

/* Hide default attribution for cleaner look */
.ol-attribution {
    display: none;
}

/* Filter panel overlay - Apple Glass Style */
.ferrata-filters {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 10;
    width: min(330px, calc(100vw - 3rem));
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    padding: 1.5rem 1.4rem 1.6rem;
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 1.25rem;
    box-shadow:
        0 8px 32px rgba(31, 38, 35, 0.12),
        0 2px 8px rgba(31, 38, 35, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.ferrata-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.4rem;
}

.ferrata-filters h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #1d3d2a;
}

.ferrata-filters-header .result-count {
    font-size: 0.8rem;
    font-weight: 500;
    color: #3d6b4f;
    padding: 0.2rem 0.6rem;
    background: rgba(52, 168, 83, 0.1);
    border-radius: 6px;
}

.ferrata-filters-header .result-count span {
    font-weight: 700;
    color: #1d4a2a;
}

/* Collapse toggle - hidden on desktop, shown on mobile */
.ferrata-filters-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-left: 0.5rem;
    padding: 0;
    color: #1d3d2a;
    background: rgba(0, 0, 0, 0.06);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.ferrata-filters-toggle:hover {
    background: rgba(0, 0, 0, 0.1);
}

.ferrata-filters-toggle-icon {
    display: block;
    width: 9px;
    height: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(2px) rotate(-135deg);
    transition: transform 0.2s ease;
}

.ferrata-filters.is-collapsed .ferrata-filters-toggle-icon {
    transform: translateY(-2px) rotate(45deg);
}

/* Filter groups */
.filter-group {
    margin-bottom: 1.4rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid rgba(60, 100, 80, 0.12);
}

.filter-group:last-of-type {
    border-bottom: 0;
    padding-bottom: 0;
}

.filter-group > label {
    display: block;
    margin-bottom: 0.65rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #2d5a3f;
}

/* Range values display */
.range-values {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #3d6b4f;
}

.range-values output {
    display: inline-block;
    min-width: 1.5rem;
    padding: 0.1rem 0.55rem;
    border-radius: 6px;
    background: rgba(60, 140, 90, 0.12);
    color: #1d4a2a;
    font-weight: 700;
    text-align: center;
}

/* ===================================================
   noUiSlider overrides - Apple Glass Style
   =================================================== */
.dual-range-slider {
    margin: 0.95rem 0.4rem 0.3rem;
}

/* Track */
.ferrata-filters .noUi-target,
.ferrata-filters .noUi-horizontal {
    height: 4px !important;
    background: rgba(60, 100, 80, 0.15);
    border: 0;
    border-radius: 999px;
    box-shadow: none;
}

.ferrata-filters .noUi-base,
.ferrata-filters .noUi-connects,
.ferrata-filters .noUi-origin {
    height: 100%;
    border-radius: 999px;
}

.ferrata-filters .noUi-connects {
    overflow: hidden;
}

.ferrata-filters .noUi-connect {
    background: linear-gradient(90deg, #5ac46d, #34a853);
}

/* Handle styling - Apple style */
.ferrata-filters .noUi-handle {
    top: 50% !important;
    width: 20px !important;
    height: 20px !important;
    right: -10px !important;
    border: none;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.15),
        0 3px 8px rgba(0, 0, 0, 0.1),
        inset 0 0 0 0.5px rgba(0, 0, 0, 0.05);
    cursor: grab;
    transform: translateY(-50%);
    transition: box-shadow 0.15s ease;
}

.ferrata-filters .noUi-handle:hover {
    box-shadow: 
        0 2px 6px rgba(0, 0, 0, 0.18),
        0 4px 12px rgba(0, 0, 0, 0.12),
        inset 0 0 0 0.5px rgba(0, 0, 0, 0.05);
}

.ferrata-filters .noUi-handle:active {
    cursor: grabbing;
    box-shadow: 
        0 1px 2px rgba(0, 0, 0, 0.12),
        0 2px 6px rgba(0, 0, 0, 0.08),
        inset 0 0 0 0.5px rgba(0, 0, 0, 0.05);
}

/* Remove default noUiSlider handle bars */
.ferrata-filters .noUi-handle::before,
.ferrata-filters .noUi-handle::after {
    display: none !important;
}

/* ===================================================
   Form elements - Apple Glass Style
   =================================================== */
.ferrata-filters select {
    width: 100%;
    padding: 0.5rem 0.85rem;
    color: #1d3d2a;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(60, 100, 80, 0.15);
    border-radius: 10px;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%232d5a3f' d='M5 7L1 3h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.25rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.ferrata-filters select:focus {
    border-color: rgba(52, 168, 83, 0.5);
    box-shadow: 0 0 0 3px rgba(52, 168, 83, 0.15);
}

/* Reset button - Apple style */
#resetFilters {
    width: 100%;
    padding: 0.55rem;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0;
    background: linear-gradient(180deg, #4aba5e, #34a853);
    border: 0;
    border-radius: 10px;
    box-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.12),
        0 4px 12px rgba(52, 168, 83, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.15s ease;
}

#resetFilters:hover {
    background: linear-gradient(180deg, #5ac46d, #3fb85e);
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.12),
        0 6px 16px rgba(52, 168, 83, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

#resetFilters:active {
    background: linear-gradient(180deg, #3fa84d, #2d9648);
    box-shadow: 
        0 1px 2px rgba(0, 0, 0, 0.1),
        0 2px 6px rgba(52, 168, 83, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Map style switcher */
.map-style-switcher {
    margin-top: 1.2rem;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(60, 100, 80, 0.12);
}

.map-style-switcher > label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #2d5a3f;
}

.map-style-buttons {
    display: flex;
    gap: 0;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    padding: 2px;
}

.map-style-btn {
    flex: 1;
    padding: 0.4rem 0.5rem;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    color: #3d6b4f;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.map-style-btn:hover {
    color: #1d3d2a;
}

.map-style-btn.active {
    background: #ffffff;
    color: #1d3d2a;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ferrata-legal {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(60, 100, 80, 0.08);
}

.ferrata-legal-link {
    padding: 0;
    color: rgba(29, 61, 42, 0.72);
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 0.12rem;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.15s ease, opacity 0.15s ease;
    opacity: 0.82;
}

.ferrata-legal-link:hover {
    color: #1d3d2a;
    opacity: 1;
}

.ferrata-legal-link:focus-visible {
    outline: 2px solid rgba(52, 168, 83, 0.35);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Scrollbar - Apple style */
.ferrata-filters::-webkit-scrollbar {
    width: 6px;
}

.ferrata-filters::-webkit-scrollbar-track {
    background: transparent;
}

.ferrata-filters::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 999px;
}

.ferrata-filters::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* ===================================================
   Map popup - Apple Glass Style
   =================================================== */
.ferrata-popup {
    position: absolute;
    min-width: 220px;
    max-width: 280px;
    padding: 1rem 1.1rem 1.1rem;
    color: #1d3d2a;
    font-family: "Nunito", "Segoe UI", system-ui, sans-serif;
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 1.25rem;
    box-shadow: 0 8px 32px rgba(31, 38, 35, 0.12), 0 2px 8px rgba(31, 38, 35, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}



.ferrata-popup-close {
    position: absolute;
    top: 0.5rem;
    right: 0.6rem;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1.4rem;
    color: rgba(0, 0, 0, 0.35);
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}

.ferrata-popup-close:hover {
    color: rgba(0, 0, 0, 0.6);
    background: rgba(0, 0, 0, 0.06);
}

.ferrata-popup-title {
    margin-bottom: 0.75rem;
    padding-right: 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    color: #1d3d2a;
    line-height: 1.3;
}

.ferrata-popup-details {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 0.85rem;
}

.ferrata-popup-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.ferrata-popup-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: #3d6b4f;
}

.ferrata-popup-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1d3d2a;
}

.ferrata-popup-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
}

/* Difficulty color scale (easy to hard) - softer colors */
.ferrata-difficulty-1 {
    background: rgba(52, 168, 83, 0.15);
    color: #1e7e34;
}
.ferrata-difficulty-2 {
    background: rgba(102, 187, 106, 0.18);
    color: #388e3c;
}
.ferrata-difficulty-3 {
    background: rgba(255, 193, 7, 0.18);
    color: #c79100;
}
.ferrata-difficulty-4 {
    background: rgba(255, 152, 0, 0.18);
    color: #e65100;
}
.ferrata-difficulty-5 {
    background: rgba(244, 67, 54, 0.15);
    color: #c62828;
}
.ferrata-difficulty-6 {
    background: rgba(198, 40, 40, 0.15);
    color: #b71c1c;
}

/* Beginner suitability badges */
.ferrata-beginner-yes {
    background: rgba(52, 168, 83, 0.15);
    color: #1e7e34;
}
.ferrata-beginner-no {
    background: rgba(244, 67, 54, 0.15);
    color: #c62828;
}
.ferrata-beginner-unknown {
    background: rgba(0, 0, 0, 0.06);
    color: #5f6368;
}

.ferrata-popup-link {
    display: inline-block;
    margin-top: 0.25rem;
    padding: 0.4rem 0.85rem;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    background: linear-gradient(180deg, #4aba5e, #34a853);
    border-radius: 8px;
    box-shadow: 
        0 1px 2px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.15s ease;
}

.ferrata-popup-link:hover {
    background: linear-gradient(180deg, #5ac46d, #3fb85e);
    box-shadow: 
        0 2px 6px rgba(52, 168, 83, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.ferrata-modal {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.ferrata-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 35, 28, 0.22);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.ferrata-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(360px, calc(100vw - 2rem));
    max-width: 100%;
    padding: 1.15rem 1.2rem 1.1rem;
}

.ferrata-imprint-details {
    gap: 0.2rem;
    margin-bottom: 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Utility classes */
.d-none {
    display: none !important;
}

/* ===================================================
   Responsive
   =================================================== */
@media (max-width: 768px) {
    .ferrata-filters {
        top: 0.85rem;
        left: 0.85rem;
        width: calc(100vw - 1.7rem);
        max-height: calc(60vh - 1rem);
        border-radius: 1rem;
    }

    .ferrata-filters-toggle {
        display: flex;
    }

    .ferrata-filters.is-collapsed {
        max-height: none;
        overflow: visible;
        padding-top: 0.9rem;
        padding-bottom: 0.9rem;
    }

    .ferrata-filters.is-collapsed .ferrata-filters-header {
        margin-bottom: 0;
    }

    .ferrata-filters.is-collapsed .ferrata-filters-body {
        display: none;
    }

    .ferrata-popup {
        min-width: 200px;
        max-width: calc(100vw - 2rem);
    }

    .ol-zoom {
        bottom: 1rem;
        right: 1rem;
    }
}
