html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: sans-serif;
}

#map {
    height: calc(90vh - 60px);
    width: 100%;
}

/* Make orthophoto tiles render seamlessly */
.seamless-tiles img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.leaflet-tile-container img {
    image-rendering: -webkit-optimize-contrast;
}

.controls {
    padding: 10px 15px;
    background: #f8f8f8;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    position: relative;
    overflow: visible;
}

/* Right-aligned header icons group */
.header-icons {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

/* Common style for all header icon buttons */
.header-icon-btn {
    height: 28px;
    padding: 0 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, opacity 0.3s;
}

.header-icon-btn:hover {
    opacity: 0.85;
}

/* Table button - green */
.table-btn {
    background: #4CAF50;
    color: white;
    min-width: 28px;
}

.table-btn:hover {
    background: #45a049;
}

.table-btn svg {
    display: block;
}

/* Info button - blue */
.info-btn {
    background: #3182bd;
    color: white;
    min-width: 28px;
}

.info-btn:hover {
    background: #2571a3;
}

.info-btn svg {
    display: block;
}

/* Language button - blue */
.lang-btn {
    background: #3182bd;
    color: white;
    font-weight: bold;
    font-size: 12px;
    padding: 0 12px;
}

.lang-btn:hover {
    background: #2571a3;
}

/* Legacy lang-toggle style - keep for compatibility */
.lang-toggle {
    padding: 5px 12px;
    background: #3182bd;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s;
}

.lang-toggle:hover {
    background: #2571a3;
}

.bottom-controls {
    padding: 10px 15px;
    background: #f8f8f8;
    border-top: 1px solid #ddd;
    display: flex;
    align-items: center;
    gap: 15px;
}

.period-select {
    width: 140px;
    flex-shrink: 0;
    padding: 6px 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: white;
    cursor: pointer;
}

.period-select:hover {
    border-color: #999;
}

.period-select:focus {
    outline: none;
    border-color: #3182bd;
    box-shadow: 0 0 3px rgba(49, 130, 189, 0.3);
}

.bottom-controls label {
    font-weight: bold;
    flex-shrink: 0;
}

.bottom-controls .legend {
    margin-left: auto;
    flex-shrink: 0;
}

#dateRangeDisplay {
    min-width: 200px;
    font-size: 14px;
    color: #333;
}

#dateRangeDisplay.empty-period {
    color: #999;
    font-style: italic;
}

.slider-container {
    flex: 1;
    max-width: 600px;
    position: relative;
    height: 30px;
}

.date-slider {
    position: absolute;
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: transparent;
    outline: none;
    pointer-events: none;
}

.date-slider:first-child {
    background: linear-gradient(to right, #ddd 0%, #ddd 100%);
    pointer-events: auto;
}

.date-slider::-webkit-slider-runnable-track {
    height: 6px;
    background: transparent;
}

.date-slider::-moz-range-track {
    height: 6px;
    background: transparent;
}

.date-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3182bd;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    pointer-events: auto;
    margin-top: -7px;
}

.date-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3182bd;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    pointer-events: auto;
}

#endDateSlider::-webkit-slider-thumb {
    background: #e6550d;
}

#endDateSlider::-moz-range-thumb {
    background: #e6550d;
}

.date-slider:hover::-webkit-slider-thumb {
    transform: scale(1.1);
}

.date-slider:hover::-moz-range-thumb {
    transform: scale(1.1);
}

.controls label {
    margin-right: 5px;
    font-weight: bold;
}

/* Autocomplete wrapper */
.autocomplete-wrapper {
    position: relative;
    display: inline-block;
    margin-right: 15px;
    overflow: visible;
}

.autocomplete-input {
    padding: 5px 25px 5px 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
    min-width: 200px;
    box-sizing: border-box;
}

.autocomplete-input:focus {
    outline: none;
    border-color: #3182bd;
    box-shadow: 0 0 3px rgba(49, 130, 189, 0.3);
}

.autocomplete-clear {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    font-size: 16px;
    cursor: pointer;
    padding: 0 5px;
    display: none;
}

.autocomplete-clear:hover {
    color: #333;
}

.autocomplete-wrapper.has-value .autocomplete-clear {
    display: block;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 3px 3px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 1000;
    display: none;
}

.autocomplete-dropdown.show {
    display: block;
}

.autocomplete-item {
    padding: 8px 10px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background: #f0f7fc;
}

.autocomplete-item mark {
    background: #c8e6c9;
    font-weight: bold;
    padding: 0;
}

.autocomplete-no-results {
    padding: 8px 10px;
    color: #999;
    font-style: italic;
}

.controls select {
    margin-right: 15px;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
}

.layer-selector {
    display: inline-block;
    margin-right: 20px;
}

.layer-selector label {
    margin-right: 5px;
}

.layer-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.radio-label {
    margin-right: 15px;
    font-weight: normal;
    cursor: pointer;
}

.radio-label input[type="radio"] {
    margin-right: 3px;
    cursor: pointer;
}

