/* Settings Page Styles */
.settings-page {
    padding: 0 0 80px 0;
    max-width: 800px;
    margin: 0 auto;
    color: var(--font-color);
    width: 100%;
    box-sizing: border-box;
}

/* Section Styling */
.section {
    background: var(--bg-color-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.section:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border-color: var(--border-color-secondary);
}

.section .title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--font-color);
    margin: 0 0 8px 0;
    padding: 20px 20px 0;
}

.section .subtitle {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--font-color-secondary);
    margin: 0 0 4px 0;
    padding: 0 20px;
}

.section .subdesc {
    font-size: 0.8rem;
    color: var(--font-color-tertiary);
    line-height: 1.4;
    margin: 0 0 16px 0;
    padding: 0 20px;
}

.section .description {
    font-size: 0.85rem;
    color: var(--font-color-secondary);
    line-height: 1.5;
    margin: 12px 0;
    padding: 0 20px;
}

.section .desc {
    padding: 0 20px 20px;
}

.section .desc p {
    font-size: 0.85rem;
    color: var(--font-color-secondary);
    line-height: 1.5;
    margin: 8px 0;
}

.section .links {
    font-size: 0.85rem;
    color: var(--font-color-secondary);
    line-height: 1.5;
    margin: 12px 0 0;
    padding: 0 20px 20px;
}

/* Appearance Section */
.appearance .options {
    display: flex;
    gap: 12px;
    padding: 0 20px 20px;
    flex-wrap: wrap;
}

.appearance .option {
    flex: 1;
    min-width: 120px;
    padding: 16px 12px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    background: var(--bg-color);
}

.appearance .option:hover {
    border-color: var(--brand-color);
    background: var(--bg-color-tertiary);
}

.appearance .option.active {
    border-color: var(--brand-color);
    background: var(--brand-color);
    color: var(--font-color-inverted);
}

.appearance .option .visual {
    width: 40px;
    height: 24px;
    border-radius: 6px;
    margin: 0 auto 8px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.appearance .option .visual .theme-icon {
    width: 14px;
    height: 14px;
    position: absolute;
    z-index: 2;
    color: var(--font-color-secondary);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.appearance .option.active .visual .theme-icon {
    color: var(--font-color-inverted);
}

.appearance .option .visual.light-theme {
    background: linear-gradient(135deg, #ffffff 0%, #f8f8f8 100%);
}

.appearance .option .visual.dark-theme {
    background: linear-gradient(135deg, #111111 0%, #161616 100%);
}

.appearance .option .visual.system-theme {
    background: linear-gradient(135deg, #ffffff 0%, #111111 100%);
}

.appearance .option .desc {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0;
    margin: 0;
}

/* Quality Section */
.quality .container {
    padding: 0 20px 20px;
}

.quality .options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quality .option {
    display: flex;
    align-items: center;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-color);
}

.quality .option:hover {
    border-color: var(--brand-color);
    background: var(--bg-color-tertiary);
}

.quality .option.active {
    border-color: var(--brand-color);
    background: rgba(var(--brand-color-rgb, 148, 123, 238), 0.1);
}

.quality .option .status {
    margin-right: 12px;
    color: var(--brand-color);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.quality .option.active .status {
    opacity: 1;
}

.quality .option .details {
    flex: 1;
}

.quality .option .details .title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--font-color);
    margin: 0 0 4px 0;
}

.quality .option .details .title .bitrate {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--font-color-tertiary);
    margin-left: 8px;
}

.quality .option .details .desc {
    font-size: 0.8rem;
    color: var(--font-color-secondary);
    line-height: 1.3;
    margin: 0;
    padding: 0;
}

/* Setting Row (for switches) */
.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

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

.setting-info {
    flex: 1;
    margin-right: 16px;
}

.setting-info .subtitle {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--font-color);
    margin: 0 0 4px 0;
    padding: 0;
}

.setting-info .subdesc {
    font-size: 0.8rem;
    color: var(--font-color-tertiary);
    line-height: 1.3;
    margin: 0;
    padding: 0;
}

/* Switch Styling */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}

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

.switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-color-quaternary);
    transition: 0.3s ease;
    border-radius: 28px;
    border: 1px solid var(--border-color);
}

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

.switch input:checked + .slider {
    background-color: var(--brand-color);
    border-color: var(--brand-color);
}

