/* Oxbow Field Area Map Styles */

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: Arial, sans-serif;
    background-color: #f8f9fa;
}

body {
    display: flex;
    flex-direction: column;
}

#map {
    width: 100%;
    height: 100%;
}

.header {
    background: linear-gradient(135deg, #1e5631, #3498db);
    color: white;
    padding: 15px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 300;
}

.header p {
    margin: 5px 0 0 0;
    opacity: 0.9;
    font-size: 14px;
}

.main-container {
    display: flex;
    flex: 1;
    min-height: 0;
}

.actions-bar {
    flex: 0 0 250px;
    background-color: #f5f5f5;
    border-right: 2px solid #ddd;
    padding: 20px;
    overflow-y: auto;
}

.actions-bar h3 {
    margin-top: 0;
    color: #333;
    font-size: 16px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

.action-section {
    margin-bottom: 25px;
}

.action-button {
    display: block;
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 8px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.action-button:hover {
    background-color: #2980b9;
}

.action-button.secondary {
    background-color: #95a5a6;
}

.action-button.secondary:hover {
    background-color: #7f8c8d;
}

.filter-group {
    margin-bottom: 15px;
}

.filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
    font-size: 13px;
}

.filter-group select, .filter-group input {
    width: 100%;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 13px;
    box-sizing: border-box;
}

.filter-group input + input {
    margin-top: 6px;
}

.map-container {
    flex: 2;
    position: relative;
    height: 100%;
}

.info-panel {
    flex: 0 0 350px;
    padding: 20px;
    background-color: #f5f5f5;
    overflow-y: auto;
    border-left: 2px solid #ddd;
    display: flex;
    flex-direction: column;
}

.info-panel h2 {
    margin-top: 0;
    color: #333;
    font-size: 18px;
    margin-bottom: 15px;
}

.info-content {
    background: white;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 15px;
}

.info-content h3 {
    margin: 0 0 2px 0;
    font-size: 17px;
    font-style: italic;
    color: #333;
}

.info-content .common-name {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 14px;
}

.info-content p {
    margin: 6px 0;
    font-size: 14px;
}

.info-content img {
    display: block;
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    margin-bottom: 12px;
    border-radius: 4px;
}

.info-content a {
    color: #2980b9;
}

.no-selection {
    color: #666;
    font-style: italic;
}

.status-pill {
    display: inline-block;
    padding: 2px 10px;
    margin-bottom: 8px;
    border-radius: 10px;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.data-table-container {
    background: white;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 15px;
    flex: 1;
    min-height: 300px;
}

.data-table-container h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
    font-size: 16px;
}

#observationTable {
    width: 100%;
    height: 250px;
}

/* Status colors. Markers are the stock Leaflet blue pin (hue ~208deg) recolored
   with hue-rotate; the swatch variables below match what each filter renders. */
:root {
    --status-native: #2e9e4f;
    --status-non-native: #e0b020;
    --status-invasive: #e8801c;
    --status-noxious: #d63031;
    --status-not-assessed: #8e9aa0;
}

.marker-native { filter: hue-rotate(280deg) saturate(0.8) brightness(1.1); }
.marker-non-native { filter: hue-rotate(202deg) saturate(0.9) brightness(1.5); }
.marker-invasive { filter: hue-rotate(184deg) saturate(1) brightness(1.25); }
.marker-noxious { filter: hue-rotate(146deg) saturate(2) brightness(0.85); }
.marker-not-assessed { filter: grayscale(1) brightness(1.2); }

/* Hover effects - brighter and less saturated */
.marker-native:hover { filter: hue-rotate(280deg) saturate(0.6) brightness(1.5); }
.marker-non-native:hover { filter: hue-rotate(202deg) saturate(0.7) brightness(1.9); }
.marker-invasive:hover { filter: hue-rotate(184deg) saturate(0.8) brightness(1.65); }
.marker-noxious:hover { filter: hue-rotate(146deg) saturate(1.5) brightness(1.2); }
.marker-not-assessed:hover { filter: grayscale(1) brightness(1.6); }

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 7px;
    font-size: 13px;
    color: #555;
}

.legend-swatch {
    flex: none;
    width: 12px;
    height: 12px;
    margin-right: 8px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.25);
}

.legend-name {
    flex: 1;
}

.export-button {
    margin-top: 10px;
    padding: 8px 15px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.export-button:hover {
    background-color: #2980b9;
}

.stats-box {
    background: white;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 15px;
}

.stats-box h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 14px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 13px;
}

.data-source {
    max-width: 60%;
    text-align: right;
}

.map-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    color: #555;
    font-size: 15px;
    z-index: 1000;
}

.data-note {
    margin: 0;
    color: #777;
    font-size: 12px;
    line-height: 1.5;
}

.data-note a {
    color: #2980b9;
}

/* Autocomplete styles */
.autocomplete-container {
    position: relative;
    width: 100%;
}

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

.suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.suggestion-item .suggestion-common {
    display: block;
    font-size: 12px;
    opacity: 0.7;
}

.suggestion-item:hover {
    background-color: #f0f0f0;
}

.suggestion-item.highlighted {
    background-color: #3498db;
    color: white;
}

.suggestion-item:last-child {
    border-bottom: none;
}

/* Single observation selection ring - separate element */
.selection-ring-marker {
    pointer-events: none !important;
}

.selection-ring {
    width: 35px;
    height: 35px;
    border: 3px solid #ff0000;
    border-radius: 50%;
    pointer-events: none;
    box-sizing: border-box;
    background: transparent;
}

/* Stack the panels on narrow screens */
@media (max-width: 900px) {
    html, body {
        height: auto;
    }

    .main-container {
        flex-direction: column;
    }

    .actions-bar, .info-panel {
        flex: none;
        border: none;
    }

    .map-container {
        flex: none;
        height: 60vh;
        order: -1;
    }
}
