@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    font-family: 'Roboto', sans-serif;
    overflow: hidden;
}

#main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background-color: #486474;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#header-left {
    display: flex;
    gap: 10px;
}

#header-center h1 {
    color: white;
    font-size: 2rem;
    font-weight: bold;
    margin: 0;
    text-align: center;
}

#header-right {
    display: flex;
    align-items: center;
}

#header-logo {
    height: 60px;
    width: auto;
}

#map {
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: calc(100% - 80px);
}

#sidebar {
    position: fixed;
    top: 80px;
    left: 0;
    width: 400px;
    height: calc(100vh - 80px);
    background-color: rgba(255, 255, 255, 0.95);
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    border-right: 2px solid #486474;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
}

#sidebar.open {
    transform: translateX(0);
}

.box-header {
    background-color: #486474;
    color: white;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.box-header {
    margin: 0;
    font-size: 1.4rem;
    font-weight: bold;
}

.close-type-button, .mapboxgl-popup-close-button {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 3px;
    border-radius: 3px;
    width: auto;
    height: auto;
}

.close-type-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

#sidebar-content {
    height: calc(100% - 140px);
    overflow-y: auto;
    padding: 10px;
}

.sidebar-image-container {
        position: relative;
        display: inline-block;
    }

.sidebar-number-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(255, 165, 0, 0.85);
    color: white;
    font-size: 0.85em;
    font-weight: bold;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    pointer-events: none;
}

#sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #486474;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 2px solid #3a5360;
}

#sidebar-logo {
    height: 40px;
    width: auto;
}

#points-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.point-item {
    display: flex;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: white;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

.point-item:hover {
    background-color: #f0f8ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.point-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
    margin-right: 10px;
    flex-shrink: 0;
}

.point-number-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(255, 165, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    color: white;
    margin-right: 10px;
    flex-shrink: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.popup-number-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background-color: rgba(255, 165, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 36px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.point-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.point-item-title {
    font-weight: bold;
    color: #486474;
    margin-bottom: 5px;
    font-size: 1rem;
}

.point-item-description {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}
#controlsContainer {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
}

.button {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 60px;
    height: 60px;
    background-color: white;
    color: black;
    text-decoration: none;
    font-size: 20px;
    font-weight: bold;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.button:hover {
    transform: scale(1.1);
    opacity: 0.9;
}

.basemap-icon {
    height: 60px;
    width: 60px;
}

.icon-container:hover::after {
    content: attr(title);
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    white-space: nowrap;
    z-index: 10;
}

#control-panel {
    width: 400px;
    border: 1px solid #ccc;
    border-radius: 10px;
    position: fixed;
    top: 70px;
    left: 0;
    background-color: rgba(255, 255, 255, 0.95);
    z-index: 51;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

#control-panel.open {
    transform: translateX(0);
}

#control-panel p {
    margin: 0;
    padding: 8px 12px;
    font-weight: bold;
    background-color: #1592b5;
    border-radius: 6px 6px 0 0;
    color: #ffffff;
}

.settings-section {
    margin: 20px;
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: hidden;
    background-color: white;
}

.selector-box {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
}

#filter-selector {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    padding: 12px;
}

#filter-setting {
    background-color: rgba(0, 0, 0, 0);
}

#basemap-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 12px;
}

.selector-box input[type="radio"],
.selector-box input[type="checkbox"] {
    display: none;
}

.selector-box label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    text-align: center;
    border: 2px solid #ccc;
    border-radius: 6px;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.selector-box label:has(input[type="radio"]:checked),
.selector-box label:has(input[type="checkbox"]:checked) {
    border-color: #1592b5;
    background-color: rgba(21, 146, 181, 0.15);
}

.selector-box label:hover {
    border-color: #1592b5;
    background-color: rgba(21, 146, 181, 0.05);
}

/* Header buttons styling */
#header-left button {
    height: 40px;
    width: 40px;
    background-color: #1592b5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

#header-left button:hover {
    background-color: #aaadca;
}

#header-left button .fa-solid {
    font-size: 20px;
    color: white;
}

.fa-solid {
    font-size: 26px;
    color: white;
}

#filter-header {
    display: flex;
    justify-content: space-between;
    background-color: #1592b5;
}

#filter-selector, #basemap-selector {
    width: 50%;
}

.filter-icon {
    width: 30px;
    height: 30px;
    cursor: pointer;
    opacity: 0.4
}

input[type="checkbox"]:checked + .filter-icon {
    opacity: 1;
}

label:has(input[type="checkbox"]:checked) {
    border: 2px solid #1592b5;
    border-radius: 5px;
}

.selector-box.multiselect label:hover {
    border-color: #1592b5;
}