.switch input:checked + .slider:before {
    transform: translateX(22px);
    background-color: var(--font-color-inverted);
}

.switch:hover .slider {
    box-shadow: 0 0 0 8px rgba(var(--brand-color-rgb, 148, 123, 238), 0.1);
}

/* Crossfade Controls */
.crossfade-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 20px 20px;
}

.slider-container {
    flex: 1;
}

.slider-container input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-color-quaternary);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--brand-color);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.slider-container input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.slider-container input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--brand-color);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.slider-container input[type="range"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.slider-container input[type="range"]:disabled::-webkit-slider-thumb {
    cursor: not-allowed;
}

/* Actions */
.actions {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-color-tertiary);
}

.actions .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--inter-font);
}

.actions .btn.clear {
    background: var(--font-color-error);
    color: var(--font-color-inverted);
}

.actions .btn.clear:hover:not(:disabled) {
    background: var(--font-color-error-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(233, 81, 81, 0.3);
}

.actions .btn.logout {
    background: var(--font-color-error);
    color: var(--font-color-inverted);
    margin-right: 12px;
}

.actions .btn.logout:hover {
    background: var(--font-color-error-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(233, 81, 81, 0.3);
}

.actions .btn.reload {
    background: var(--bg-color-quaternary);
    color: var(--font-color);
    border: 1px solid var(--border-color);
}

.actions .btn.reload:hover {
    background: var(--brand-color);
    color: var(--font-color-inverted);
    border-color: var(--brand-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--brand-color-rgb, 148, 123, 238), 0.3);
}

.actions .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Numbers and highlights */
.number {
    font-weight: 700;
    color: var(--brand-color);
}

.textlink {
    color: var(--link-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.textlink:hover {
    color: var(--link-color-active);
    text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .settings-page {
        padding: 0 8px 80px 8px;
        max-width: 100%;
        width: 100vw;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    .section {
        margin-bottom: 16px;
        border-radius: 10px;
        width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    .section .title {
        font-size: 1.1rem;
        padding: 16px 16px 0;
    }
    
    .section .subtitle,
    .section .subdesc,
    .section .description,
    .section .links {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .section .desc {
        padding: 0 16px 16px;
    }
    
    .appearance .options {
        padding: 0 16px 16px;
        gap: 8px;
    }
    
    .appearance .option {
        min-width: 100px;
        padding: 12px 8px;
    }
    
    .quality .container {
        padding: 0 16px 16px;
    }
    
    .quality .option {
        padding: 12px;
    }
    
    .setting-row {
        padding: 16px;
        min-height: 70px;
    }
    
    .setting-info {
        margin-right: 12px;
    }
    
    .switch {
        width: 46px;
        height: 26px;
    }
    
    .switch .slider:before {
        height: 18px;
        width: 18px;
        left: 3px;
        bottom: 3px;
    }
    
    .switch input:checked + .slider:before {
        transform: translateX(20px);
    }
    
    .crossfade-controls {
        padding: 0 16px 16px;
        gap: 12px;
    }
    
    .actions {
        padding: 12px 16px;
    }
    
    .actions .btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .appearance .options {
        flex-direction: column;
    }
    
    .appearance .option {
        min-width: auto;
    }
    
    .setting-row {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        min-height: 60px;
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
    
    .setting-info {
        margin-right: 8px;
        flex: 1;
        min-width: 0;
        max-width: calc(100% - 60px);
        overflow: hidden;
    }
    
    .setting-info .subtitle {
        font-size: 0.85rem;
        line-height: 1.2;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .setting-info .subdesc {
        font-size: 0.75rem;
        line-height: 1.3;
        margin-top: 2px;
        word-wrap: break-word;
        overflow-wrap: break-word;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .switch {
        flex-shrink: 0;
        width: 44px;
        height: 24px;
    }
    
    .switch .slider:before {
        height: 16px;
        width: 16px;
        left: 3px;
        bottom: 3px;
    }
    
    .switch input:checked + .slider:before {
        transform: translateX(20px);
    }
    
    .crossfade-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    
    .actions .btn.logout {
        margin-right: 0;
        margin-bottom: 8px;
        width: 100%;
    }
    
    .actions .btn.reload {
        width: 100%;
    }
}