/* =================================
   RUTER 2.0 WIDGET - MAP STYLES
   Mobile-first responsive design
   ================================= */

/* =================================
   CSS CUSTOM PROPERTIES (VARIABLES)
   ================================= */
:root {
    /* Colors */
    --primary-blue: #007bff;
    --primary-blue-dark: #0056b3;
    --secondary-gray: #6c757d;
    --secondary-gray-dark: #545b62;
    --success-green: #28a745;
    --success-green-dark: #1e7e34;
    --warning-yellow: #ffc107;
    --warning-orange: #ff6b35;
    --light-gray: #f3f3f3;
    --medium-gray: #e9ecef;
    --dark-gray: #495057;
    --white: #ffffff;
    --black: #333333;
    --good-bike-host-yellow: #FEE451;
    --light-green-border: #E9F2EE;
    --ruterdk-green: #229966;
    --ruterdk-dark-green: #15764C;
    
    /* Bike Host Colors */
    --bike-host-bg: #FCEC2A;
    --bike-host-bg-hover: #FFF474;
    --bike-host-text: #4D588C;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.4s ease;
    
    /* Z-indexes */
    --z-map-controls: 1000;
    --z-overlay: 1100;
    --z-popup: 1200;
    --z-click-message: 1300;
    --z-interaction-btn: 1400;
    --z-sidebar: 2000;
    --z-mobile-popup: 2000;
    --z-fullscreen: 9999;
    
    /* Font sizes */
    --font-family: 'Miki', Arial, sans-serif;
    --font-xs: 11px;
    --font-sm: 12px;
    --font-sm-b: 13px;
    --font-base: 14px;
    --font-lg: 16px;
    --font-xl: 18px;
    --font-2xl: 20px;
    --font-3xl: 24px;
    
    /* Spacing */
    --space-0: 2px;
    --space-1: 4px;
    --space-1-2: 6px;
    --space-2: 8px;
    --space-2-3: 9px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    
    /* Breakpoints for reference */
    --bp-sm: 480px;
    --bp-md: 768px;
    --bp-lg: 880px;
    --bp-xl: 1200px;
}

/* =================================
   BASE STYLES (MOBILE FIRST)
   ================================= */

/* Reset and base layout */
html, 
body {
    height: 100vh;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

/* Prevent overscroll bounce on iOS */
body {
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
}

/* Prevent iOS bounce scroll in fullscreen */
.ios-fullscreen-mode body {
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
}

/* Map wrapper - mobile first */
.map-wrapper {
    position: fixed;
    top: 74px;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: calc(100vh - 74px);
    z-index: 1;
}

/* Allow text selection for form elements */
input, textarea, select {
    -webkit-user-select: text;
}

/* Map container */
#map,
#map-container {
    width: 100%;
    position: relative;
    height: 100%;

}

/* =================================
   LEAFLET CONTROL OVERRIDES
   ================================= */

/* Improve touch interactions on iOS */
.leaflet-container {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* iOS-specific map improvements */
.leaflet-control-container {
    /* Ensure controls are accessible on iOS */
    pointer-events: auto;
}

.leaflet-popup-content-wrapper {
    /* Improve popup touch handling on iOS */
    -webkit-user-select: text;
    user-select: text;
}

.leaflet-sidebar-left.collapsed ~ .leaflet-control-container .leaflet-left {
    left: 0px !important;
}

.leaflet-top.leaflet-left {
    top: 50px;
}

.leaflet-control-container .leaflet-control {
    border: none !important;
}

.leaflet-control-container .leaflet-control a {
    width: 34px !important;
    height: 34px !important;
    box-sizing: content-box !important;
}

/* Zoom controls */
.leaflet-control-zoom-in {
    border-radius: 20px 20px 0 0 !important;
    border: 2px solid #E9F2EE !important;
    background-image: url("/static/widget_app/images/zoomin.d613d87422fb.svg") !important;
    background-size: 18px 18px !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    touch-action: manipulation;
}

.leaflet-control-zoom-out {
    border-radius: 0 0 20px 20px !important;
    border: 2px solid #E9F2EE !important;
    background-image: url("/static/widget_app/images/zoomout.02ab1b3f4f68.svg") !important;
    background-size: 18px 18px !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    touch-action: manipulation;
}

.leaflet-control-zoom-in span, 
.leaflet-control-zoom-out span {
    display: none;
}

.leaflet-control-zoom-in:hover,
.leaflet-control-zoom-out:hover {
    border-color: rgba(0, 0, 0, 0.4) !important;
}

/* =================================
   BUTTONS AND INTERACTIVE ELEMENTS
   ================================= */

/* Base button styles */
.btn {
    padding: var(--space-2) var(--space-3);
    border: none;
    border-radius: 6px;
    font-size: var(--font-base);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

/* Button variants */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: var(--white);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-gray) 0%, var(--secondary-gray-dark) 100%);
    color: var(--white);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-green) 0%, var(--success-green-dark) 100%);
    color: var(--white);
}

.btn-green {
    background: var(--ruterdk-green);
    color: var(--white) !important;
}

.btn-green:hover {
    background-color: var(--ruterdk-dark-green);
}

.btn-green-outline {
    background: var(--white);
    border: 1px solid var(--ruterdk-green);
    color: var(--ruterdk-green) !important;
}

/* Close button */
.close-btn {
    background: var(--light-gray);
    border: 1px solid var(--medium-gray);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: var(--font-lg);
    font-weight: bold;
    color: var(--secondary-gray);
    transition: all var(--transition-fast);
}

.close-btn:hover {
    background: var(--medium-gray);
    color: var(--dark-gray);
    transform: scale(1.05);
}

.btn-full-width {
    width: 100%;
    text-align:center;
}

.btn-full-width span {
    text-align:center;
    margin: 0 auto;
}
    
/* =================================
   MAP LOCK BUTTON SYSTEM
   ================================= */

.lock-btn {
    border-radius: 20px;
    border: 2px solid #E9F2EE !important;
    background: #fff;
    padding: 4px;
    margin: 0 0 0 11px;
    cursor: pointer;
}

.lock-btn.lock-icon {
    height: 40px;
    width: 40px;
}

#lock-icon {
    margin: 0 0 0 0;
}

.lock-btn.lock-text {
    background-color: #fff;
    padding: 4px;
    height: 36px;
}

.lock-text span {
    background-color: #229966;
    border-radius: 20px;
    color: #fff;
    padding: 2px 6px;
    font-family: var(--font-family);
    font-size: var(--font-lg);
    font-weight: 400;
}

.map-lock-button {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1500;
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    min-width: 180px;
    user-select: none;
}

.lock-btn:hover {
    background-color: var(--light-gray);
    border-color: rgba(0, 0, 0, 0.4) !important;
}

.map-lock-button .lock-icon {
    font-size: var(--font-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.map-lock-button .lock-text {
    font-size: var(--font-sm);
    line-height: 1.2;
    transition: all 0.3s ease;
}

/* Unlocked state */
.map-lock-button.unlocked {
    min-width: auto;
    border-radius: 50%;
    padding: 0;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.map-lock-button.unlocked .lock-text {
    display: none;
}

.map-lock-button.unlocked .lock-icon {
    font-size: var(--font-xl);
}

/* Map interaction overlay */
#map-interaction-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100vh - 74px);
    background-color: rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1100;
    pointer-events: none;
}

#map-interaction-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

#map-interaction-overlay.blocked {
    opacity: 0.8;
    visibility: visible;
    pointer-events: all;
    background-color: rgba(0, 0, 0, 0.7);
}

/* =================================
   BOTTOM BAR
   ================================= */

.ios-fullscreen-mode .bottom-bar {
    visibility:hidden;
}

.bottom-bar {
    visibility: visible;
    width: 100%;
    height: 74px;
    background: var(--light-gray);
    top: 0;
    position: fixed;
    z-index: calc(var(--z-map-controls) + 1);
}

.bottom-bar-inside {
    width: calc(100% - 26px);
    font-family: var(--font-family);
    padding: 6px var(--space-4);
    display: flex;
    flex-direction: row;
    align-items: center;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    gap: 8px;
}

.bottom-bar h2,
.route-info h2 {
    margin: 0;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
    font-size: var(--font-lg);
    line-height: 1.2;
}

.route-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
}

