
/* Main layout styles */
.main {
    display: flex;
    height: 100vh;
    margin: 0;
    padding: 20px;
    background-color: #FFFFFF;
}

.right-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 15px;
}

.map-container {
    position: relative;
    width: 100%;
    height: 550px;
    margin-top: 20px;
    margin-bottom: 20px;
}

#map,
#katalog-mapbox,
.gpx-mapbox__canvas {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Elevation profile container styles */
#elevation-profile {
    width: 100%;
    height: 250px;
    /* margin-top: 20px; */
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.route-info {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    min-height: 250px;
}

.stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-item i {
    color: #4d7a2b;
    font-size: 1.2em;
}

.route-title {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    /* margin-top: 20px; */
}

.route-description {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.map-container--mapbox {
    position: relative;
}

.map-container--mapbox .gpx-mapbox__canvas {
    background: #f3f4f6;
    overflow: hidden;
}

.gpx-mapbox__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 16px;
    border-radius: 8px;
    pointer-events: auto;
    z-index: 3;
}

.gpx-mapbox__preview {
    border: none;
    background: transparent;
    cursor: pointer;
    color: #111827;
    font: inherit;
    padding: 0;
}

.gpx-mapbox__preview img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    filter: brightness(0.92);
    transition: filter 0.2s ease;
}

.gpx-mapbox__preview:hover img,
.gpx-mapbox__preview:focus-visible img {
    filter: brightness(1);
}

.gpx-mapbox__preview-label {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.75);
    color: #fff;
    font-weight: 600;
}

.map-container--mapbox .gpx-mapbox__loader,
.map-container--mapbox .gpx-mapbox__error {
    background: rgba(255, 255, 255, 0.92);
    color: #111827;
    font-weight: 600;
    font-size: 16px;
}

.map-container--mapbox .gpx-mapbox__error {
    background: rgba(248, 113, 113, 0.92);
    color: #7f1d1d;
}

.gpx-mapbox__marker,
.gpx-mapbox__poi-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transform: translateY(-12px);
}

.gpx-mapbox__poi-marker {
    cursor: pointer;
}

.gpx-mapbox__marker img,
.gpx-mapbox__poi-marker img,
.gpx-mapbox__poi-marker svg {
    width: 32px;
    height: 32px;
    display: block;
}

.gpx-mapbox__controls {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    min-width: 240px;
    font: 600 13px/1.4 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    display: grid;
    gap: 10px;
}

.gpx-mapbox__controls-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.gpx-mapbox__button {
    border: 1px solid rgba(156, 163, 175, 0.5);
    background: #fff;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font: inherit;
}

.gpx-mapbox__button i {
    font-size: 14px;
    line-height: 1;
}

.gpx-mapbox__button-label {
    line-height: 1;
}

.gpx-mapbox__button:hover:not(:disabled) {
    background: #f3f4f6;
}

.gpx-mapbox__button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.gpx-mapbox__select,
.gpx-mapbox__slider {
    font: inherit;
}

.gpx-mapbox__select {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(156, 163, 175, 0.5);
    background: #fff;
}

