* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #eae6de;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/*Header styles*/
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: #157759;
    color: white;
}

.bottom-header {
    display: flex;
    padding: 10px;
    background-color: #1e9b75;
    color: white;
}

.buttons {
    display: flex;
    gap: 15px;
}

.buttons a {
    display: inline-block;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.buttons a:hover {
    background-color: #004d33;
}

header .language button {
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
}

.search-gallery-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    width: 100%;
    box-sizing: border-box;
}

.search-container {
    display: flex;
    gap: 10px;
}

.search-bar {
    padding: 8px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.search-button {
    padding: 8px 16px;
    font-size: 16px;
    background-color: #157759;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-button:hover {
    background-color: #004d33;
}

.gallery-button {
    padding: 8px 16px;
    font-size: 16px;
    background-color: #157759;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gallery-button i {
    font-size: 16px;
}

.gallery-button:hover {
    background-color: #004d33;
}

.search-table table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.search-table table th,
.search-table table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.search-table table th {
    background-color: #f5f5f5;
    font-weight: bold;
}

.search-table table tbody tr:hover {
    background-color: #f5f5f5;
    cursor: pointer;
}

/* Highlighted row for search */
.highlight-row {
    background-color: #1e9b75 !important;
    color: white;
}

.pagination {
    margin-top: 20px;
    text-align: center;
}

.pagination button {
    padding: 8px 16px;
    margin: 0 5px;
    cursor: pointer;
    background-color: #157759;
    color: white;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.pagination button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    background-color: #ccc;
    color: #888;
}

/* Overlay for the popup */
.popup {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.popup.show {
    display: flex;
}

.popup-content {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    width: 600px;         /* Fixed width */
    height: 500px;        /* Fixed height */
    max-width: 90vw;
    max-height: 90vh;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hidden {
    display: none;
}

.close-button {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
}

/* Footer Section */
footer {
    flex-shrink: 0;
    background-color: #157759;
    padding: 20px 0;
    text-align: center;
    color: white;
}

.footer-content {
    display: flex;
    justify-content: center; /* Centered layout */
    align-items: center;
    gap: 20px; /* Gap between text and icons */
}

.footer-icons {
    display: flex;
    gap: 15px; /* Gap between icons */
    align-items: center;
}

.footer-icons a {
    display: inline-block;
    transition: transform 0.2s ease;
}

.footer-icons a:hover {
    transform: scale(1.1);
}

.export-buttons {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
    margin-bottom: 15px;
    gap: 15px;
    margin-right: 15px;
}

.export-buttons button {
    padding: 8px 16px;
    font-size: 16px;
    background-color: #157759;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.export-buttons button:hover {
    background-color: #004d33;
}

.search-table table tbody tr {
    background-color: #f9f6f2;
}

.nav-button {
    color: white !important;
    font-size: 2rem;
    background-color: #157759;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin: 0 10px;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
}

.nav-button:hover {
    background-color: #004d33;
}

.nav-button svg {
    width: 64px;
    height: 64px;
    display: block;
}

.gallery-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.gallery-navigation {
    position: absolute;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    gap: 20px;
    width: auto;
}

.sort-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 5px;
    font-size: 14px;
    color: #157759;
}

.sort-btn:hover {
    color: #004d33;
}

.footer-icons.right {
    display: flex;
    justify-content: flex-end;
    gap: 18px;
    margin-top: 8px;
}

.gallery-button i,
.search-button i {
    margin-right: 8px;
}

/* Style for the Legend widget to make it smaller */
.esri-legend {
    max-height: 150px; /* Adjust height as needed */
    overflow-y: auto; /* Add scroll if content exceeds max-height */
    width: 200px; /* Adjust width as needed */
}

/* Contact Page Container */
.contact-page {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    flex: 1;
}

/* Ensure main content takes up space in index.html */
main {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

/* Ensure map container can grow and shrink within main */
#map {
    width: 100%;
    height: 600px; /* Original height, flex-grow will let it expand */
    flex-grow: 1; /* Allow map to take up available space within main */
    flex-shrink: 1; /* Allow map to shrink if needed */
    flex-basis: auto;
}

html, body {
    height: 100%;
    min-height: 100vh;
}

/* Measurement widget button styling */
.esri-measurement .custom-measure-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
}

.esri-measurement .custom-measure-buttons div:first-child {
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

.esri-measurement .custom-measure-buttons button {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: auto;
    min-width: 120px;
    max-width: 200px;
    min-height: 35px;
    padding: 6px 10px;
    margin: 2px 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #f8f8f8;
    color: #333;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.esri-measurement .custom-measure-buttons button:hover {
    background-color: #e8e8e8;
    border-color: #999;
}

.esri-measurement .custom-measure-buttons button:active {
    background-color: #d8d8d8;
}

/* Ensure icons and text are properly spaced */
.esri-measurement .custom-measure-buttons button::before {
    margin-right: 8px;
    font-size: 16px;
}