.bottom-bar-buttons {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    align-items: center;
}

.bottom-bar-button {
    background: var(--white);
    border: 2px solid #E9F2EE !important;
    border-radius: 8px;
    min-height: 32px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: var(--font-base);
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 32px;
    box-sizing: border-box;
    line-height: 20px;
}

.bottom-bar-button:hover {
    background: #e9ecef;
    border-color: rgba(0, 0, 0, 0.4) !important;
}

.bottom-bar-button img {
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0;
    margin: 0 !important;
    padding: 0 !important;
}

.bottom-bar-button span {
    display: inline;
    margin: 0;
    padding: 0;
}

.bottom-bar-attributes {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
}

.overview-content {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
}

.overview-content h2 {
    flex: 1;
    min-width: 0;
}

/* Push class for spacing */
.push {
    margin-left: auto;
}

/* Very small screens (320px and below) */
@media (max-width: 320px) {
    .bottom-bar-button {
        padding: 3px 4px;
        min-width: 24px;
        gap: 2px;
    }
    
    .bottom-bar-button img {
        width: 10px;
        height: 10px;
    }
    
    .bottom-bar h2,
    .route-info h2 {
        font-size: var(--font-lg);
    }
    
    .bottom-bar-inside {
        padding: 4px 8px;
        gap: 6px;
    }
}

@media (max-width: 768px) {
    .image-slideshow {
    }
    
    .slideshow-container {
    }
    
    .slide img {
        height: 240px;
    }
    
    .slideshow-nav {
        padding: var(--space-2);
    }
    
    .slide-info {
        padding: var(--space-2) var(--space-3) var(--space-3);
    }
    
    .slide-title {
        font-size: var(--font-base);
    }
    
    .nav-arrow {
        width: 22px;
        height: 22px;
        font-size: var(--font-sm);
    }
    
    .pagination-dot {
        width: 10px;
        height: 10px;
    }
    
    .pagination-dot.active {
        width: 24px;
    }
}

/* =================================
   SIDEBAR STYLES
   ================================= */

.leaflet-sidebar-left.leaflet-touch {
    border: 2px solid #E9F2EE !important;
}

.leaflet-sidebar-tabs #tablist {
    display: none !important;
}

.leaflet-sidebar-content {
    top: 0 !important;
    left: 0 !important;
    padding: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}


.leaflet-sidebar {
    width: 100%;
    max-width: 350px;
    background: var(--white);
    border-radius: 0;
    font-family: var(--font-family);
    overflow: hidden;
    z-index: var(--z-sidebar);
    border-radius: 8px;
}

.leaflet-sidebar-header {
    width: 100%;
    height: 44px;
    padding-top: var(--space-1);
    padding-bottom: var(--space-2);
    background: var(--light-gray);
    position: relative;
}

h1.leaflet-sidebar-header {
    font-size: var(--font-base);
    font-weight: 400;
    color: var(--black);
    margin: 0 0 0 0;
    line-height: 1.2;
}

.leaflet-sidebar-pane.active {
    padding: 0;
}

/* Sidebar close button */
.sidebar-close-button {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 1000;
    background: var(--white);
    color: var(--black);
    border-radius: 50%;
    border: 2px solid #E9F2EE;
    font-size: var(--font-base);
    width: 22px;
    height: 22px;
    font-weight: 400;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.sidebar-close-button:hover {
    background: #e9ecef;
    color: #495057;
    border-color: #adb5bd;
}

.sidebar-title-icon {
    width: 34px;
    height: 34px;
    padding: var(--space-1-2) 0;
    background-color: var(--white);
    border: 2px solid var(--light-green-border);
    border-radius: 50%;
    text-align:center;
    align-items: center;
    display: inline-block;
}

.sidebar-title-icon-img {
    width: 18px;
    height: 18px;
}

.sidebar-title-content span {
    display:inline-block;
    transform: translateY(-6px);
    padding-left: var(--space-1);
}

.sidebar-title-content:hover .sidebar-title-icon {
    border: 2px solid var(--dark-gray);
    background-color: var(--light-gray);
}

/* =================================
   POI LIST COMPONENT
   ================================= */

.poi-list {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.poi-list-bg {
    background-color: var(--light-gray)!important;
}

/* Search box */
.search-box {
    background: var(--white);
    margin-bottom: var(--space-4);
}

.search-box input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: var(--font-base);
    outline: none;
    transition: border-color var(--transition-fast);
}

.search-box input:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}

.search-box input::placeholder {
    color: #999;
}

/* Filter tags */
.filter-tags {
    padding: 15px var(--space-5);
    border-bottom: 1px solid var(--medium-gray);
    background: var(--white);
}

.tag {
    display: inline-block;
    padding: 6px var(--space-3);
    margin: 0 var(--space-2) var(--space-2) 0;
    background-color: var(--light-gray);
    border: 1px solid var(--medium-gray);
    border-radius: 20px;
    font-size: var(--font-sm);
    color: #666;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tag:hover {
    background-color: var(--medium-gray);
    border-color: #ccc;
}

.tag.active {
    background-color: var(--success-green);
    color: var(--white);
    border-color: var(--success-green);
}

/* POI items container */
.poi-items {
    flex: 1;
    overflow-y: auto;
    background: var(--white);
    border-radius: 8px;
}

/* Individual POI item */
.poi-item {
    display: flex;
    align-items: center;
    padding: 0;
    margin-bottom: var(--space-2);
    background-color: var(--light-gray);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    min-height: 80px;
    max-heigt: 80px;
}

.poi-item:hover {
    background-color: var(--medium-gray);
}

.poi-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* POI item elements */
.poi-item-preview {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    object-fit: cover;
    margin-right: 15px;
    flex-shrink: 0;
}

.poi-list-item-image-container {
    position:relative;
}

.poi-item-icon {
    width: 18px;
    height: 18px;
    position:absolute;
    right: 8px;
    top: 17px;
    align-items: center;
    justify-content: center;
}

.poi-item-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.poi-item-content {
    flex: 1;
    min-width: 0;
    margin-right: var(--space-2);
}

