:root {
    --border-color: #ddd;
    --background-color: white;
    --text-color: #333;
    --hover-color: #f0f0f0;
    --accent-color: #45a0d8;
    --accent-color-dark: #1b96e1;
}

.settings-content {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(100vh - 100px);
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.settings-section {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: #f5f5f5;
    border-radius: 8px;
}

.settings-section h3 {
    margin: 0 0 1.25rem;
    font: 600 1rem/1.2 inherit;
    color: #2c2c2c;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    position: relative;
}

.setting-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.setting-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
}

.setting-label-container {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.setting-item-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #444;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    word-break: normal;
    overflow-wrap: break-word;
}

.setting-description {
    color: #666;
    font-size: 0.85rem;
    font-weight: normal;
    display: block;
    margin-top: 2px;
}

.setting-controls {
    width: 100%;
}

/* Reset buttons */
.reset-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-left: 8px;
    flex-shrink: 0;
    padding: 0;
    border: none;
    background: none;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0.7;
    border-radius: 4px;
}

.reset-button:hover {
    opacity: 1;
    background: rgba(0,0,0,0.05);
}

.reset-button svg {
    width: 16px;
    height: 16px;
}

.reset-all-button {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 1rem auto 0;
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    color: #666;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.reset-all-button:hover {
    background: #f0f0f0;
    border-color: #ccc;
}

/* Checkbox styling */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-right: 0;
    cursor: pointer;
}

.setting-item.checkbox input[type="checkbox"] {
    display: none;
}

.checkbox-display {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
    position: relative;
    background: white;
    cursor: pointer;
}

.checkbox-display::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.setting-item.checkbox input[type="checkbox"]:checked + .checkbox-display {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.setting-item.checkbox input[type="checkbox"]:checked + .checkbox-display::after {
    opacity: 1;
}

/* Checkbox layout specific styles */
.setting-item.checkbox .setting-item-header {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: start;
}

.checkbox-left-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.label-right-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.setting-item.checkbox .setting-item-label {
    flex-direction: column;
    align-items: flex-start;
    cursor: pointer;
}

.setting-item.checkbox .setting-description {
    margin-top: 2px;
    margin-left: 0;
    display: block;
}

.checkbox-reset {
    margin-left: 0;
}

/* Ensure reset button aligns with checkbox */
.reset-button.checkbox-reset {
    margin-top: 4px;
}

/* Range input styling */
.range-container {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 300px;
    margin-top: 8px;
}

.setting-item input[type="range"] {
    flex: 1;
    margin: 0;
    cursor: pointer;
}

.range-value {
    display: inline-block;
    min-width: 40px;
    padding: 2px 6px;
    background: #e9e9e9;
    border-radius: 3px;
    font-size: 0.8rem;
    font-family: monospace;
    text-align: center;
}

input[type="range"] {
    width: 100%;
}

input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    background: #ddd;
    border-radius: 2px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    margin-top: -5px;
    background: #2196F3;
    border-radius: 50%;
    cursor: pointer;
}

input[type="range"]:focus {
    outline: none;
}

input[type="range"]:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 2px rgba(33,150,243,0.2);
}

/* Multi-select styling */
.multi-select-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    width: 100%;
}

.multi-select-option {
    padding: 4px 12px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 16px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.multi-select-option:hover {
    background: #f0f0f0;
}

.multi-select-option.selected {
    background: #2196F3;
    border-color: #2196F3;
    color: white;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #555;
    transition: .4s;
    border-radius: 24px;
}

.toggle-switch .slider:before {
    content: "";
    position: absolute;
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background: black;
    transition: .4s;
    border-radius: 50%;
}

.toggle-switch input:checked + .slider {
    background: #2196F3;
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(26px);
}

/* Range and Number Inputs */
.setting-item input[type="number"] {
    width: 150px;
    padding: 5px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: black;
}

.setting-item select option {
    background: #333;
    color: black;
}

.setting-item.with-description .setting-controls {
    width: 100%;
}

.setting-item.with-description .range-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
}

.setting-item.with-description input[type="range"] {
    flex: 1;
}

.setting-item.with-description .range-value {
    min-width: 40px;
    text-align: right;
}

.select-container, .multi-select-container {
    margin-top: 8px;
}

.select-option {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--background-color);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.select-option:hover {
    background: var(--hover-color);
}

.select-option.selected {
    background: var(--accent-color);
    color: black;
    border-color: var(--accent-color);
    background-color: #ddf;
}

.setting-item.with-description .select-container,
.setting-item.with-description .multi-select-container {
    margin-top: 8px;
}

/* Force sliders and select options to new line */
.setting-item:not(.checkbox) .setting-controls {
    grid-row: 2;
    width: 100%;
}

/* Keep checkboxes inline */
.setting-item.checkbox .setting-controls {
    display: inline-flex;
}

/* Keep checkboxes properly aligned */
.setting-item.checkbox .setting-item-header {
    display: flex;
    align-items: start;
}

.setting-item.checkbox .setting-description {
    margin-top: 0;
} 