/* Accumulator Control Styles */
.accumulator-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 30px;
    background: var(--dark-panel);
    color: var(--text-light);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
    padding: 12px 15px;
    z-index: 1000;
    width: 280px;
    max-width: 90vw;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: center;
    transition: transform var(--transition-fast) ease;
    max-height: 85vh;
    overflow-y: auto;
}

.accumulator-control:hover {
    transform: translateY(calc(-50% - 2px));
}

body.light-theme .accumulator-control {
    background: var(--light-panel);
    color: var(--text-dark);
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow);
}

@media (max-width: 768px) {
    .accumulator-control {
        top: auto;
        bottom: 10px;
        right: 10px;
        left: 10px;
        transform: none;
        width: auto;
        max-width: 98vw;
        padding: 10px;
        font-size: 0.85rem;
        max-height: 40vh;
    }
    .accumulator-control .control-title {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    .accumulator-control .types-container {
        max-height: 100px;
    }
    .toggle-switch {
        width: 32px;
        height: 16px;
    }
    .toggle-slider:before {
        height: 10px;
        width: 10px;
    }
    .time-range-button {
        padding: 3px 2px;
        font-size: 0.75rem;
    }
}

/* Toggle Switch Styles */
.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 18px;
    margin-left: 8px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--primary-color);
    transition: var(--transition-speed);
    border-radius: 18px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 3px;
    top: 3px;
    background-color: var(--text-light);
    transition: var(--transition-speed);
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--selected-color);
}

input:checked + .toggle-slider:before {
    transform: translateX(18px);
}

input:focus + .toggle-slider {
    box-shadow: 0 0 1px var(--selected-color);
}

body.light-theme .toggle-slider {
    background-color: var(--primary-color);
}

body.light-theme input:checked + .toggle-slider {
    background-color: var(--selected-color);
}

body.light-theme .toggle-slider:before {
    background-color: var(--text-light);
}

.toggle-label {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    margin-right: 8px;
    height: 18px;
    color: var(--text-light);
}

body.light-theme .toggle-label {
    color: var(--text-dark);
}

body.light-theme .time-container {
    background: rgba(255,255,255,0.95);
    color: var(--text-dark);
}
body:not(.light-theme) .time-container {
    background: rgba(30,30,30,0.95);
    color: var(--text-color);
}

.layer-item, .type-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    min-width: 0;
    flex-wrap: wrap;
}

.toggle-label-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
    min-width: 0;
}

.toggle-label {
    font-weight: bold;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toggle-caption {
    font-size: 11px;
    font-style: italic;
    color: #888;
    margin-top: 2px;
    line-height: 1.2;
    white-space: normal;
    word-break: break-word;
}

.accum-section-divider {
    margin: 18px 0;
    border: none;
    border-top: 1px solid #ddd;
}

@media (max-width: 768px) {
    .layer-item, .type-item {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        margin-bottom: 16px;
    }
    .toggle-label {
        font-size: 13px;
    }
    .toggle-caption {
        font-size: 10px;
    }
}

/* Intensity key styles */
.gradient {
    height: 10px;
    background: linear-gradient(to right, blue, cyan, yellow, orange, red);
    border-radius: 5px;
    margin: 3px 0;
}

.labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 5px;
}

.control-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.light-theme .control-title {
    color: var(--text-dark);
}

/* Container styles */
.types-container, .layers-container {
    margin-bottom: 10px;
}

/* Control Titles */
.accumulator-control .control-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.accumulator-control .control-title i {
    font-size: 1rem;
    color: var(--primary-color);
}

/* Types Container */
.accumulator-control .types-container {
    max-height: 120px;
    overflow-y: auto;
    padding-right: 6px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
    margin-bottom: 10px;
}

/* Checkbox Styles */
.accumulator-control input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius-small);
    margin-right: 12px;
    cursor: pointer;
    position: relative;
    transition: all var(--transition-speed) ease;
    background-color: rgba(255, 255, 255, 0.05);
}

.accumulator-control input[type="checkbox"]:checked {
    background-color: var(--primary-color);
}

