/**
 * Settings UI - Design Professionnel et Sobre
 * Composants réutilisables pour les modals de paramètres
 */

/* ============================================
   SETTINGS OVERLAY & PANEL
   ============================================ */

.settings-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
    animation: settingsFadeIn 0.2s ease-out;
}

.settings-overlay.active {
    display: flex;
}

.settings-panel {
    background: #0d1117;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    width: 90%;
    max-width: 520px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.05),
        0 20px 50px rgba(0, 0, 0, 0.5),
        0 0 100px rgba(96, 165, 250, 0.1);
    animation: settingsSlideUp 0.3s ease-out;
}

/* ============================================
   HEADER
   ============================================ */

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.settings-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #f0f6fc;
    letter-spacing: -0.3px;
}

.settings-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #8b949e;
    font-size: 20px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.settings-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f0f6fc;
}

/* ============================================
   BODY & SECTIONS
   ============================================ */

.settings-body {
    padding: 16px 24px 24px;
    overflow-y: auto;
    flex: 1;
}

.settings-section {
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.settings-section:first-child {
    padding-top: 8px;
}

.settings-section:last-child {
    border-bottom: none;
    padding-bottom: 8px;
}

.settings-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px 0;
    font-size: 13px;
    font-weight: 600;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-section-icon {
    font-size: 14px;
}

/* ============================================
   SLIDERS (VOLUME)
   ============================================ */

.settings-slider-group {
    margin-bottom: 16px;
}

.settings-slider-group:last-child {
    margin-bottom: 0;
}

.settings-slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.settings-slider-label {
    font-size: 14px;
    color: #c9d1d9;
    font-weight: 500;
}

.settings-slider-value {
    font-size: 14px;
    font-weight: 600;
    color: #58a6ff;
    font-variant-numeric: tabular-nums;
    min-width: 40px;
    text-align: right;
}

.settings-slider-value.master {
    color: #f0883e;
}

.settings-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #21262d;
    outline: none;
    cursor: pointer;
    transition: background 0.15s ease;
}

.settings-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #58a6ff;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(88, 166, 255, 0.3);
    transition: all 0.15s ease;
}

.settings-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 12px rgba(88, 166, 255, 0.5);
}

.settings-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #58a6ff;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(88, 166, 255, 0.3);
}

.settings-slider.master::-webkit-slider-thumb {
    background: #f0883e;
    box-shadow: 0 2px 8px rgba(240, 136, 62, 0.3);
}

.settings-slider.master::-moz-range-thumb {
    background: #f0883e;
    box-shadow: 0 2px 8px rgba(240, 136, 62, 0.3);
}

/* ============================================
   BUTTONS
   ============================================ */

.settings-btn-group {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.settings-btn {
    flex: 1;
    padding: 10px 16px;
    background: #21262d;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #c9d1d9;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.settings-btn:hover {
    background: #30363d;
    border-color: rgba(255, 255, 255, 0.15);
}

.settings-btn:active {
    transform: scale(0.98);
}

.settings-btn.primary {
    background: rgba(88, 166, 255, 0.15);
    border-color: rgba(88, 166, 255, 0.3);
    color: #58a6ff;
}

.settings-btn.primary:hover {
    background: rgba(88, 166, 255, 0.25);
    border-color: rgba(88, 166, 255, 0.5);
}

/* ============================================
   TOGGLE SWITCH
   ============================================ */

.settings-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
}

.settings-toggle-label {
    font-size: 14px;
    color: #c9d1d9;
    font-weight: 500;
}

.settings-toggle {
    position: relative;
    width: 44px;
    height: 24px;
}

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

.settings-toggle-track {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #21262d;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.settings-toggle-track::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background: #8b949e;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.settings-toggle input:checked + .settings-toggle-track {
    background: rgba(88, 166, 255, 0.2);
    border-color: #58a6ff;
}

.settings-toggle input:checked + .settings-toggle-track::before {
    transform: translateX(20px);
    background: #58a6ff;
}

/* ============================================
   LANGUAGE SELECTOR
   ============================================ */

.settings-lang-group {
    display: flex;
    gap: 10px;
}

.settings-lang-btn {
    flex: 1;
    padding: 12px 16px;
    background: #21262d;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #8b949e;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.settings-lang-btn:hover {
    background: #30363d;
    color: #c9d1d9;
}

.settings-lang-btn.active {
    background: rgba(88, 166, 255, 0.15);
    border-color: #58a6ff;
    color: #58a6ff;
}

/* ============================================
   KEYBOARD SHORTCUTS CARD
   ============================================ */

.settings-shortcuts-card {
    background: #161b22;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 10px;
}

.settings-shortcuts-card:last-child {
    margin-bottom: 0;
}

.settings-shortcuts-title {
    font-size: 13px;
    font-weight: 600;
    color: #c9d1d9;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-shortcuts-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-shortcut-item {
    font-size: 13px;
    color: #8b949e;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 22px;
    padding: 0 6px;
    background: #0d1117;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-family: var(--font-mono, 'SF Mono', 'Consolas', monospace);
    font-size: 11px;
    font-weight: 500;
    color: #58a6ff;
}

.settings-kbd.red { color: #f87171; }
.settings-kbd.blue { color: #60a5fa; }
.settings-kbd.green { color: #4ade80; }
.settings-kbd.violet { color: #c084fc; }

/* ============================================
   DETAILS/ACCORDION
   ============================================ */

.settings-details {
    background: #161b22;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    margin-top: 12px;
    overflow: hidden;
}

.settings-details summary {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #8b949e;
    display: flex;
    align-items: center;
    gap: 10px;
    user-select: none;
    list-style: none;
    transition: all 0.15s ease;
}

.settings-details summary::-webkit-details-marker {
    display: none;
}

.settings-details summary:hover {
    background: rgba(255, 255, 255, 0.03);
    color: #c9d1d9;
}

.settings-details-arrow {
    transition: transform 0.2s ease;
    font-size: 10px;
}

.settings-details[open] .settings-details-arrow {
    transform: rotate(90deg);
}

.settings-details-content {
    padding: 0 16px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ============================================
   SCROLLBAR
   ============================================ */

.settings-body::-webkit-scrollbar {
    width: 8px;
}

.settings-body::-webkit-scrollbar-track {
    background: transparent;
}

.settings-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.settings-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Firefox */
.settings-body {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes settingsFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes settingsSlideUp {
    from { 
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================
   ACCOUNT SECTION
   ============================================ */

.settings-account-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #161b22;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
}

.settings-account-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #58a6ff 0%, #3b82f6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    font-weight: 600;
}

.settings-account-info {
    flex: 1;
}

.settings-account-name {
    font-size: 14px;
    font-weight: 600;
    color: #f0f6fc;
}

.settings-account-email {
    font-size: 12px;
    color: #8b949e;
    margin-top: 2px;
}

/* ============================================
   HELPER TEXT
   ============================================ */

.settings-helper {
    font-size: 12px;
    color: #6e7681;
    margin-top: 8px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.settings-helper-icon {
    flex-shrink: 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 480px) {
    .settings-panel {
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    
    .settings-header {
        padding: 16px 20px;
    }
    
    .settings-body {
        padding: 12px 20px 20px;
    }
    
    .settings-lang-group {
        flex-direction: column;
    }
}