.poi-item-content h4 {
    font-size: var(--font-lg);
    font-weight: 600;
    color: var(--black);
    margin: 0 0 4px 0;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.poi-item-category {
    font-size: var(--font-sm);
    color: #666;
    margin: 0 0 4px 0;
    font-weight: 500;
}

.poi-item-description {
    font-size: var(--font-base);
    color: #888;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* POI icon containers */
.poi-icon-container, 
.poi-circle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.poi-circle {
    border-radius: 50%;
    border: 1px solid white;
}

/* POI Hover Effects */
.poi-hover .poi-icon-container img,
.poi-hover .poi-circle {
    transform: scale(1.15);
    transition: transform 0.2s ease;
}

/* POI items container */
.route-items {
    flex: 1;
    overflow-y: auto;
    background: var(--white);
    border-radius: 8px;
}

/* Individual POI item */
.route-item {
    display: flex;
    align-items: center;
    padding: 0;
    margin-bottom: var(--space-2);
    background-color: var(--light-gray);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    min-height: 80px;
    max-heigt: 80px;
}

.route-item:hover {
    background-color: var(--medium-gray);
}

.route-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* Route item elements */
.route-item-preview {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    object-fit: cover;
    margin-right: 15px;
    flex-shrink: 0;
}

.route-list-item-image-container {
    position:relative;
}

.route-item-icon {
    width: 18px;
    height: 18px;
    position:absolute;
    right: 8px;
    top: 17px;
    align-items: center;
    justify-content: center;
}

.route-item-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.route-item-content {
    flex: 1;
    min-width: 0;
    margin-right: var(--space-2);
}

.route-item-content h4 {
    font-size: var(--font-lg);
    font-weight: 600;
    color: var(--black);
    margin: 0 0 4px 0;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.route-item-user-type {
    font-size: var(--font-sm);
    color: #666;
    margin: 0 0 4px 0;
    font-weight: 500;
}

.route-feature img {
    width: 18px;
    height: 18px;
    display:inline-block;
    margin-right: var(--space-2);
}

#route-stats-container {
    margin-bottom: var(--space-3);
}

.route-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem; /* Adds space between the elements */
    margin-top: 0.5rem; /* Optional: adds space above the stats row */
}

/* Optional: Remove default margins from the p tags for better control */
.route-stats p {
    margin: 0;
}

/* Optional: Style the user type and distance differently */
.route-item-user-type {
    display: flex;
    align-items: center;
    gap: 0.25rem; /* Space between icon and text */
    font-size: 0.9rem;
    color: #666;
}

.route-item-distance {
    font-weight: bold;
    color: #333;
    font-size: 0.9rem;
    white-space: nowrap; /* Prevents line breaking */
}

/* Alternative: If you want them to take equal space instead of space-between */
.route-stats.equal-width {
    justify-content: space-around;
}

/* Alternative: If you want the distance to align to the right but not spread fully */
.route-stats.align-right {
    justify-content: flex-start;
    gap: 2rem;
}

.route-stats.align-right .route-item-distance {
    margin-left: auto;
}

.route-item-description {
    font-size: var(--font-base);
    color: #666;
    margin: 0 0 var(--space-2) 0;
    line-height: 1.4;
}

.route-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: var(--font-sm);
    color: #888;
}

.route-stat img {
    width: 24px;
    height: 24px;
    float: left;
}
.route-stat span{
    float: left;
}
.poi-item-description {
    font-size: var(--font-base);
    color: #888;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Distance and Duration Meta */
.poi-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: var(--font-sm);
    color: #888;
    margin-top: 4px;
}

.poi-distance,
.poi-duration {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* POI Sidebar Content */
.poi-sidebar-content {
    padding: 0;
    overflow-y: auto;
    height: 100%;
}

.sidebar-inner-content {
    padding: var(--space-5);
    height: 100%;
    font-size: var(--font-base)!important;
}

.poi-header {
    margin-bottom: var(--space-5);
}

#good-bike-host-icon {
    height: 0;
    position:relative;
}
.poi-header #good-bike-host-icon .good-bike-host-badge {
    width: 64px;
    height: 64px;
    position: absolute;
    top: -50px;
    right: 0;
}

.poi-header h2 {
    font-size: var(--font-3xl);
    font-weight: 600;
    color: var(--black);
    margin: 0 0 var(--space-2) 0;
    line-height: 1.3;
}

.poi-category-badge {
    display: inline-block;
    color: var(--black);
    font-size: var(--font-lg);
    margin-left: var(--space-2);
    font-weight: 500;
}

.poi-header .small-cat-icon {
    width: 26px;
    height: 26px;
    float: left;
    
}
.poi-image {
    margin-bottom: var(--space-5);
    border-radius: 8px;
    overflow: hidden;
}

.poi-description {
    margin-bottom: var(--space-5);
}

.poi-description p {
    color: var(--black);
    line-height: 1.6;
    font-size: var(--font-lg);
}

.poi-address img {
    width: 16px;
    height: 16px;
    float: left;
    margin-top: var(--space-1);
}

.poi-address .address-icon {
    margin-top: var(--space-4);
}

.poi-address h4,
.poi-contact h4,
.poi-website h4 {
    font-size: var(--font-lg);
    font-weight: 700;
    color: var(--black);
    margin: 0 0 var(--space-2) 0;
}

.poi-address p,
.poi-contact p {
    color: var(--black);
    padding: 0 0 0 var(--space-2)!important;
    margin-top: 0;
    font-size: var(--font-lg);
    width: 90%;
    display:inline-block;
    
}

.poi-website a {
    color: #1976d2;
    text-decoration: none;
    font-size: var(--font-base);
}

.poi-website a:hover {
    text-decoration: underline;
}

.poi-actions, .route-actions {
    margin-top: var(--space-6);
    display: flex;
    gap: 12px; /* Adjust spacing between elements as needed */
    align-items: center;
}

#poi-center-btn {
    display:none;
}

.poi-actions > button,
.poi-actions > #poi-product-link-container,
.route-actions > button,
.route-actions > #route-product-link-container {
    text-align:center !important;
    white-space: nowrap;
    padding: var(--space-3) var(--space-8);
}

.poi-actions > button, .route-actions > button {
    flex: 1; /* Takes up equal space */
}

.poi-actions .button-text, 
.route-actions .button-text{
    display:inline-block;
    margin: 0 auto;
}
.poi-actions .button-text {
    padding: var(--space-2) var(--space-3) var(--space-2-3);
}

/* Ensure the link inside the container also fills its parent */
.poi-actions #poi-product-link-container a, .route-actions #route-product-link-container a {
    display: inline-block; /* Or display: flex if you want flex properties */
}
.poi-actions #poi-product-link-container a:hover, 
.route-actions #route-product-link-container a:hover {
    text-decoration: none;
}

.poi-actions > button:hover,
.route-actions > button:hover {
    background-color: var(--ruterdk-green);
    color: var(--white) !important;
} 

/* Features styling */
.poi-features {
    display: flex;
    gap: var(--space-2);
    margin: var(--space-5) 0;
    flex-wrap: wrap;
}

.feature-icon {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--ruterdk-green);
    padding: var(--space-0) var(--space-3) var(--space-0) var(--space-0);
    border-radius: 16px;
    font-size: var(--font-base);
    line-height: var(--font-sm);
    font-weight: 600;
    border: 1px solid var(--ruterdk-green);
}

.feature-icon img {
    padding-left: var(--space-1); 
}
.feature-icon .bubble-text {
    transform: translate(-2px, -1px);
}


/* Scroll indicator */
.sidebar-scroll-indicator {
    position: fixed;
    bottom: 100px;
    left: 280px;
    background: rgba(0, 123, 255, 0.9);
    color: var(--white);
    padding: var(--space-2) var(--space-3);
    border-radius: 20px;
    font-size: var(--font-xs);
    font-weight: 600;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    z-index: 1600;
    box-shadow: 0 3px 12px rgba(0, 123, 255, 0.4);
    backdrop-filter: blur(8px);
    cursor: pointer;
    user-select: none;
}

.sidebar-scroll-indicator.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sidebar-scroll-indicator:not(.visible) {
    transform: translateY(10px);
}

.sidebar-scroll-indicator:hover {
    background: rgba(0, 123, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.5);
}

/* Hide when sidebar is collapsed */
.leaflet-sidebar.collapsed ~ .sidebar-scroll-indicator {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* =================================
   TRADITIONAL POPUP STYLES
   ================================= */

.pop-up-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% - 74px);
    z-index: var(--z-popup);
    background-color: rgba(0, 0, 0, 0.45);
    display: none;
    font-family: var(--font-family);
}

.pop-up-content {
    border-radius: 4px;
    position: fixed;
    z-index: calc(var(--z-popup) + 10);
    left: 50%;
    top: 6px;
    transform: translate(-50%, 0);
    background-color: var(--white);
    width: calc(100% - 12px);
    height: calc(100% - 86px);
    overflow-y: scroll;
    scrollbar-width: 5px;
}

.popup-image {
    width: 100%;
    height: 80px;
    overflow: hidden;
    border-bottom: 1px solid #eee;
}

.popup-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mobile-popup.poi-popup {
    border: 2px solid var(--light-green-border);
}


.mobile-popup.route-popup {
    border: 2px solid var(--light-green-border);
}

/* =================================
   ELEGANT GALLERY SLIDESHOW STYLES
   ================================= */