.gpx-mapbox__follow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.gpx-mapbox__camera {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.gpx-mapbox__slider {
    flex: 1 1 auto;
    min-width: 140px;
}

.mapboxgl-popup-content {
    font: 14px/1.4 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.mapboxgl-popup h3 {
    margin: 0 0 6px;
    font-size: 16px;
}

.mapboxgl-popup p {
    margin: 0;
}

/* Minimal Mapbox GL layout fallback (ensures map renders even if CDN CSS fails) */
.mapboxgl-map {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
    font: 12px/20px "Helvetica Neue", Arial, Helvetica, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

.mapboxgl-canary {
    position: absolute;
    visibility: hidden;
    width: 0;
    height: 0;
}

.mapboxgl-canvas,
.mapboxgl-canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.mapboxgl-control-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.mapboxgl-ctrl-top-left,
.mapboxgl-ctrl-top-right,
.mapboxgl-ctrl-bottom-left,
.mapboxgl-ctrl-bottom-right {
    position: absolute;
    pointer-events: none;
    z-index: 2;
}

.mapboxgl-ctrl-top-left { top: 0; left: 0; }
.mapboxgl-ctrl-top-right { top: 0; right: 0; }
.mapboxgl-ctrl-bottom-left { bottom: 0; left: 0; }
.mapboxgl-ctrl-bottom-right { bottom: 0; right: 0; }

.mapboxgl-ctrl {
    pointer-events: auto;
    box-sizing: border-box;
}

.mapboxgl-marker {
    position: absolute;
    left: 0;
    top: 0;
    will-change: transform;
}

.mapboxgl-popup {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform-origin: bottom center;
    pointer-events: none;
    z-index: 3;
}

.mapboxgl-popup-content {
    pointer-events: auto;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    padding: 10px 12px;
}

.mapboxgl-popup-tip {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #fff;
}

.mapboxgl-touch-pan-blocker,
.mapboxgl-scroll-zoom-blocker {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 10px;
    text-align: center;
    color: #111827;
    font-weight: 600;
    pointer-events: none;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.custom-map-control-button {
    background-color: #fff;
    border: 0;
    border-radius: 8px;
    box-shadow: 0 1px 4px -1px rgba(0, 0, 0, 0.3);
    margin: 10px;
    padding: 0 0.5em;
    font: 400 18px Roboto, Arial, sans-serif;
    overflow: hidden;
    height: 40px;
    cursor: pointer;
}

.custom-map-control-button:hover {
    background: #ebebeb;
}

#street-view {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

#close-street-view {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #79AB2B;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    z-index: 1001;
}

#close-street-view:hover {
    opacity: 0.9;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .map-container {
        height: 400px;
    }
    
    #elevation-profile {
        height: 150px;
    }
    
    .stats {
        gap: 10px;
    }
}

/* Info window styles */
.info-window {
    max-width: 350px;
    padding: 15px;
}

.info-window h4 {
    text-align: center;
    margin: 0;
    color: #333333;
    font-size: 18px;
}

.info-window img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 10px auto;
    border-radius: 4px;
}

.info-window p {
    font-size: 14px;
    color: #555555;
    line-height: 1.5;
    margin: 0;
}

.info-window .buttons {
    text-align: center;
    margin-top: 10px;
}

.info-window .btn {
    background-color: #79AB2B;
    color: #fff;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    margin: 0 5px;
    transition: background-color 0.3s ease;
}

.info-window .btn:hover {
    background-color: #D3D3D3;
}

/* Street View container styles */
#street-view {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    z-index: 1000;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

#close-street-view {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #79AB2B;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    z-index: 1001;
}

#close-street-view:hover {
    background-color: #D3D3D3;
}

.infowindow-bottom, .infowindow-top {
    position: absolute;
    bottom: auto;
    padding: 15px;
    top: 0px;
    left: 0;
    right: 0px;
}

/* Gallery grid on GPX page */
.gallery-container {
    margin-top: 40px;
}

.gallery-header {
    text-align: center;
    margin-bottom: 30px;
}

.gallery-header h2 {
    margin-bottom: 12px;
    font-size: 28px;
}

.gallery-row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -12px;
    margin-right: -12px;
}

.gallery-col {
    padding: 12px;
    width: 100%;
    display: flex;
}

@media (min-width: 576px) {
    .gallery-col {
        width: 50%;
    }
}

@media (min-width: 992px) {
    .gallery-col {
        width: 33.333%;
    }
}

.gallery-card {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.gallery-card .feature-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.gallery-thumb {
    display: inline-block;
}

.gallery-img-wrapper {
    display: block;
}

.gallery-img {
    max-width: 100%;
    height: auto;
}

.gallery-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 10px 0;
}

.gallery-actions a {
    color: inherit;
}

.gallery-description {
    margin-top: auto;
}
