/* Desktop stilovi */
body {
    overflow-x: hidden;
}

.desktop-layout {
    float: left;
    width: 30%;
    height: calc(100vh - 200px);
    min-height: 600px;
    padding-right: 15px;
}

.locations-sidebar {
    height: 100%;
    overflow-y: auto;
    padding-right: 10px;
}

.locations-sidebar::-webkit-scrollbar {
    width: 8px;
}

.locations-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.locations-sidebar::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.locations-sidebar::-webkit-scrollbar-thumb:hover {
    background: #555;
}

#map {
    float: right;
    width: 69%;
    height: calc(100vh - 200px);
    min-height: 600px;
    border-radius: 8px;
}

.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

.lokacija-card {
    transition: all 0.2s;
    cursor: pointer;
    margin-bottom: 15px;
    border-left: 4px solid transparent;
}

.lokacija-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    border-left-color: #007bff;
}

.lokacija-card.active {
    border-left-color: #28a745;
    background-color: #f8f9fa;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.udaljenost-badge {
    font-size: 1.1em;
    padding: 8px 12px;
}

.loading-spinner {
    display: none;
}

.loading-spinner.active {
    display: block;
}

.current-location-marker {
    background-color: #007bff;
    border: 3px solid white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
}

/* Mobilni layout - Google Maps stil */
@media (max-width: 768px) {
    body {
        overflow: hidden !important;
    }

    /* Sakrij footer na mobilnom */
    footer {
        display: none !important;
    }

    .navbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        margin-bottom: 0 !important;
    }

    .desktop-layout {
        display: none !important;
    }

    .clearfix::after {
        display: none !important;
    }

    #map {
        position: fixed !important;
        top: 85.56px !important; /* Visina navbara */
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        border-radius: 0 !important;
        margin: 0;
        z-index: 1;
        float: none !important;
    }

    .container {
        padding: 0;
    }

    .desktop-header, #statusMessage, #currentLocationInfo {
        display: none !important;
    }

    /* Sakrij sve section elemente osim onog sa mapom */
    section:not(:has(#map)) {
        display: none !important;
    }

    /* Ili alternativno, sakrij container koji drži naslov */
    .pt-13 {
        display: none !important;
    }

    /* Bottom sheet container */
    .bottom-sheet {
        position: fixed;
        bottom: 30px;
        left: 0;
        right: 0;
        background: transparent;
        border-radius: 20px 20px 0 0;
        z-index: 1001;
        transition: transform 0.3s ease;
    }

    .bottom-sheet.collapsed {
        transform: translateY(calc(100% - 120px));
    }

    /* Handle za drag */
    .bottom-sheet-handle {
        width: 40px;
        height: 4px;
        background: #ccc;
        border-radius: 2px;
        margin: 12px auto;
        cursor: pointer;
    }

    /* Horizontal scroll container */
    .locations-slider {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 12px;
        padding: 16px;
        scrollbar-width: none; /* Firefox */
    }

    .locations-slider::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Edge */
    }

    /* Slider kartica */
    .slider-card {
        flex: 0 0 85%;
        scroll-snap-align: center;
        background: white;
        border: 1px solid #e0e0e0;
        border-radius: 12px;
        padding: 16px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        transition: transform 0.2s;
        cursor: pointer;
    }

    .slider-card:active {
        transform: scale(0.98);
    }

    .slider-card.active {
        border: 2px solid #007bff;
        box-shadow: 0 4px 12px rgba(0,123,255,0.2);
    }

    .slider-card-header {
        display: flex;
        justify-content: space-between;
        align-items: start;
        margin-bottom: 12px;
    }

    .slider-card-title {
        font-size: 16px;
        font-weight: 600;
        color: #333;
        margin: 0;
        flex: 1;
    }

    .slider-card-badge {
        background: #007bff;
        color: white;
        border-radius: 12px;
        padding: 4px 10px;
        font-size: 12px;
        font-weight: 600;
        margin-left: 8px;
    }

    .slider-card-distance {
        background: #28a745;
        color: white;
        border-radius: 10px;
        padding: 8px 16px;
        font-size: 12px;
        font-weight: 600;
        display: inline-block;
        margin-top: 8px;
    }

    .slider-card-coords {
        font-size: 12px;
        color: #666;
        margin-top: 8px;
    }

    /* Scroll indicators */
    .scroll-indicator {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(0,0,0,0.5);
        color: white;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 10;
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.3s;
    }

    .scroll-indicator.show {
        opacity: 1;
    }

    .scroll-indicator.left {
        left: 8px;
    }

    .scroll-indicator.right {
        right: 8px;
    }

    /* Status info na mapi */
    .map-status-overlay {
        position: fixed;
        top: 70px;
        left: 50%;
        transform: translateX(-50%);
        background: white;
        padding: 12px 20px;
        border-radius: 20px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.2);
        z-index: 1002;
        font-size: 14px;
        max-width: 90%;
    }

    .map-status-overlay.success {
        background: #d4edda;
        color: #155724;
    }

    .map-status-overlay.info {
        background: #d1ecf1;
        color: #0c5460;
    }
}

/* Desktop - sakrivanje mobilnih elemenata */
@media (min-width: 769px) {
    .bottom-sheet, .map-status-overlay {
        display: none !important;
    }

    .desktop-header {
        margin-bottom: 20px;
    }

    #statusMessage, #currentLocationInfo {
        margin-bottom: 20px;
    }
}