#poi-slideshow-container {
    width: 100%;
}
   
.image-slideshow {
    overflow: hidden;
    background: var(--white);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.slideshow-container {
    position: relative;
    max-width: 100%;
    margin: 0;
    background: var(--light-gray);
    overflow: hidden;
}

.slide {
    display: none;
    position: relative;
    width: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.slide.active {
    display: block;
    opacity: 1;
}

.slide img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
    border: none;
    transition: transform 0.6s ease;
}

.slide:hover img {
    transform: scale(1.01);
}

.slide-info {
    background: linear-gradient(
        to top, 
        rgba(0,0,0,0.7) 0%, 
        rgba(0,0,0,0.4) 40%, 
        rgba(0,0,0,0.1) 70%,
        transparent 100%
    );
    color: var(--white);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-2) var(--space-4) var(--space-4);
    backdrop-filter: blur(1px);
}

.slide-title {
    font-weight: 600;
    margin-bottom: 2px;
    font-size: var(--font-sm-b);
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.slide-copyright {
    font-size: var(--font-xs);
    opacity: 0.85;
    font-weight: 400;
    font-style: italic;
}

/* ELEGANT PAGINATION DOTS (like in your reference image) */
.slideshow-nav {
    text-align: center;
    padding: var(--space-2);
    /* background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%); */
    background: var(--light-gray);
    border-top: 1px solid rgba(0,0,0,0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-1);
}

.slide-counter {
    font-size: var(--font-xs);
    color: var(--secondary-gray);
    margin: 0 var(--space-3);
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* PAGINATION DOTS */
.pagination-dots {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.pagination-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pagination-dot:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: scale(1.2);
}

.pagination-dot.active {
    background: var(--primary-blue);
    width: 32px;
    border-radius: 6px;
    transform: scale(1);
}

.pagination-dot.active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
}

/* SUBTLE NAVIGATION ARROWS (smaller, more elegant) */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-blue);
    border: none;
    width: 22px !important;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    font-size: var(--font-lg);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    pointer-events: none;
}

.slideshow-container:hover .nav-arrow {
    opacity: 1;
    pointer-events: auto;
}

.nav-arrow:hover {
    background: var(--white);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.nav-arrow.prev {
    left: 16px;
}

.nav-arrow.next {
    right: 16px;
}

/* SINGLE IMAGE STYLING */
.single-image .slideshow-container {
}

.single-image .slideshow-nav {
    display: none;
}

/* LOADING STATE */
.slide.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ACCESSIBILITY IMPROVEMENTS */
.nav-arrow:focus,
.pagination-dot:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

.slide-info {
    /* Ensure text is readable */
    text-shadow: 
        0 1px 3px rgba(0,0,0,0.8),
        0 0 8px rgba(0,0,0,0.3);
}

/* SMOOTH TRANSITIONS */
* {
    box-sizing: border-box;
}

.slideshow-container * {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* =================================
   LARGE ICON POI STYLES
   ================================= */

.large-icon-poi {
    cursor: pointer;
    z-index: 3000;
}

.large-icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    transition: transform 0.2s ease;
}

.large-icon-poi.medium .large-icon-container {
    padding: 3px;
}

.large-icon-svg {
    transition: all 0.2s ease;
}

.large-icon-container .large-icon-svg[style*="background-color"] {
    mask-mode: luminance;
    -webkit-mask-mode: luminance;
}

.large-icon-poi.poi-hover .large-icon-container,
.large-icon-poi.large-icon-hover .large-icon-container {
    transform: scale(1.1);
}

.large-icon-poi.poi-hover .large-icon-svg,
.large-icon-poi.large-icon-hover .large-icon-svg {
    filter: brightness(1.2);
}

.large-icon-fallback .poi-circle {
    border: 1px solid white;
    /* box-shadow: 0 1px 3px rgba(0,0,0,0.3); */
}

.large-icon-fallback.poi-hover .poi-circle {
    border-width: 1px;
    /* box-shadow: 0 2px 6px rgba(0,0,0,0.4); */
}

.large-icon-poi .large-icon-container {
    animation: none;
}

.large-icon-poi.poi-selected .large-icon-container {
    animation: pulse-large-icon 2s ease-in-out;
}

.leaflet-marker-pane .large-icon-poi {
    z-index: 3000 !important;
}

/* Activate interaction button - legacy */
.activate-interaction-btn {
    display: none;
}

/* =================================
   GOOD BIKE HOST STYLES
   ================================= */

.poi-item.bike-host {
    /* background-color: #fff9c4; */
    position: relative;
    margin-top: var(--space-6);
}

.poi-item.bike-host:hover {
    background-color: #fff7b3;
}

.poi-item.bike-host::after {
    content: url("/static/widget_app/images/cykelvaert_s.930072ff3d69.svg");
    position: absolute;
    right: var(--space-2);
    top: -20px;
    font-size: var(--font-3xl);
    background-color: var(--warning-yellow);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.good-bike-host-label {
    background: transparent;
    border: none;
    box-shadow: none;
    z-index: calc(var(--z-map-controls) + 100);
}

.bike-host-label-container {
    display: flex;
    align-items: center;
    background: var(--bike-host-bg);
    border-radius: 20px;
    padding: 2px 10px 2px 4px;
    box-shadow: var(--shadow-md);
    white-space: nowrap;
    min-height: 24px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.bike-host-label-container:hover,
.bike-host-hover .bike-host-label-container {
    background: var(--bike-host-bg-hover);
    transform: scale(1.05);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.bike-host-icon {
    width: 20px;
    height: 20px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 6px;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.bike-host-icon img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.bike-host-label-text {
    color: var(--bike-host-text);
    font-weight: 600;
    font-size: var(--font-sm);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

/* =================================
   POPUP STYLES
   ================================= */

.mobile-popup-container {
    position: absolute;
    z-index: var(--z-mobile-popup);
    pointer-events: none;
}

.mobile-popup {
    position: relative;
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    pointer-events: all;
    cursor: pointer;
    transition: transform var(--transition-fast), opacity var(--transition-fast);
    max-width: 300px;
    min-width: 220px;
}

.mobile-popup:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.popup-content {
    padding: 10px var(--space-3);
    background: var(--white);
}

.popup-content .good-bike-host-badge {
    width: 48px;
    height: 48px;
    position:absolute;
    top: 58px;
    right: 10px;
}

.popup-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}

.popup-title h3 {
    margin: 0 0 4px 0;
    max-width: 150px;
    font-size: var(--font-base);
    font-weight: 600;
    line-height: 1.2;
    color: var(--black);
    word-wrap: break-word;
    display:inline-block;
}

.popup-title div:first-child {
    min-width:100px;
}

.popup-title .small-cat-icon {
    max-width: 20px;
    max-height: 20px;
    float:left;
}
.popup-title .popup-category {
    float: left;
    font-size: var(--font-sm-b);
    margin: 0 0 var(--space-3) var(--space-3);

    line-height: 20px;
}

.popup-info-row {
    display:flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem; /* Minimum space between the divs */
}
.popup-user-type {
    display:flex;
}

.popup-stats {
    display:flex;
    float: left;
    font-size: var(--font-sm-b);
    margin-left: auto;
    line-height: 20px;
    width: auto;
}

/* =================================
   USER LOCATION MARKER
   ================================= */

.leaflet-control-location {
    width: 34px;
    height: 34px;
}

.location-btn {
    position: absolute;
    right: 0px;
    z-index: var(--z-map-controls);
    background: var(--white);
    border: 2px solid #E9F2EE !important;
    border-radius: 50% !important;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.location-btn img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: block;
}

.location-btn:hover {
    background: var(--light-gray);
    border-color: rgba(0, 0, 0, 0.4) !important;
}

/* Make sure the user location marker is visible above other elements */
.leaflet-marker-pane .leaflet-marker-icon {
    z-index: 1000;
}

/* Optional: Add a subtle pulsing effect */
@keyframes userLocationPulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.2);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Apply pulse to user location circle marker */
.leaflet-marker-pane path[fill="#4285f4"] {
    animation: userLocationPulse 2s infinite;
}

/* User Location Circle Marker Styles */
.user-location-circle-marker {
    /* Ensure the circle marker appears above other elements */
    z-index: 1000 !important;
}

/* Pulsing animation for user location marker */
.user-location-pulse {
    animation: locationPulse 2s infinite;
}

@keyframes locationPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Alternative pulsing effect using box-shadow */
.user-location-circle-marker.user-location-pulse {
    position: relative;
}

.user-location-circle-marker.user-location-pulse::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #4285f4;
    opacity: 0.3;
    animation: pulseRing 2s infinite;
    pointer-events: none;
}

@keyframes pulseRing {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.3;
    }
    100% {
        transform: translate(-50%, -50%) scale(3);
        opacity: 0;
    }
}

/* Enhanced circle marker styling */
.leaflet-interactive.user-location-circle-marker {
    /* Smooth transitions for interactions */
    transition: all 0.2s ease;
}

.leaflet-interactive.user-location-circle-marker:hover {
    /* Slightly enlarge on hover */
    transform: scale(1.1);
}

/* Accuracy circle styling */
.leaflet-interactive[style*="#4285f4"] {
    /* Style for the accuracy circle */
    pointer-events: none; /* Don't interfere with map interactions */
}

/* Loading state for location button */
.leaflet-control-location .location-btn.loading {
    opacity: 0.6;
    pointer-events: none;
}

.leaflet-control-location .location-btn.loading img {
    animation: locationButtonSpin 1s linear infinite;
}

@keyframes locationButtonSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* =================================
   ROUTE LEGEND CONTROL
   ================================= */

.leaflet-control-route-legend {
    background: none;
    border: none;
    box-shadow: none;
}

.legend-container {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #E9F2EE;
    border-radius: 8px;
    max-width: 250px;
    backdrop-filter: blur(10px);
    transform: translateX(0);
    opacity: 1;
    transition: all var(--transition-normal);
    position: relative;
}

.legend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px var(--space-3) 6px var(--space-3);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.02);
    border-radius: 6px 6px 0 0;
    position: relative;
}

