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

.marker-label {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.2);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
}

/* Legend Styles */
.legend {
    position: absolute;
    bottom: 30px;
    left: 30px;
    color: white;
    background-color: rgba(50, 50, 50, 0.35);
    backdrop-filter: blur(2px);
    padding: 10px;
    border-radius: 5px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 1500;
    min-width: 135px;
}

.legend-scroll-container {
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
}

.legend table {
    border-collapse: collapse;
    width: 100%;
}

.legend th,
.legend td {
    padding: 8px 8px;
    /* increased for consistent vertical spacing */
    vertical-align: middle;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.legend th:first-child,
.legend td:first-child {
    text-align: center;
    width: 20px;
    border-bottom: none;
}

.legend th:nth-child(2),
.legend td:nth-child(2) {
    text-align: left;
}

.legend-color-box {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    cursor: pointer;
    transition: opacity 0.2s, background-color 0.2s;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
    vertical-align: middle;
    align-self: center;
    border: none;
    text-decoration: none;
}

.legend td:first-child .legend-color-box {
    display: inline-block;
    margin: 0 auto;
}

.legend th {
    font-size: 12px;
    color: rgb(160, 160, 160);
}

.legend td {
    font-size: 14px;
    color: rgb(255, 255, 255);
}

/* Legend Grouping Styles */
.legend-item-row td:nth-child(2) {
    padding-left: 20px;
}

.legend-color-box.header-box {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.button-container {
    position: relative;
    margin: 35px 0;
}

/* Logo Button (Home Link) */
.logo-btn {
    position: fixed;
    top: 30px;
    left: 30px;
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    text-decoration: none;
}

.logo-btn img {
    height: 60px;
    width: auto;
    transition: transform 0.2s;
}

.logo-btn:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

/* Action Buttons (Continent, Citation) */
.action-btn {
    position: fixed;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
    z-index: 1500;
}

.action-btn:hover {
    transform: scale(1.05);
}

/* Continent Toggle Button Specifics */
#continentToggleBtn {
    top: 40px;
    right: 40px;
}

#continentToggleBtn img {
    width: 50px;
    height: 50px;
    filter: grayscale(0.8);
}

/* Citation Button Specifics */
#citationBtn {
    bottom: 30px;
    right: 30px;
}

#citationBtn img {
    width: 50px;
    height: 50px;
    filter: grayscale(0.8);
}

/* Info Button (Legend) */
.info-button {
    position: absolute;
    bottom: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    background-color: rgba(50, 50, 50, 0.8);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    font-family: monospace;
    font-weight: bold;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: background-color 0.2s;
}

.info-button:hover {
    background-color: rgba(80, 80, 80, 0.9);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: rgba(60, 60, 60, 0.35);
    backdrop-filter: blur(2px);
    color: #fff;
    margin: 0;
    max-height: 500px;
    overflow-y: auto;
    padding: 30px;
    border: 1px solid #444;
    width: 80%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    position: relative;
    font-family: 'Open Sans', sans-serif;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 20px;
}

.close-button:hover,
.close-button:focus {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

.modal h2 {
    margin-top: 0;
    border-bottom: 1px solid #444;
    padding-bottom: 15px;
    margin-bottom: 20px;
    color: #fff;
    font-family: 'Merriweather', serif;
}

.expand-toggle {
    transition: transform 0.2s;
    user-select: none;
    color: #aaa;
}

.expand-toggle:hover {
    color: #fff;
    transform: scale(1.2);
}

.modal h3 {
    color: #fff;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.modal p {
    line-height: 1.6;
    margin-bottom: 15px;
    color: #fff;
}

/* Climate Data Orbs */
.climate-orbs-container {
    position: absolute;
    bottom: 110px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 1501;
    pointer-events: auto;
    background: rgba(60, 60, 60, 0.5);
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s ease;
}

.climate-orb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid transparent;
}

.climate-orb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.climate-orb.active {
    transform: scale(1.3);
    border-color: #fff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.9);
}

.modal ul {
    margin-bottom: 15px;
    padding-left: 20px;
}

.modal li {
    margin-bottom: 5px;
    color: #fff;
}

.modal strong {
    color: #fff;
}

.modal table {
    color: #fff;
}

/* Filter Button */
.filter-button {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    background-color: rgba(50, 50, 50, 0.8);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: background-color 0.2s;
}

.filter-button:hover {
    background-color: rgba(80, 80, 80, 0.9);
}

/* Green text for Crop title */
.text-crop {
    color: #4CAF50;
}

/* Red text for Non-Crop title */
.text-non-crop {
    color: #E57373;
}

.toggle-view-button {
    position: absolute;
    bottom: -10px;
    left: -10px;
    width: 24px;
    height: 24px;
    background-color: rgba(50, 50, 50, 0.8);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: background-color 0.2s;
}

.toggle-view-button:hover {
    background-color: rgba(80, 80, 80, 0.9);
    color: white;
}

.drag-button {
    position: absolute;
    top: -10px;
    left: -10px;
    width: 24px;
    height: 24px;
    background-color: rgba(50, 50, 50, 0.8);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: move;
    font-size: 16px;
    font-weight: bold;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: background-color 0.2s;
    z-index: 1501;
}

.drag-button:hover {
    background-color: rgba(80, 80, 80, 0.9);
}


#legendTitleContent {
    font-size: 14px;
    font-weight: bold;
    color: #e0e0e0;
    text-align: center;
    padding: 10px 0;
}

/* Draggable Legend */
.draggable-legend {
    position: absolute;
    top: 100px;
    right: 20px;
    min-width: 175px;
    background-color: rgba(60, 60, 60, 0.35);
    backdrop-filter: blur(2px);
    color: white;
    padding: 0;
    border-radius: 5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: none;
}

.legend-header {
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: bold;
    cursor: move;
    border-radius: 5px 5px 0 0;
    text-align: center;
}

#continentLegendBody {
    width: 100%;
    border-collapse: collapse;
    padding: 5px;
}

#continentLegendBody td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#continentLegendBody tr:last-child td {
    border-bottom: none;
}

/* Legend Title Initial State */
#legendTitleContent {
    display: none;
}



/* Crop Statistics Initial State */
#crop-statistics {
    display: none;
}

/* ... existing code ... */



#citationModal .modal-content {
    max-width: 700px;
}

#citationModal h2 {
    margin-bottom: 20px;
}

.citation-box {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 2px;
    border-radius: 5px;
    font-family: monospace;
    font-size: 10px;
    color: #e0e0e0;
}

.citation-box p {
    margin: 4px 0;
}

.citation-box a {
    color: #4CAF50;
    text-decoration: none;
}

.citation-box a:hover {
    text-decoration: underline;
}

/* Control Panel */
.control-panel {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    gap: 15px;
    background: rgba(60, 60, 60, 0.5);
    padding: 10px 20px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.control-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.control-btn:active {
    transform: translateY(0);
}

.control-btn.active {
    background: rgba(76, 175, 80, 0.2);
    border-color: #4CAF50;
    color: #4CAF50;
}

.btn-icon {
    font-size: 14px;
}