.legend {
    display: inline-block;
    margin-left: 30px;
    padding: 5px 12px;
    background: white;
    border: 1px solid #999;
    border-radius: 4px;
    font-size: 13px;
    vertical-align: middle;
}

.legend-title {
    font-weight: bold;
    margin-right: 10px;
}

.legend-label {
    margin-right: 15px;
}

.legend-color {
    display: inline-block;
    width: 30px;
    height: 15px;
    margin-right: 5px;
    margin-left: 5px;
    border: 1px solid #999;
    vertical-align: middle;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    border-radius: 8px;
    width: 90%;
    max-width: 900px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    position: relative;
}

/* Draggable modal state */
.modal-content.draggable {
    position: absolute;
    margin: 0;
}

/* Modal header - drag handle */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    cursor: move;
    user-select: none;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    margin-bottom: 10px;
}

.modal-header h2 {
    margin: 0;
    flex: 1;
    color: #333;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    margin-left: 15px;
    flex-shrink: 0;
}

.close:hover,
.close:focus {
    color: #000;
}

/* Info modal content */
.info-modal-content {
    max-width: 80vw;
}

.info-modal-content #infoBody {
    line-height: 1.6;
}

.info-modal-content #infoBody p {
    margin: 10px 0;
}

.info-modal-content #infoBody hr {
    margin: 15px 0;
    border: none;
    border-top: 1px solid #ddd;
}

.info-modal-content #infoBody a {
    color: #3182bd;
    text-decoration: none;
}

.info-modal-content #infoBody a:hover {
    text-decoration: underline;
}


/* Info credits two-column layout */
.info-credits-row {
    display: flex;
    gap: 30px;
    margin-top: 15px;
}

.info-credits-left {
    flex: 0 0 auto;
}

.info-credits-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.info-credits-right p {
    margin: 3px 0;
    text-align: right;
}


/* Workgroup list styling */
.workgroup-list {
    list-style: none;
    padding-left: 0;
    margin: 10px 0;
    columns: 2;
    column-gap: 30px;
    max-width: 400px;
}

.workgroup-list li {
    margin-bottom: 5px;
    break-inside: avoid;
}

/* Info modal logos */
.info-logos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.info-logo {
    height: 40px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.info-logo:hover {
    opacity: 1;
}

/* Map toast notification for restricted species */
.map-toast {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.map-toast.visible {
    opacity: 1;
}

/* Modal table styles */
.modal-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 14px;
}

.modal-table th {
    background: #f0f0f0;
    padding: 10px 8px;
    text-align: left;
    border: 1px solid #ddd;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
}

.modal-table th:hover {
    background: #e0e0e0;
}

.modal-table th.sortable::after {
    content: ' ⇅';
    opacity: 0.3;
}

.modal-table th.sorted-asc::after {
    content: ' ▲';
    opacity: 1;
}

.modal-table th.sorted-desc::after {
    content: ' ▼';
    opacity: 1;
}

.modal-table td {
    padding: 8px;
    border: 1px solid #ddd;
}

/* All numeric columns - center aligned */
.modal-table td, .modal-table th {
    text-align: center;
}

/* First one or two columns (names) - left aligned */
.modal-table td.vernacular-name,
.modal-table td.scientific-name,
.modal-table td.observer-name {
    text-align: left;
}
.modal-table th.vernacular-name,
.modal-table th.scientific-name,
.modal-table th.observer-name {
    text-align: left;
}
.modal-table td.scientific-name {
    font-style: italic;
}

.modal-table tbody tr:hover {
    background: #f9f9f9;
}

.modal-table .filter-input {
    width: calc(100% - 10px);
    max-width: 150px;
    padding: 3px 5px;
    margin-left: 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 11px;
    font-weight: normal;
    display: inline-block;
}

.modal-table .filter-input:focus {
    outline: none;
    border-color: #3182bd;
}

/* Clickable count cells */
.modal-table td.count-link {
    color: #3182bd;
    cursor: pointer;
}

.modal-table td.count-link:hover {
    color: #08519c;
    font-weight: bold;
}

/* Totals row */
.modal-table tfoot .totals-row {
    background: #f0f0f0;
    border-top: 2px solid #999;
}

.modal-table tfoot .totals-row td {
    padding-top: 8px;
    padding-bottom: 8px;
}

/* Pagination controls */
.pagination-controls {
    margin-top: 20px;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-top: 1px solid #ddd;
}

.page-btn {
    padding: 5px 12px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
    background: #f0f0f0;
    border-color: #999;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-info {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

#pageSelect {
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
    cursor: pointer;
}

#pageSelect:focus {
    outline: none;
    border-color: #3182bd;
}

/* Detail modal - all columns left-aligned */
#detailModal .modal-table td,
#detailModal .modal-table th {
    text-align: left;
}

/* PlutoF link styling */
.plutof-link {
    color: #3182bd;
    text-decoration: none;
}

.plutof-link:hover {
    text-decoration: underline;
    color: #08519c;
}
.lighttitle{
    font-weight: lighter;     
}