.legend-title {
    margin: 0;
    font-size: var(--font-base);
    font-weight: 600;
    color: #2c3e50;
}

.legend-content {
    padding: 10px var(--space-3) var(--space-3) var(--space-3);
    max-height: 300px;
    overflow-y: auto;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: var(--space-3);
}

.legend-item:last-child {
    margin-bottom: 0;
}

/* Legend Line Samples */
.legend-line {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    flex-shrink: 0;
    position: relative;
}

.legend-line.solid {
    /* Solid line - just background color */
}

.legend-line.dashed {
    background: transparent !important;
    position: relative;
    overflow: hidden;
}

.legend-line.dashed::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        var(--legend-color, #3388ff) 0%, 
        var(--legend-color, #3388ff) 50%, 
        transparent 50%, 
        transparent 100%
    );
    background-size: 8px 100%;
    background-repeat: repeat-x;
}

/* Legend Labels */
.legend-label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex: 1;
    min-width: 0;
}

.user-type-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.user-type-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.legend-text {
    font-size: var(--font-sm);
    color: #2c3e50;
    font-weight: 500;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.legend-count {
    font-size: var(--font-sm);
    color: #7f8c8d;
    font-weight: normal;
    flex-shrink: 0;
}

.legend-close-btn {
    background: var(--white);
    border-radius: 50%;
    border: 2px solid #E9F2EE;
    font-size: var(--font-xs);
    color: var(--black);
    cursor: pointer;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 2px;
    top: 2px;
    transition: all var(--transition-fast);
    padding: 1px 4px 4px;
}

.legend-close-btn:hover {
    background: var(--light-gray);
    border-color: rgba(0, 0, 0, 0.4) !important;
}

.legend-container.expanding {
    animation: slideInFromLeft 0.3s ease-out;
}

.legend-container.closing {
    animation: slideOutToLeft 0.3s ease-in;
}

.legend-expand-btn.expanding {
    animation: slideInFromLeft 0.3s ease-out;
}

.legend-expand-btn.closing {
    animation: slideOutToLeft 0.3s ease-in;
}

.legend-expand-btn {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #E9F2EE !important;
    border-radius: 50%;
    padding: 2px;
    cursor: pointer;
    font-size: var(--font-2xl);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
}

.legend-expand-btn img {
    width: 18px;
    height: 18px;
}

.legend-expand-btn:hover {
    background-color: var(--light-gray);
    border-color: rgba(0, 0, 0, 0.4) !important;
}

/* =================================
   CUSTOM ATTRIBUTION CONTROL
   ================================= */

.leaflet-control-custom-attribution {
    background: var(--white);
    border: 1px solid #E9F2EE !important;
    border-radius: 20px;
    display: flex;
    align-items: center;
    flex-direction: row-reverse;
    position: relative;
    overflow: hidden;
    width: 28px;
    height: 28px;
}

.leaflet-control-custom-attribution.expanded {
    width: 306px;
    z-index: 1100;
}

.attribution-info-btn {
    background: var(--white);
    border: 1px solid #E9F2EE !important;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    padding: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: var(--font-lg);
    font-weight: bold;
    color: #666;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    order: 2;
}

.attribution-info-btn:hover {
    background: var(--light-gray);
    border-color: rgba(0, 0, 0, 0.4) !important;
}

.attribution-info-btn img {
    width: 18px;
    height: 18px;
}

.attribution-text {
    position: absolute;
    left: var(--space-2);
    top: 50%;
    transform: translateY(-50%);
    padding: 0 var(--space-3) 0 0;
    font-size: var(--font-xs);
    color: #666;
    white-space: nowrap;
    width: 0;
    opacity: 0;
    overflow: hidden;
    transition: all var(--transition-normal);
    order: 1;
    z-index: 1;
}

.leaflet-control-custom-attribution.expanded .attribution-text {
    width: 306px;
    opacity: 1;
    padding-right: var(--space-2);
}

/* =================================
   ROUTE MARKERS
   ================================= */

.route-start-marker,
.route-end-marker {
    background: none;
    border: none;
    transform-origin: center center;
    pointer-events: none;
}

.route-marker-container {
    position: relative;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: center center;
}

.route-marker-container.end {
    width: 24px;
    height: 24px;
}

.route-marker-circle {
    width: 16px;
    height: 16px;
    border: 2px solid #3388ff;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    transform-origin: center center;
}

.route-marker-container.end .route-marker-circle {
    width: 20px;
    height: 20px;
}


.route-marker-inner {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.route-marker-container.end .route-marker-inner {
    width: 14px;
    height: 14px;
}

.route-marker-inner.start-marker {
    background: #28a745;
}

.route-marker-text {
    color: white;
    font-size: var(--font-xs);
    font-weight: bold;
    line-height: 1;
    font-family: var(--font-family);
    display: flex;
    align-items: center;
    justify-content: center;
}

.end-marker .route-marker-text img {
    width: 14px;
    height: 14px;
}

/* Hover effects - manual adjustments instead of transform scaling */
.route-marker-circle.route-hovered {
    /* Manual hover effects for regular markers */
    width: 22px !important;  /* 20px * 1.1 = 22px */
    height: 22px !important;
    border-width: 2.2px;     /* 2px * 1.1 = 2.2px */
    transition: all 0.2s ease;
    /* Adjust position to keep centered */
    margin-top: -1px;
    margin-left: -1px;
}

/* Manual hover effects for start markers */
.route-marker-container.start .route-marker-circle.route-hovered {
    width: 17.6px !important;  /* 16px * 1.1 = 17.6px */
    height: 17.6px !important;
    border-width: 2.2px;       /* 2px * 1.1 = 2.2px */
    /* Adjust position to keep centered */
    margin-top: -0.8px;
    margin-left: -0.8px;
}

/* Adjust inner elements during hover to maintain proportions */
.route-marker-circle.route-hovered .route-marker-inner {
    width: 15.4px !important;  /* 14px * 1.1 = 15.4px */
    height: 15.4px !important;
}

.route-marker-container.start .route-marker-circle.route-hovered .route-marker-inner {
    width: 11px !important;  /* 10px * 1.1 = 11px */
    height: 11px !important;
}

/* Scale the image inside end markers during hover */
.route-marker-circle.route-hovered .route-marker-text img {
    width: 15.4px !important;  /* 14px * 1.1 = 15.4px */
    height: 15.4px !important;
    transition: all 0.2s ease;
}

/* Remove individual marker hover effects */
.route-start-marker,
.route-end-marker {
    pointer-events: none; /* Make markers completely non-interactive */
    animation: markerFadeIn 0.3s ease-out;
}

/* =================================
   POI/ROUTE TOGGLE CONTROLS
   ================================= */

.leaflet-control-poi-route-toggles {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.leaflet-control-poi-button,
.leaflet-control-route-button {
    width: 40px;
    height: 40px;
    background: white;
    border: 2px solid #E9F2EE !important;
    border-radius: 20px;
    font-size: var(--font-xl);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 8px 0;
}

.leaflet-control-poi-button:hover,
.leaflet-control-route-button:hover,
.leaflet-control-poi-button.active,
.leaflet-control-route-button.active {
    background-color: var(--light-gray);
    border-color: rgba(0, 0, 0, 0.4) !important;
}

.route-color-indicator {
    width: 20px;
    height: 4px;
    border-radius: 2px;
}

/* =================================
   FULLSCREEN CONTROL STYLES
   ================================= */
   
/* iOS-specific fullscreen close button */
#ios-fullscreen-close {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: var(--font-xl);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    touch-action: manipulation;
}

.leaflet-control-fullscreen-button {
    background-color: var(--white) !important;
    color: var(--black);
    font-size: var(--font-xl);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid #E9F2EE !important;
    border-radius: 50% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 36px !important;
    height: 36px !important;
}

.leaflet-control-fullscreen-button:hover {
    background-color: var(--light-gray) !important;
    border-color: rgba(0, 0, 0, 0.4) !important;
}

.leaflet-control-fullscreen-button img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    transition: all var(--transition-fast);
    margin: 0;
    padding: 0;
    display: block;  
}

.map-fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: var(--z-fullscreen) !important;
    background-color: var(--white);
}