.selector-box.multiselect input[type="checkbox"]:checked + label {
    border-color: #1592b5;
    background-color: #aacae2;
    color: white;
}

.selector-box.multiselect label {
    width: 30px;
}

input[type="checkbox"] {
    display: none;
}

.mapboxgl-popup {
    position: fixed !important;
    bottom: 24px !important;
    right: 24px !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    max-width: calc(min(520px, 100vw - 48px)) !important;
    max-height: calc(100vh - 140px);
    transform-origin: bottom right !important;
    width: auto !important;
}

.mapboxgl-popup-content {
    padding: 0;
    width: auto;
    max-width: 100%;
    min-width: min(300px, calc(100vw - 68px));
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin: 0 !important;
    background: #ffffff;
}

.mapboxgl-popup-content *,
.popup-content * {
    max-width: 100%;
    box-sizing: border-box;
    word-break: break-word;
}

.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip,
.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip,
.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip,
.mapboxgl-popup-anchor-top .mapboxgl-popup-tip,
.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip,
.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip,
.mapboxgl-popup-anchor-left .mapboxgl-popup-tip,
.mapboxgl-popup-anchor-right .mapboxgl-popup-tip {
    display: none !important;
}

.popup-content {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
}

.popup-top {
    background-color: #486474;
    padding: 8px 12px;
    border-radius: 12px 12px 0 0;
    color: white;
    min-height: 40px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px;
}

.popup-title {
    margin-bottom: 0;
}

.popup-title strong {
    font-size: 15px;
    display: block;
    line-height: 1.2;
}

.popup-title em {
    font-style: normal;
    opacity: 0.9;
    font-size: 13px;
    line-height: 1.2;
    display: block;
}

.popup-bottom {
    display: flex;
    gap: 8px;
}

.links-container {
    flex: 0.5;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    line-height: 1.5;
    color: #4a4a4a;
    font-size: 14px;
}

.popup-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: flex-start;
    width: 100%;
    margin: 10px;
}

.popup-middle, .links-container, .image-carousel {
    border: none;
    margin-bottom: 8px;
    padding: 12px;
    background: none;
    border-bottom: 1px solid #e0e0e0;
}

.popup-middle {
    max-height: 150px;
    overflow-y: auto;
    line-height: 1.5;
    color: #4a4a4a;
    font-size: 14px;
}

.icon-container {
    position: relative;
    width: 32px;
    height: 32px;
    cursor: pointer;
}

.map-icon-container {
    position: relative;
    width: 36px;
    height: 36px;
    cursor: pointer;
    margin: 5px;
}

.icon-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.image-carousel {
    display: flex;
    flex: 3;
    overflow: hidden;
    position: relative;
    width: 100%;
    padding: 12px;
}

.image-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    position: relative;
}

.map-icons {
    display: flex;
}

.popup-image {
    width: 100%;
    height: auto;
    max-height: 300px;
    border-radius: 4px;
    object-fit: cover;
}

.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: background-color 0.3s;
}

.left-button {
    left: 10px;
}

.right-button {
    right: 10px;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    position: relative;
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    z-index: 1001;
}

.modal-content img {
    max-width: 90%;
    max-height: 80vh;
    display: block;
    margin: 0 auto;
}
  
@media (max-width: 768px) {
    #main-header {
        height: 60px;
        padding: 0 10px;
    }
    
    #header-center h1 {
        font-size: 1.2rem;
    }
    
    #header-logo {
        height: 40px;
    }
    
    #header-left {
        display: flex;
        gap: 5px;
        flex-wrap: wrap;
    }
    
    #header-left button {
        height: 30px;
        width: 30px;
    }
    
    #header-left button .fa-solid {
        font-size: 14px;
    }
    
    #map {
        margin-top: 60px;
    }
    
    #sidebar {
        top: 60px;
        height: calc(100vh - 60px);
        width: 100vw;
    }
    
    #sidebar-content {
        height: calc(100% - 140px);
    }
}

.no-images-message {
    text-align: center;
    color: #666;
    padding: 12px;
    font-style: italic;
    margin: 0;
}

.mapboxgl-popup-close-button {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 1;
}

.links-container p {
    margin: 0;
}

#reset-filters-button {
    padding: 8px;
    background-color: #1592b5;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

#reset-filters-button:hover {
    background-color: #127a99;
}

#language-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 12px;
}

#language-selector label {
    width: 90%;
    padding: 10px;
}

.filter-icon {
    width: 24px;
    height: 24px;
    margin-top: 4px;
    display: flex;
    gap: 8px;
}

#sidebar-header h2 {
    font-size: 1.2rem;
}