/* Modal Styles */
.modal {
    display: none;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow: auto;
}

.modal-content {
    display: inline-block;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    max-width: 90%;
    max-height: 90%;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.thumbnail-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.thumbnail-container div {
    text-align: center;
}

.thumbnail-container p {
    margin: 0;
    font-weight: bold;
}

.thumbnail-container img {
    height: 300px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.thumbnail-container img:hover {
    border-color: #007BFF;
}

/* Main page map display */
.selected-map {
    text-align: center;
    margin-top: 20px;
}

.selected-map img {
    max-width: 100%;
    height: auto;
    display: none;
}

#image-display-area {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
}

#main-image {
    max-width: 100%;
    height: auto;
    display: none;
}

#scroll-left,
#scroll-right {
    background: rgba(255, 255, 255, 0.8);
    border: none;
    cursor: pointer;
    padding: 5px;
    font-size: 16px;
    z-index: 10;
    display: none;
}

#thumbnail-container {
    display: flex;
}

#thumbnail-container::-webkit-scrollbar {
    display: none; /* Hide scrollbar for a cleaner look */
}

#thumbnail-container {
    display: flex;
    /* overflow-x: hidden; */
    white-space: nowrap;
    gap: 10px;
    max-width: 100%;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.thumbnail-item {
    text-align: center;
    width: 120px;
}

.thumbnail-label {
    font-size: 12px;
    margin-top: 5px;
    color: #333;
}

#thumbnail-container img {
    width: 125px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

#thumbnail-container img:hover,
#thumbnail-container img.selected {
    border-color: #007BFF;
}

/* Additional styles for tabs and dropdown menus */
.tab-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 20px;
}

.tab {
    flex-grow: 1;
    display: flex;
    position: relative;
    margin-right: 5px;
}

.tab:last-child {
    margin-right: 0;
}

.tab-button {
    background-color: #002060;
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: bold;
    flex-grow: 1;
    padding: 10px 0;
    text-align: center;
    border-radius: 5px 5px 0 0;
}

.tab-button:hover {
    background-color: #333;
    color: #fff;
}

/* Special style for the "Map Domain" tab */
.map-domain-tab {
    background-color: #B22222; /* Red background for the "Map Domain" tab */
}

/* Dropdown menu styles */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #333;
    width: 300px;
    border-radius: 0 0 5px 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 100;
    padding: 10px;
    transition: left 0.2s ease, right 0.2s ease;
}

/* Align dropdown to the right if close to the viewport edge */
.tab:hover .dropdown-menu {
    display: block;
}

.tab-container .tab:last-child .dropdown-menu {
    right: 0;
    left: auto;
}

.group-title {
    font-weight: bold;
    color: white;
    background-color: #444;
    padding: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-link {
    color: #aaa;
    font-size: 12px;
    text-decoration: none;
}

.info-link:hover::after {
    content: attr(title);
    position: absolute;
    left: 100%;
    margin-left: 10px;
    padding: 5px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    white-space: nowrap;
    border-radius: 3px;
    font-size: 12px;
    z-index: 999;
}

/* Style for the info tooltip */
.info-tooltip {
    color: #aaa;
    font-size: 12px;
    position: relative;
    cursor: pointer;
}

/* Tooltip box styling */
.info-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -67px;
    left: 50%;
    transform: translateX(-100%);
    background-color: #f9f9a9;
    color: #333;
    padding: 5px;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    white-space: normal;
    font-size: 12px;
    line-height: 1.2;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    width: 200px;
    text-align: left;
}

/* Show tooltip on hover */
.info-tooltip:hover::after {
    opacity: 1;
    bottom: -67px;
}

.element-items {
    padding: 8px;
    color: #87ceeb;
    font-size: 14px;
    background-color: #555;
}

.element-items:link {
    color: #87ceeb;
    text-decoration: none;
}

.element-items:link:hover {
    color: white;
    transition: color 0.3s;
}

.element-items:link:visited {
    color: inherit;
}

.element-items span:hover {
    color: white;
    transition: color 0.3s;
}