.map-fullscreen .leaflet-control-layers {
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.map-fullscreen #bottom-bar {
    z-index: calc(var(--z-fullscreen) + 100);
}

.leaflet-fullscreen-on {
    width: 100% !important;
    height: 100% !important;
}

.map-fullscreen-active .bottom-bar {
    display:none;
}

/* When map is in fullscreen, ensure interaction overlay stays on top */
.map-fullscreen #map-interaction-overlay {
    z-index: 10000 !important; /* Higher than map-fullscreen z-index of 9999 */
    height: 100%!important;
}
.map-fullscreen .map-wrapper {
    height: 100%!important;
    top: 0!important;
}

/* Also ensure the lock button stays on top */
.map-fullscreen #map-lock-btn, .map-fullscreen .map-lock-button {
    z-index: 10002 !important; /* Even higher than the overlay */
}

/* Alternative: If you want to target when body has the fullscreen class */
.map-fullscreen-active #map-interaction-overlay {
    z-index: 10001 !important;
    height: 100%!important;
}

.map-fullscreen-active .map-wrapper {
    height: 100%!important;
    top: 0!important;
}

.map-fullscreen-active #map-lock-btn, .map-fullscreen-active .map-lock-button {
    z-index: 1950 !important;
}
.map-fullscreen .leaflet-marker-pane{
    z-index: 10005;

}

/* =================================
   LOGO AND BRANDING
   ================================= */

.ruterdk-logo {
    width: 100px;
    height: 40px;
    position: absolute;
    bottom: 4px;
    right: 40px;
    padding: 0 10px;
    z-index: 1000;
}

/* =================================
   SCROLLBAR STYLES
   ================================= */

.poi-items::-webkit-scrollbar,
.poi-sidebar-content::-webkit-scrollbar,
.route-sidebar-content::-webkit-scrollbar,
.sidebar-scrollable-content::-webkit-scrollbar,
.legend-content::-webkit-scrollbar {
    width: 6px;
}

.poi-items::-webkit-scrollbar-track,
.poi-sidebar-content::-webkit-scrollbar-track,
.route-sidebar-content::-webkit-scrollbar-track,
.sidebar-scrollable-content::-webkit-scrollbar-track,
.legend-content::-webkit-scrollbar-track {
    background: var(--light-gray);
    border-radius: 3px;
}

.poi-items::-webkit-scrollbar-thumb,
.poi-sidebar-content::-webkit-scrollbar-thumb,
.route-sidebar-content::-webkit-scrollbar-thumb,
.sidebar-scrollable-content::-webkit-scrollbar-thumb,
.legend-content::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 3px;
    transition: background var(--transition-fast);
}

.poi-items::-webkit-scrollbar-thumb:hover,
.poi-sidebar-content::-webkit-scrollbar-thumb:hover,
.route-sidebar-content::-webkit-scrollbar-thumb:hover,
.sidebar-scrollable-content::-webkit-scrollbar-thumb:hover,
.legend-content::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* =================================
   ANIMATIONS
   ================================= */

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.3);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(66, 133, 244, 0);
    }
    100% {
        box-shadow: 0 0 0 3px rgba(66, 133, 244, 0);
    }
}

@keyframes lock-button-pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes slideInFromLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutToLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

@keyframes markerFadeIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse-large-icon {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes goldGlow {
    0% { box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3); }
    50% { box-shadow: 0 4px 16px rgba(255, 215, 0, 0.6); }
    100% { box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3); }
}

@keyframes attention-pulse-animation {
    0% { 
        transform: translate(-50%, 0) scale(1);
        background: #fff3cd;
        border-color: var(--warning-yellow);
        box-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
    }
    50% { 
        transform: translate(-50%, 0) scale(1.15);
        background: #ffe066;
        border-color: var(--warning-orange);
        box-shadow: 0 0 25px rgba(255, 107, 53, 0.9);
    }
    100% { 
        transform: translate(-50%, 0) scale(1);
        background: #fff3cd;
        border-color: var(--warning-yellow);
        box-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
    }
}

@keyframes pulse-highlight {
    0% { 
        transform: translate(-50%, 0) scale(1);
        background: var(--white);
        border-color: transparent;
    }
    50% { 
        transform: translate(-50%, 0) scale(1.05);
        background: #fff3cd;
        border-color: var(--warning-yellow);
        box-shadow: 0 0 20px rgba(255, 193, 7, 0.6);
    }
    100% { 
        transform: translate(-50%, 0) scale(1);
        background: var(--white);
        border-color: transparent;
    }
}

