/* NOAA OI SST V2 Anomaly Styles */

/* Anomaly Legend Container Styles */
.marine-anomaly-legend-container {
    background: var(--dark-panel);
    color: var(--text-light) !important;
    border-radius: var(--border-radius) !important;
    box-shadow: var(--shadow) !important;
    border-left: 4px solid var(--primary-color) !important;
    padding: 15px !important;
    z-index: 9999 !important;
    font-family: var(--font-family-primary) !important;
    min-width: 200px !important;
    max-width: 300px !important;
    font-size: 0.9rem !important;
    transition: all var(--transition-speed) ease !important;
}

/* Light theme support */
body.light-theme .marine-anomaly-legend-container {
    background: var(--light-panel) !important;
    color: var(--text-dark) !important;
    border-left: 4px solid var(--primary-color) !important;
    box-shadow: var(--shadow) !important;
}

/* Header styling */
.marine-anomaly-legend-container .legend-header {
    margin: 0 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.light-theme .marine-anomaly-legend-container .legend-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.marine-anomaly-legend-container .legend-title {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 6px;
}

.marine-anomaly-legend-container .legend-main-title {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.marine-anomaly-legend-container .legend-caption {
    font-size: 11px;
    font-style: italic;
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.2;
}

body.light-theme .marine-anomaly-legend-container .legend-caption {
    color: var(--text-muted-dark);
}

.marine-anomaly-legend-container .settings-toggle-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.marine-anomaly-legend-container .settings-toggle-btn:hover {
    background: var(--primary-color-hover, var(--primary-color));
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.marine-anomaly-legend-container .settings-toggle-btn.active {
    background: var(--primary-color-active, var(--primary-color));
    transform: translateY(0px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Settings toggle button maintains same appearance in both themes - blue primary color */
body.light-theme .marine-anomaly-legend-container .settings-toggle-btn {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

body.light-theme .marine-anomaly-legend-container .settings-toggle-btn:hover {
    background: var(--primary-color-hover, var(--primary-color));
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

body.light-theme .marine-anomaly-legend-container .settings-toggle-btn.active {
    background: var(--primary-color-active, var(--primary-color));
    transform: translateY(0px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Visualization type buttons */
.marine-anomaly-legend-container .viz-type-buttons {
    display: flex;
    gap: 3px;
    margin-bottom: 15px;
}

.marine-anomaly-legend-container .viz-type-btn {
    flex: 1;
    padding: 6px;
    border: none;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.marine-anomaly-legend-container .viz-type-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.marine-anomaly-legend-container .viz-type-btn.active {
    background: var(--primary-color);
    color: white;
}

body.light-theme .marine-anomaly-legend-container .viz-type-btn {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-dark);
}

body.light-theme .marine-anomaly-legend-container .viz-type-btn:hover {
    background: rgba(0, 0, 0, 0.2);
}

body.light-theme .marine-anomaly-legend-container .viz-type-btn.active {
    background: var(--primary-color);
    color: white;
}

/* Settings panel */
.marine-anomaly-legend-container .visual-settings-panel {
    background: rgba(0, 0, 0, 0.2);
    margin: 0 -15px 15px -15px;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.light-theme .marine-anomaly-legend-container .visual-settings-panel {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.marine-anomaly-legend-container .settings-title {
    color: var(--text-light);
    font-weight: bold;
    font-size: 12px;
    margin-bottom: 12px;
}

body.light-theme .marine-anomaly-legend-container .settings-title {
    color: var(--text-dark);
}

.marine-anomaly-legend-container .setting-group {
    margin-bottom: 12px;
}

.marine-anomaly-legend-container .setting-group-title {
    color: var(--text-muted);
    font-size: 11px;
    margin-bottom: 6px;
}

body.light-theme .marine-anomaly-legend-container .setting-group-title {
    color: var(--text-muted-dark);
}

.marine-anomaly-legend-container .setting-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.marine-anomaly-legend-container .setting-label {
    color: var(--text-light);
    font-size: 10px;
    width: 40px;
    flex-shrink: 0;
}

body.light-theme .marine-anomaly-legend-container .setting-label {
    color: var(--text-dark);
}

.marine-anomaly-legend-container .setting-slider {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

body.light-theme .marine-anomaly-legend-container .setting-slider {
    background: rgba(0, 0, 0, 0.2);
}

.marine-anomaly-legend-container .setting-slider::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}

.marine-anomaly-legend-container .setting-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.marine-anomaly-legend-container .setting-value {
    color: var(--text-muted);
    font-size: 10px;
    width: 30px;
    text-align: right;
    flex-shrink: 0;
}

body.light-theme .marine-anomaly-legend-container .setting-value {
    color: var(--text-muted-dark);
}

.marine-anomaly-legend-container .reset-btn {
    width: 100%;
    padding: 6px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.marine-anomaly-legend-container .reset-btn:hover {
    background: #c0392b;
}

body.light-theme .marine-anomaly-legend-container .reset-btn {
    background: #e74c3c;
    color: white;
}

body.light-theme .marine-anomaly-legend-container .reset-btn:hover {
    background: #c0392b;
}

/* Scale styling for anomaly ranges */
.marine-anomaly-legend-container .anomaly-scale {
    font-size: 12px;
    line-height: 1.4;
}

.marine-anomaly-legend-container .anomaly-range-item {
    margin: 3px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.marine-anomaly-legend-container .anomaly-color-box {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    flex-shrink: 0;
}

.marine-anomaly-legend-container .anomaly-range-text {
    color: var(--text-light);
    font-size: 12px;
}

body.light-theme .marine-anomaly-legend-container .anomaly-range-text {
    color: var(--text-dark);
}

.marine-anomaly-legend-container .attribution {
    margin-top: 12px;
    font-size: 11px;
    color: #999999; /* Default dark theme - lighter gray */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 8px;
    text-align: center;
    line-height: 1.4;
}

.marine-anomaly-legend-container .attribution a {
    color: var(--primary-color);
    text-decoration: none;
}

.marine-anomaly-legend-container .attribution a:hover {
    text-decoration: underline;
}

body.light-theme .marine-anomaly-legend-container .attribution {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    color: #666666; /* Light theme - darker gray */
}

body.light-theme .marine-anomaly-legend-container .attribution a {
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .marine-anomaly-legend-container {
        max-width: 250px !important;
        font-size: 0.85rem !important;
    }
    
    .marine-anomaly-legend-container .legend-title {
        font-size: 13px;
    }
    
    .marine-anomaly-legend-container .viz-type-btn {
        font-size: 10px;
        padding: 5px;
    }
}
.marine-anomaly-tooltip {
    background: var(--dark-panel) !important;
    color: var(--text-light) !important;
    border-radius: var(--border-radius) !important;
    box-shadow: var(--shadow) !important;
    border-left: 2px solid var(--primary-color) !important;
    padding: 6px 10px !important;
    font-family: var(--font-family-primary) !important;
    font-size: 0.75rem !important;
    line-height: 1.2 !important;
    max-width: 200px !important;
    min-width: 160px !important;
    text-align: center !important;
    word-wrap: break-word !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
    transition: all var(--transition-speed) ease !important;
    z-index: 10000 !important;
}

/* Light theme support */
body.light-theme .marine-anomaly-tooltip {
    background: var(--light-panel) !important;
    color: var(--text-dark) !important;
    border-left: 2px solid var(--primary-color) !important;
    box-shadow: var(--shadow) !important;
}

body.light-theme .marine-anomaly-tooltip .tooltip-title {
    color: var(--text-dark);
    opacity: 0.8;
    border-bottom: 1px solid var(--primary-color);
}

.marine-anomaly-tooltip .tooltip-title {
    font-weight: 600;
    font-size: 0.7em;
    color: var(--text-light);
    margin-bottom: 2px;
    opacity: 0.9;
    border-bottom: 1px solid var(--primary-color);
    padding-bottom: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.marine-anomaly-tooltip .tooltip-caption {
    font-size: 0.55em;
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: 3px;
    line-height: 1.1;
    opacity: 0.8;
    white-space: normal;
    word-wrap: break-word;
}

body.light-theme .marine-anomaly-tooltip .tooltip-caption {
    color: var(--text-muted-dark);
}

.marine-anomaly-tooltip .tooltip-temp {
    font-weight: 700;
    font-size: 1.2em;
    color: var(--primary-color);
    margin-bottom: 2px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

body.light-theme .marine-anomaly-tooltip .tooltip-temp {
    color: var(--primary-color);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.marine-anomaly-tooltip .tooltip-zone {
    font-size: 0.65em;
    color: var(--text-light);
    opacity: 0.8;
    font-weight: 400;
    text-transform: capitalize;
    margin-bottom: 2px;
    white-space: nowrap;
}

body.light-theme .marine-anomaly-tooltip .tooltip-zone {
    color: var(--text-dark);
    opacity: 0.7;
}

.marine-anomaly-tooltip .tooltip-coords {
    font-size: 0.6em;
    color: var(--text-light);
    opacity: 0.85;
    font-weight: 500;
    font-family: var(--font-family-mono);
    letter-spacing: 0.2px;
    white-space: nowrap;
}

body.light-theme .marine-anomaly-tooltip .tooltip-coords {
    color: var(--text-dark);
    opacity: 0.75;
}

.marine-anomaly-tooltip-container {
    pointer-events: none !important;
}

/* Leaflet tooltip container override - removes the white box */
.marine-anomaly-tooltip-container,
.leaflet-tooltip.marine-anomaly-tooltip-container {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.marine-anomaly-tooltip-container .leaflet-tooltip-content,
.leaflet-tooltip.marine-anomaly-tooltip-container .leaflet-tooltip-content {
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
}

/* Override default Leaflet tooltip styles for our custom tooltips */
.leaflet-tooltip.marine-anomaly-tooltip-container::before {
    display: none !important;
}

/* Anomaly contour layer styles */
.leaflet-overlay-pane .marine-anomaly-extreme-cold-anom {
    stroke: #0d1e4a !important;
    fill: #0d1e4a !important;
}

.leaflet-overlay-pane .marine-anomaly-very-cold-anom {
    stroke: #1a237e !important;
    fill: #1a237e !important;
}

.leaflet-overlay-pane .marine-anomaly-cold-anom {
    stroke: #0d47a1 !important;
    fill: #0d47a1 !important;
}

.leaflet-overlay-pane .marine-anomaly-cool-anom {
    stroke: #1976d2 !important;
    fill: #1976d2 !important;
}

.leaflet-overlay-pane .marine-anomaly-normal-anom {
    stroke: #4caf50 !important;
    fill: #4caf50 !important;
}

.leaflet-overlay-pane .marine-anomaly-warm-anom {
    stroke: #ffc107 !important;
    fill: #ffc107 !important;
}

.leaflet-overlay-pane .marine-anomaly-hot-anom {
    stroke: #ff9800 !important;
    fill: #ff9800 !important;
}

.leaflet-overlay-pane .marine-anomaly-very-hot-anom {
    stroke: #f44336 !important;
    fill: #f44336 !important;
}

.leaflet-overlay-pane .marine-anomaly-extreme-hot-anom {
    stroke: #b71c1c !important;
    fill: #b71c1c !important;
}

/* Hover effects for anomaly layers */
.leaflet-overlay-pane .marine-anomaly-extreme-cold-anom:hover,
.leaflet-overlay-pane .marine-anomaly-very-cold-anom:hover,
.leaflet-overlay-pane .marine-anomaly-cold-anom:hover,
.leaflet-overlay-pane .marine-anomaly-cool-anom:hover,
.leaflet-overlay-pane .marine-anomaly-normal-anom:hover,
.leaflet-overlay-pane .marine-anomaly-warm-anom:hover,
.leaflet-overlay-pane .marine-anomaly-hot-anom:hover,
.leaflet-overlay-pane .marine-anomaly-very-hot-anom:hover,
.leaflet-overlay-pane .marine-anomaly-extreme-hot-anom:hover {
    opacity: 0.9 !important;
    stroke-width: 3px !important;
}

/* Add hover effect */
.marine-anomaly-tooltip:hover {
    transform: translateY(-2px);
}

body.light-theme .marine-anomaly-tooltip:hover {
    box-shadow: 0 6px 32px 0 rgba(0,0,0,0.2) !important;
}

body:not(.light-theme) .marine-anomaly-tooltip:hover {
    box-shadow: 0 6px 32px 0 rgba(0,0,0,0.4) !important;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
    .marine-anomaly-tooltip {
        font-size: 0.75rem !important;
        padding: 8px 12px !important;
        max-width: 240px !important;
        min-width: 180px !important;
    }
    
    .marine-anomaly-tooltip .tooltip-title {
        font-size: 0.65em;
        margin-bottom: 2px;
    }
    
    .marine-anomaly-tooltip .tooltip-temp {
        font-size: 1.1em;
        margin-bottom: 2px;
    }
    
    .marine-anomaly-tooltip .tooltip-caption {
        font-size: 0.55em !important;
        line-height: 1.1;
        margin-bottom: 3px;
    }
    
    .marine-anomaly-tooltip .tooltip-zone {
        font-size: 0.6em;
        margin-bottom: 2px;
    }
    
    .marine-anomaly-tooltip .tooltip-coords {
        font-size: 0.6em;
        letter-spacing: 0.2px;
    }
} 