.accumulator-control input[type="checkbox"]:checked::before {
    content: "✓";
    position: absolute;
    color: var(--primary-color);
    font-size: 14px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.accumulator-control label {
    color: var(--text-color);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: color var(--transition-speed) ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    user-select: none;
}

.accumulator-control label:hover {
    color: var(--primary-color);
}

/* Type Item Container */
.accumulator-control .type-item {
    margin: 4px 0;
    display: flex;
    align-items: center;
    padding: 2px 0;
}

/* Legend Gradient */
.accumulator-control .gradient {
    width: 100%;
    height: 24px;
    background: linear-gradient(90deg, 
        rgba(0, 0, 255, 0.8) 0%,
        rgba(0, 255, 255, 0.8) 20%,
        rgba(255, 255, 0, 0.8) 40%,
        rgba(255, 165, 0, 0.8) 60%,
        rgba(255, 0, 0, 0.8) 80%,
        rgba(255, 0, 0, 0.8) 100%
    );
    border-radius: 4px;
    margin: 12px 0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Legend Labels */
.accumulator-control .labels {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
}

.accumulator-control .labels span {
    flex: 1;
    text-align: center;
    padding: 0 6px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.accumulator-control .labels span:first-child {
    text-align: left;
}

.accumulator-control .labels span:last-child {
    text-align: right;
}

.accumulator-control .high-label {
    color: var(--primary-color);
}

.accumulator-control .low-label {
    color: var(--text-light);
}

/* Light Theme Adjustments */
body.light-theme .accumulator-control .control-title {
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .accumulator-control .control-title,
body.light-theme .accumulator-control label,
body.light-theme .accumulator-control .labels span {
    color: var(--text-dark);
    text-shadow: none;
}

body.light-theme .accumulator-control .low-label {
    color: var(--text-dark);
}

body.light-theme .accumulator-control input[type="checkbox"] {
    background-color: rgba(0, 0, 0, 0.05);
}

.time-container {
    padding: 10px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 5px;
    margin: 5px 0;
}

.time-range {
    margin: 10px 0;
}

.time-slider {
    width: 100%;
    height: 5px;
    -webkit-appearance: none;
    background: #ddd;
    border-radius: 5px;
    outline: none;
}

.time-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    background: #4CAF50;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.time-slider::-webkit-slider-thumb:hover {
    background: #45a049;
}

.time-labels {
    display: flex;
    justify-content: space-between;
    color: #666;
    font-size: 12px;
    margin-top: 5px;
}

/* Time Range Buttons */
.time-range-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 6px;
}

.time-range-button {
    flex: 1;
    padding: 4px 3px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: var(--text-color);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.time-range-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.time-range-button.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

body.light-theme .time-range-button {
    background-color: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--text-dark);
}

body.light-theme .time-range-button:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .time-range-button.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Legend Container Styles */
.legend-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

/* Horizontal row layout for legend */
.legend-row {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    gap: 3px !important;
    display: flex !important;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 3px;
}

.legend-row .legend-item {
    flex: 0 0 auto !important;
    margin-right: 5px !important;
    max-width: 70px !important;
}

.legend-color {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0 !important;
}

.legend-label {
    font-size: 0.75rem;
    color: var(--text-light);
}

.legend-label.small {
    font-size: 0.7rem !important;
    white-space: nowrap !important;
}

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

.accumulator-control .legend-item {
    display: flex;
    align-items: center;
    padding: 2px 0;
    margin-bottom: 2px;
}

/* Grid Heatmap CSS (consolidated from grid_heatmap.css) */
/* Dark theme support */
.dark-theme .legend-label {
    color: #ccc;
}

.leaflet-bar.leaflet-control {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    z-index: 10000 !important;
    display: block !important;
    opacity: 1 !important;
}

.grid-toggle-button {
    position: absolute !important;
    top: 10px !important;
    right: 60px !important; /* Position to the left of other controls */
    width: 34px !important;
    height: 34px !important;
    background-color: white !important;
    border: 2px solid rgba(0, 0, 0, 0.2) !important;
    border-radius: 4px !important;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4) !important;
    z-index: 1500 !important; /* High z-index to ensure visibility */
    cursor: pointer !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

.grid-toggle-button i {
    color: #444 !important;
    font-size: 16px !important;
}

.grid-toggle-button:hover {
    background-color: #f4f4f4 !important;
}

/* Heatmap settings styles */
.settings-container {
    margin-bottom: 10px;
    background: var(--dark-overlay);
    padding: 8px;
    border-radius: var(--border-radius);
}

body.light-theme .settings-container {
    background: var(--light-overlay);
}

.setting-item {
    margin-bottom: 6px;
    padding-bottom: 4px;
}

.setting-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 4px;
    color: var(--text-light);
}

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

.setting-value {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 0.8rem;
}

.setting-slider {
    width: 100%;
    height: 5px;
    -webkit-appearance: none;
    appearance: none;
    background: #d3d3d3;
    outline: none;
    opacity: 0.7;
    -webkit-transition: .2s;
    transition: opacity .2s;
    border-radius: 5px;
}

.setting-slider:hover {
    opacity: 1;
}

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

.setting-slider::-moz-range-thumb {
    width: 15px;
    height: 15px;
    background: var(--primary-color);
    cursor: pointer;
    border-radius: 50%;
}

/* Revert to defaults button */
.defaults-button {
    display: block;
    margin: 10px auto 5px;
    padding: 6px 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.defaults-button:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.15);
}