@keyframes attention-bounce-animation {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 4px 16px rgba(0, 123, 255, 0.3);
        background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    }
    25% { 
        transform: scale(1.1);
        box-shadow: 0 6px 24px rgba(255, 193, 7, 0.8);
        background: linear-gradient(135deg, var(--warning-yellow) 0%, #ff8c00 100%);
    }
    50% { 
        transform: scale(1.2);
        box-shadow: 0 8px 32px rgba(255, 107, 53, 1);
        background: linear-gradient(135deg, var(--warning-orange) 0%, #e74c3c 100%);
    }
    75% { 
        transform: scale(1.1);
        box-shadow: 0 6px 24px rgba(255, 193, 7, 0.8);
        background: linear-gradient(135deg, var(--warning-yellow) 0%, #ff8c00 100%);
    }
}

/* =================================
   UTILITY CLASSES
   ================================= */

.hidden {
    display: none;
}

.visible {
    display: block;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.pointer-events-none {
    pointer-events: none;
}

.pointer-events-all {
    pointer-events: all;
}

/* Focus styles for accessibility */
.btn:focus,
.close-btn:focus,
.location-btn:focus,
.attribution-info-btn:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* =================================
   MEDIA QUERIES (MOBILE FIRST)
   ================================= */

/* Mobile-specific styles (max-width: 480px) */
@media (max-width: 480px) {
    .activate-interaction-btn {
        width: 44px;
        height: 44px;
        font-size: var(--font-xl);
        top: 15px;
        left: 15px;
    }
    
    .bottom-bar-button {
        padding: 8px;
        min-width: 32px;
        min-height: 32px;
        gap: 0;
    }
    
    .bottom-bar-button img {
        width: 16px !important;
        height: 16px !important;
    }
    
    .bottom-bar-button span {
        display: none !important;
    }
    
    .bottom-bar h2,
    .route-info h2 {
        font-size: var(--font-lg);
    }
    
    .mobile-popup {
        max-width: 300px;
        min-width: 220px;
    }
    
    .popup-content {
        padding: 10px var(--space-3);
    }
    
    .popup-title h3 {
        font-size: var(--font-lg);
    }
    
    .bike-host-label-text {
        font-size: var(--font-sm);
        max-width: 120px;
    }
    
    .bike-host-label-container {
        padding: 2px 10px 2px 4px;
        min-height: 24px;
    }
    
    .bike-host-icon {
        width: 20px;
        height: 20px;
        margin-right: 6px;
    }
    
    .bike-host-icon img {
        width: 18px;
        height: 18px;
    }
    
    .slide img {
        height: 160px;
    }
    
    .slideshow-nav {
        padding: var(--space-2) var(--space-2);
    }
    
    .prev, .next {
        padding: 6px 10px;
        font-size: var(--font-xs);
    }
    
    .large-icon-container {
        padding: 2px;
    }
    
    .large-icon-poi.poi-hover .large-icon-container,
    .large-icon-poi.large-icon-hover .large-icon-container {
        transform: scale(1.05);
    }

    #poi-center-btn {
        display:none;
    }
}

/* Small phones and larger (350px+) */
@media (min-width: 350px) {
    /* No changes to buttons - keeping same sizes */
}

/* Large screens (481px+) - buttons with text */
@media (min-width: 481px) {
    .mobile-popup {
        max-width: 300px;
        min-width: 220px;
    }
    
    .popup-content {
        padding: var(--space-3) var(--space-4);
    }
    
    .popup-title h3 {
        font-size: var(--font-lg);
    }
    
    .bike-host-label-text {
        font-size: var(--font-base);
        max-width: 150px;
    }
    
    .bike-host-label-container {
        padding: 2px var(--space-2) 2px 2px;
        min-height: 24px;
    }
    
    .bike-host-icon {
        width: 22px;
        height: 22px;
        margin-right: var(--space-2);
    }
    
    .bike-host-icon img {
        width: 20px;
        height: 20px;
    }
    
    .slide img {
        height: 200px;
    }
    
    .slideshow-nav {
        padding: var(--space-2) var(--space-2);
    }
    
    .prev, .next {
        padding: var(--space-2) var(--space-3);
        font-size: var(--font-sm);
    }
    
    /* Bottom bar improvements for larger screens */
    .bottom-bar h2,
    .route-info h2 {
        font-size: var(--font-xl);
    }
    
    .bottom-bar-button {
        padding: 8px 12px;
        min-width: auto;
    }
    
    .bottom-bar-button span {
        display: inline !important;
    }
}

/* Small tablets and larger phones (500px+) */
@media (min-width: 500px) {
    #bottombar-route-inside div:first-child {
        width: calc(100% - 230px) !important;
    }
}

/* Medium tablets (650px+) */
@media (min-width: 650px) {
    .pop-up-content {
        top: 44%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: auto;
        height: auto;
        max-width: 550px;
        max-height: calc(100% - 30%);
    }
    
    .close-btn {
        top: 6px !important;
        left: 50%;
        transform: translate(-50%, 0) !important;
    }
    
    #bottombar-route-inside div:first-child {
        width: calc(100% - 376px) !important;
    }
    
    .bottom-bar h2,
    .route-info h2 {
        font-size: var(--font-2xl);
    }

}

/* Tablets and small desktops (768px+) */
@media (min-width: 768px) {
    .leaflet-sidebar {
        width: 500px;
        max-width: none;
    }
    
    .leaflet-sidebar-left ~ .leaflet-control-container .leaflet-left {
        left: 512px;
    }
    .legend-container {
        max-width: 280px;
    }
    
    .legend-header {
        padding: var(--space-3) var(--space-4) var(--space-2) var(--space-4);
    }
    
    .legend-content {
        padding: var(--space-3) var(--space-6) var(--space-4) var(--space-4);
    }
    
    .legend-title {
        font-size: var(--font-base);
    }
    
    .legend-text {
        font-size: var(--font-sm);
    }
    
    .map-lock-button {
        min-width: 200px;
    }
    
    .map-lock-button .lock-text {
        font-size: var(--font-base);
    }
    
    .route-marker-container {
        width: 24px;
        height: 24px;
    }
    
    .route-marker-circle {
        width: 20px;
        height: 20px;
    }
    
    .route-marker-inner {
        width: 14px;
        height: 14px;
    }
    
    .route-marker-container.start .route-marker-circle {
        width: 16px;
        height: 16px;
    }
    
    .route-marker-container.start .route-marker-inner {
        width: 10px;
        height: 10px;
    }
    
    .large-icon-container {
        padding: 2px;
    }
    
    .large-icon-poi.poi-hover .large-icon-container,
    .large-icon-poi.large-icon-hover .large-icon-container {
        transform: scale(1.05);
    }

    #poi-center-btn {
        display:block;
    }

}

@media (min-width: 992px) and (max-width: 1199px) {
  .leaflet-sidebar-left ~ .leaflet-control-container .leaflet-left {
    left: 512px;
  }
}

/* Large tablets and small desktops (880px+) */
@media (min-width: 880px) {
    .meta_elements_end {
        display: flex !important;
    }

}

/* Desktops (1200px+) */
@media (min-width: 1200px) {
    .leaflet-sidebar {
        width: 600px;
    }
    
    .legend-container {
        max-width: 320px;
    }
    .leaflet-sidebar-left ~ .leaflet-control-container .leaflet-left {
        left: 610px;
    }
}

@media (max-width: 768px) {
    .poi-actions > #poi-product-link-container, #poi-product-link-container a {
        width: 100%;
    }
    
    .leaflet-sidebar {
        position: fixed !important;
        top: 14% !important;
        left: 50% !important;
        transform: translate(-50%, -3%) !important;
        max-width: 420px !important;
        width: calc(100vw - 40px) !important; /* Full width minus 20px spacing on each side */
        max-height: calc(100vh - 114px) !important;
    }
}

