/* Settings Styles */

/* Override .content styles for settings */
#settings.content {
    background: transparent !important;
    padding: 0 !important;
}

.settings-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.settings-section {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 0;
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.settings-section:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.section-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.section-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-list {
    display: flex;
    flex-direction: column;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

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

.setting-item:hover {
    background-color: var(--bg-secondary);
}

.setting-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.setting-title {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 16px;
}

.setting-description {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.4;
}

.setting-control {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 24px;
}

/* Select Dropdown */
.setting-select {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 160px;
    font-weight: 500;
}

.setting-select:hover {
    border-color: var(--color-primary);
}

.setting-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.08);
}

/* Text Input */
.setting-input {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 14px;
    width: 80px;
    text-align: center;
    transition: all 0.2s ease;
    font-weight: 500;
}

.setting-input:hover {
    border-color: var(--color-primary);
}

.setting-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.08);
}

.input-unit {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-flex;
    width: 56px;
    height: 32px;
    cursor: pointer;
}

.toggle-switch input {
    display: none;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 32px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

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

input:checked+.slider:before {
    transform: translateX(24px);
}

/* Small Button */
.setting-btn-small {
    padding: 10px 18px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.setting-btn-small:hover {
    background: var(--bg-secondary);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.setting-btn-small.danger {
    color: #e74c3c;
    border-color: #e74c3c;
}

.setting-btn-small.danger:hover {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

/* Dark Theme */
body.dark-theme .settings-section {
    background: #2d2d2d;
    border-color: #404040;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-theme .section-header {
    background: linear-gradient(135deg, #353535 0%, #2d2d2d 100%);
    border-bottom-color: #404040;
}

body.dark-theme .setting-item {
    border-bottom-color: #404040;
}

body.dark-theme .setting-item:hover {
    background-color: #353535;
}

body.dark-theme .setting-select,
body.dark-theme .setting-input {
    background: #323232;
    color: #ffffff;
    border-color: #404040;
}

body.dark-theme .setting-select:hover,
body.dark-theme .setting-input:hover {
    border-color: var(--color-primary);
}

body.dark-theme .setting-select:focus,
body.dark-theme .setting-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.15);
}

body.dark-theme .setting-btn-small {
    background: #323232;
    border-color: #404040;
    color: #ffffff;
}

body.dark-theme .setting-btn-small:hover {
    background: #3a3a3a;
    border-color: var(--color-primary);
    color: var(--color-primary);
}

body.dark-theme .slider {
    background-color: #555555;
}

/* Responsive Design */
@media (max-width: 768px) {
    .settings-container {
        padding: 12px;
    }

    .settings-section {
        margin-bottom: 16px;
        border-radius: 12px;
    }

    .section-header {
        padding: 16px;
    }

    .section-header h3 {
        font-size: 18px;
    }

    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px;
    }

    .setting-control {
        width: 100%;
        margin-left: 0;
        justify-content: space-between;
    }

    .setting-select,
    .setting-input {
        width: 100%;
    }

    .toggle-switch {
        width: 50px;
        height: 28px;
    }

    .slider:before {
        height: 24px;
        width: 24px;
    }

    input:checked+.slider:before {
        transform: translateX(22px);
    }
}

@media (max-width: 480px) {
    .settings-container {
        padding: 8px;
    }

    .section-header {
        padding: 12px;
    }

    .section-header h3 {
        font-size: 16px;
        gap: 8px;
    }

    .setting-item {
        padding: 12px;
    }

    .setting-title {
        font-size: 15px;
    }

    .setting-description {
        font-size: 13px;
    }

    .setting-select,
    .setting-input {
        font-size: 13px;
    }

    .setting-btn-small {
        font-size: 12px;
        padding: 8px 14px;
    }
}

/* Settings Button (only for settings page, not header) */
.settings-content .settings-btn,
#settings .settings-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 8px 16px;
    border-radius: 25px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
    margin-left: 10px;
}

.settings-content .settings-btn:hover,
#settings .settings-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.settings-icon {
    font-size: 20px;
}

.settings-text {
    font-weight: 500;
}

/* Dark Theme Styles */
body.dark-theme .settings-section {
    background: #2d2d2d;
    border-color: #404040;
}

body.dark-theme .setting-item {
    border-bottom-color: #404040;
}

body.dark-theme #themeToggle {
    background: #323232;
    color: #ffffff;
    border-color: #404040;
}

body.dark-theme #themeToggle:hover {
    border-color: var(--color-primary);
}

@media (max-width: 768px) {
    .settings-container {
        padding: 20px;
    }

    .settings-section {
        padding: 20px;
    }

    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .setting-control {
        width: 100%;
    }

    #themeToggle {
        max-width: 100%;
    }

    #themeLabel {
        text-align: left;
        min-width: auto;
    }
}