.compact-popup {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 500px;
    padding: 10px;
    background: #fff;
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    font-size: 1em;
    line-height: 1.3;
    color: #212529;
}

.compact-popup .avatar {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

/* Sisältö */
.compact-popup .content {
    flex: 1;
}

.compact-popup .content h5 {
    margin: 0 0 4px 0;
    font-size: 1.1em;
}

.compact-popup .content p {
    margin: 2px 0;
    font-size: 1.05em;
}

.compact-popup .content a.person-name,
.person-header a.person-name {
    text-decoration: none;
    color: #0d6efd;
    font-weight: 600;
}

.compact-popup .short-description {
    margin-top: 4px;
    color: #495057;
}

.person-header {
    background-color: rgba(255, 255, 255, 0.85); /* light semi-transparent */
    color: #222; /* dark text for readability */
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.2;
    margin-bottom: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); /* subtle floating effect */
}

/* --- Responsiivisuus mobiilille --- */
@media (max-width: 768px) {
    .compact-popup {
        flex-direction: column;
        max-width: 95vw;
        font-size: 1em;
        padding: 12px;
    }

    .compact-popup .avatar {
        width: 100%;
        height: auto;
        border-radius: 8px;
        margin-bottom: 8px;
    }

    .compact-popup .content {
        width: 100%;
    }
}

/* Desktop: laajempi popup */
@media (min-width: 769px) {
    .compact-popup {
        width: 600px;
        padding: 15px;
        font-size: 1.05em;
    }

    .compact-popup .avatar {
        width: 80px;
        height: 80px;
        border-radius: 50%;
    }

    .compact-popup .content h5 {
        font-size: 1.2em;
    }

    .compact-popup .content p {
        font-size: 1.1em;
    }

    .mapboxgl-popup {
        max-width: 650px !important;
    }
}

/* Timeline popup container */
.popup-content-location {
    display: flex;
    flex-direction: column;
    gap: 8px;              
    padding-left: 2em;      
    width: 450px;            
    box-sizing: border-box;
}

.weather-popup {
    padding-left: 2em;
}

/* Description text */
.location-description p {
    margin: 0;
    line-height: 1.35;
    font-size: 1em;
}

/* Weather section */
.location-weather {
    margin-top: 6px;
}

.location-weather ul {
    margin: 0.25em 0 0 0;
    padding-left: 1.2em;
    font-size: 0.95em;
    list-style-type: disc;     /* optional: bullet points */
}

.location-weather ul li {
    margin-bottom: 4px;
    line-height: 1.35;
}

/* Responsive for mobile */
@media (max-width: 768px) {
    .popup-content-location {
        width: 95vw;          /* almost full screen */
        padding-left: 1em;    /* reduce left indent */
        gap: 6px;
    }

    .location-weather ul {
        padding-left: 1em;
        font-size: 0.9em;
    }
}

.main-location {
    margin-top: 5px;
    padding: 10px;
    border-left: 3px solid #0d6efd; /* blue accent to highlight */
    background-color: #f8f9fa;       /* subtle background */
    border-radius: 6px;
}

.popup-content-location img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
    margin-top: 4px;
    margin-bottom: 4px;
}

.main-location-header {
    font-weight: 600;
    font-size: 1em;
    margin-bottom: 4px;
}

.main-location-header small {
    display: block;
    font-weight: 400;
    color: #6c757d;
    margin-top: 2px;
}

.main-location-description p {
    margin: 0;
    line-height: 1.35;
}

.popup-content-location {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 12px;
    border-left: 3px solid #0d6efd; /* same blue accent */
    background-color: #f8f9fa;
    border-radius: 6px;
    box-sizing: border-box;
    max-width: 450px;
}

.location-header {
    font-weight: 600;
    font-size: 0.98em;
    margin-bottom: 3px;
}

.location-header small {
    display: block;
    font-weight: 400;
    color: #6c757d;
    margin-top: 2px;
}

.location-description p {
    margin: 0;
    line-height: 1.35;
}

.location-weather {
    margin-top: 6px;
}

#map-container {
    position: relative;
}

#map-container #person-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#map-container .person-item {
    display: block;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.5rem;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.15s ease;
}

#map-container .person-item:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

#map-container .person-name {
    font-weight: 600;
    text-decoration: none;
}

#map-container .person-item p {
    margin: 0.25rem 0 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

#map-container .map-indicator {
    margin-left: 0.5rem;
    font-size: 1.1rem;
    opacity: 0.6;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

#map-container .person-item:hover .map-indicator {
    opacity: 1;
    transform: scale(1.1);
}

#map-container #side-panel .form-control,
#map-container #side-panel .form-select {
    max-width: 100%;
    font-size: 0.85rem;
}

#map-container #side-panel label {
    font-size: 0.8rem;
    margin-bottom: 0.2rem;
}

#map-container #side-panel .mb-2 {
    margin-bottom: 0.5rem;
}

#map-container #side-panel .btn {
    font-size: 0.85rem;
}

#map-container #side-panel #search {
    max-width: 320px;
}

#map-container #side-panel #search form {
    width: 100%;
}

#map {
    flex-grow: 1;
    margin: 1em 0;
}

#side-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 250px;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 5;
    transition: transform 0.3s ease;
    transform: translateX(-100%);
}

/* Wider panel for larger screens */
@media (min-width: 768px) {
    #side-panel {
        width: 300px;
    }
}

@media (min-width: 1200px) {
    #side-panel {
        width: 350px;
    }
}

#panel-content {
    display: none;
    padding: 15px;
    max-height: calc(100% - 50px);
    overflow-y: auto;
}

#toggle-panel {
    position: relative;
    top: 0;
    left: 0;
    z-index: 10;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 5px;
}

@media (min-width: 768px) {
    .mapboxgl-popup-close-button {
        display: none;
    }

    .mapboxgl-popup-content {
        box-shadow: none !important;
    }
}

#side-panel.collapsed {
    width: 0;
}

#side-panel.expanded {
    transform: translateX(0);
}

#side-panel.expanded #panel-content {
    display: block;
}

.person-photo {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); /* Soft shadow */
}

.text-content {
    flex-grow: 1;
}

.text-primary {
    color: #007bff;
}

#map .popup-content p {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.mapboxgl-popup-content {
    padding: 0;
    background: none;
}

.person-name {
    color: blue;
    text-decoration: underline;
    cursor: pointer;
}

.person-name:hover {
    color: darkblue;
    text-decoration: none;
}

.mapboxgl-ctrl-geocoder {
    display: none !important;
}

.mapboxgl-ctrl.mapboxgl-ctrl-group { 
    margin-top: 0;
    margin-right: 0;
}

#map {
    height: 100vh;
    margin: 0;
    margin-bottom: 2em;
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    width: 100%;
    position: relative;
}

.full-width.container-fluid {
    padding-left: 0;
    padding-right: 0;
    margin-top: 0 !important;
}