.defaults-button:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

body.dark-theme .defaults-button {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

body.dark-theme .defaults-button:hover {
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.35);
}

/* Control Box Styles */
.control-box {
    background: var(--dark-overlay);
    border-radius: 6px;
    padding: 8px;
    margin-bottom: 4px;
    transition: background-color var(--transition-speed);
}

body.light-theme .control-box {
    background: var(--light-overlay);
}

/* Settings Section Styles */
.settings-section {
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.settings-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
}

.settings-section-header:hover {
    background: rgba(255, 255, 255, 0.1);
}

.settings-section-header i {
    transition: transform 0.2s;
    font-size: 0.8rem;
}

.settings-section-content {
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    display: none; /* Hidden by default */
}

/* Settings Container Styles */
.settings-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-item {
    margin-bottom: 4px;
}

.setting-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    font-size: 0.8rem;
}

.setting-value {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 0.8rem;
    min-width: 30px;
    text-align: right;
}

/* Layer Item Styles */
.layer-item:last-child {
    border-bottom: none;
}

/* Time Range Styles */
.time-range-container {
    display: flex;
    gap: 4px;
}

.time-range-button {
    flex: 1;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: var(--text-light);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.time-range-button:hover {
    background: rgba(255, 255, 255, 0.15);
}

.time-range-button.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Legend Styles */
.legend-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.legend-label {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Attribution Text */
.attribution-text {
    font-size: 0.7rem;
    color: var(--text-light);
    opacity: 0.7;
    text-align: center;
    margin-top: 8px;
}

.attribution-text a {
    color: var(--text-light);
    text-decoration: none;
}

.attribution-text a:hover {
    text-decoration: underline;
}

/* Light Theme Adjustments */
body.light-theme .control-box {
    background: var(--light-overlay);
}

body.light-theme .settings-section {
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .settings-section-header {
    background: rgba(0, 0, 0, 0.05);
}

body.light-theme .settings-section-header:hover {
    background: rgba(0, 0, 0, 0.1);
}

body.light-theme .settings-section-content {
    background: rgba(0, 0, 0, 0.02);
}

body.light-theme .layer-item {
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .time-range-button {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-dark);
}

body.light-theme .time-range-button:hover {
    background: rgba(0, 0, 0, 0.1);
}

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

body.light-theme .attribution-text {
    color: var(--text-dark);
}

body.light-theme .attribution-text a {
    color: var(--text-dark);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .control-box {
        padding: 6px;
    }

    .settings-section-header {
        padding: 6px 8px;
    }

    .settings-section-content {
        padding: 6px 8px;
    }

    .time-range-button {
        padding: 4px 6px;
        font-size: 0.75rem;
    }
} 