@media (max-width: 768px) and (max-height: 750px){
    .leaflet-sidebar {
        position: fixed !important;
        top: 104px !important;
        left: 50% !important;
        transform: translate(-50%, -3%) !important;
        max-width: 420px !important;
        width: calc(100vw - 40px) !important; /* Full width minus 20px spacing on each side */
        max-height: calc(100vh - 114px) !important;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .poi-icon-container img,
    .bike-host-icon img,
    .user-type-icon img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
    
    .route-marker-circle {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .pulse,
    .poi-item.bike-host::after {
        animation: none;
    }
}

/* Enhanced iOS Fullscreen CSS */

/* CSS Custom Properties for dynamic values */
:root {
    --safe-area-inset-top: env(safe-area-inset-top);
    --safe-area-inset-bottom: env(safe-area-inset-bottom);
    --safe-area-inset-left: env(safe-area-inset-left);
    --safe-area-inset-right: env(safe-area-inset-right);
    --vh: 1vh;
}

/* iOS Fullscreen Mode - Applied to body */
.ios-fullscreen-mode {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: calc(var(--vh, 1vh) * 100) !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    -webkit-overflow-scrolling: touch;
    background: #000 !important;
    z-index: 9999 !important;
}

/* iOS Fullscreen Map Container */
.ios-fullscreen-map {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: calc(var(--vh, 1vh) * 100) !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    z-index: 10000 !important;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
}

/* iOS Safe Area Support */
@supports (padding: max(0px)) {
    .ios-fullscreen-map {
        padding-top: max(var(--safe-area-inset-top), 0px) !important;
        padding-bottom: max(var(--safe-area-inset-bottom), 0px) !important;
        padding-left: max(var(--safe-area-inset-left), 0px) !important;
        padding-right: max(var(--safe-area-inset-right), 0px) !important;
        
        /* Adjust height to account for safe areas */
        height: calc(100vh - max(var(--safe-area-inset-top), 0px) - max(var(--safe-area-inset-bottom), 0px)) !important;
        height: calc(calc(var(--vh, 1vh) * 100) - max(var(--safe-area-inset-top), 0px) - max(var(--safe-area-inset-bottom), 0px)) !important;
    }
}

/* iOS Fullscreen Control Button */
.ios-fullscreen-control {
    position: absolute !important;
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10001;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s ease;
}

.ios-fullscreen-control:hover,
.ios-fullscreen-control:focus {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.05);
}

.ios-fullscreen-control:active {
    transform: scale(0.95);
}

/* Adjust button position for safe areas */
@supports (padding: max(0px)) {
    .ios-fullscreen-control {
        top: calc(10px + max(var(--safe-area-inset-top), 0px));
        right: calc(10px + max(var(--safe-area-inset-right), 0px));
    }
}

/* Enhanced Mobile View (fallback) */
.enhanced-mobile-view {
    width: 100vw !important;
    height: 80vh !important;
    position: relative !important;
    z-index: 1000 !important;
}

/* iOS Landscape Orientation Fixes */
@media screen and (orientation: landscape) {
    .ios-fullscreen-map {
        /* Additional padding for landscape notch */
        padding-left: max(var(--safe-area-inset-left), 20px) !important;
        padding-right: max(var(--safe-area-inset-right), 20px) !important;
    }
    
    .ios-fullscreen-control {
        /* Adjust button position in landscape */
        top: calc(5px + max(var(--safe-area-inset-top), 0px));
        right: calc(5px + max(var(--safe-area-inset-right), 20px));
    }
}

/* Specific iPhone Models Safe Area Adjustments */

/* iPhone X, XS, 11 Pro, 12 mini, 13 mini */
@media only screen 
    and (device-width: 375px) 
    and (device-height: 812px) 
    and (-webkit-device-pixel-ratio: 3) {
    .ios-fullscreen-map {
        padding-top: max(44px, var(--safe-area-inset-top)) !important;
        padding-bottom: max(34px, var(--safe-area-inset-bottom)) !important;
    }
}

/* iPhone XR, 11, 12, 13, 14 */
@media only screen 
    and (device-width: 414px) 
    and (device-height: 896px) 
    and (-webkit-device-pixel-ratio: 2) {
    .ios-fullscreen-map {
        padding-top: max(44px, var(--safe-area-inset-top)) !important;
        padding-bottom: max(34px, var(--safe-area-inset-bottom)) !important;
    }
}

/* iPhone XS Max, 11 Pro Max */
@media only screen 
    and (device-width: 414px) 
    and (device-height: 896px) 
    and (-webkit-device-pixel-ratio: 3) {
    .ios-fullscreen-map {
        padding-top: max(44px, var(--safe-area-inset-top)) !important;
        padding-bottom: max(34px, var(--safe-area-inset-bottom)) !important;
    }
}

/* iPhone 12 Pro, 13 Pro, 14 Pro */
@media only screen 
    and (device-width: 390px) 
    and (device-height: 844px) 
    and (-webkit-device-pixel-ratio: 3) {
    .ios-fullscreen-map {
        padding-top: max(47px, var(--safe-area-inset-top)) !important;
        padding-bottom: max(34px, var(--safe-area-inset-bottom)) !important;
    }
}

/* iPhone 12 Pro Max, 13 Pro Max, 14 Plus */
@media only screen 
    and (device-width: 428px) 
    and (device-height: 926px) 
    and (-webkit-device-pixel-ratio: 3) {
    .ios-fullscreen-map {
        padding-top: max(47px, var(--safe-area-inset-top)) !important;
        padding-bottom: max(34px, var(--safe-area-inset-bottom)) !important;
    }
}

/* iPhone 14 Pro */
@media only screen 
    and (device-width: 393px) 
    and (device-height: 852px) 
    and (-webkit-device-pixel-ratio: 3) {
    .ios-fullscreen-map {
        padding-top: max(59px, var(--safe-area-inset-top)) !important;
        padding-bottom: max(34px, var(--safe-area-inset-bottom)) !important;
    }
}

/* iPhone 14 Pro Max */
@media only screen 
    and (device-width: 430px) 
    and (device-height: 932px) 
    and (-webkit-device-pixel-ratio: 3) {
    .ios-fullscreen-map {
        padding-top: max(59px, var(--safe-area-inset-top)) !important;
        padding-bottom: max(34px, var(--safe-area-inset-bottom)) !important;
    }
}

/* iPad Adjustments */
@media screen and (min-device-width: 768px) and (-webkit-min-device-pixel-ratio: 1) {
    .ios-fullscreen-map {
        padding: 0 !important; /* iPads generally don't need safe area adjustments */
    }
    
    .ios-fullscreen-control {
        top: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
}

/* Fix for iOS Safari 100vh bug */
@supports (-webkit-touch-callout: none) {
    html, body {
        height: -webkit-fill-available;
    }
    
    .ios-fullscreen-mode {
        height: -webkit-fill-available !important;
    }
    
    .ios-fullscreen-map {
        height: -webkit-fill-available !important;
    }
}

/* iOS Fullscreen Animation */
.ios-fullscreen-map {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ios-fullscreen-mode {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ios-fullscreen-mode .leaflet-marker-pane .leaflet-marker-icon {
    z-index: 10002;
}

/* Prevent iOS rubber band effect */
.ios-fullscreen-mode {
    overscroll-behavior: none;
    -webkit-overscroll-behavior: none;
}

/* Hide scrollbars in fullscreen */
.ios-fullscreen-mode::-webkit-scrollbar {
    display: none;
}

/* Leaflet map adjustments for iOS fullscreen */
.ios-fullscreen-map .leaflet-container {
    width: 100% !important;
    height: 100% !important;
}

/* Ensure map controls are visible in fullscreen */
.ios-fullscreen-map .leaflet-control-container {
    z-index: 10002 !important;
}

/* Adjust layer control for safe areas */
@supports (padding: max(0px)) {
    .ios-fullscreen-map .leaflet-top {
        top: calc(10px + max(var(--safe-area-inset-top), 0px)) !important;
    }
    
    .ios-fullscreen-map .leaflet-right {
        right: calc(10px + max(var(--safe-area-inset-right), 0px)) !important;
    }
    
    .ios-fullscreen-map .leaflet-bottom {
        bottom: calc(10px + max(var(--safe-area-inset-bottom), 0px)) !important;
    }
    
    .ios-fullscreen-map .leaflet-left {
        left: calc(10px + max(var(--safe-area-inset-left), 0px)) !important;
    }
}


/* ----------------------- Print styles -------------------- */
@media print {
    .leaflet-control-container,
    .bottom-bar,
    .activate-interaction-btn,
    #click_message,
    .mobile-popup-container {
        display: none !important;
    }
    
    #map,
    #map-container {
        width: 100% !important;
        height: 100% !important;
        position: static !important;
    }
}
