/**
 * Settings - Design System Implementation
 *
 * Sources (copie mécanique avec mapping tokens) :
 * - _content.css        → .settings-container, .settings-grid
 * - _cards.css          → .section, .section-header, .theme-grid, .theme-card, .theme-preview, .theme-preview-*
 * - _theme-preview.css  → variantes couleurs preview par thème
 * - _profile.css        → .profile-header, .avatar, .profile-info, .company-logo-placeholder
 * - _settings-social.css → .social-icon-*, .avatar-sm, .btn-{platform}, accordion
 * - _buttons.css        → .btn-primary-custom
 *
 * Table de mapping tokens (design system → projet) :
 * --color-primary      → --theme-accent
 * --color-secondary    → --color-secondary
 * --bg-card            → --theme-card-bg
 * --bg-primary         → --theme-bg-primary
 * --text-primary       → --theme-text-primary
 * --text-secondary     → --theme-text-secondary
 * --border             → --theme-border-color
 * --border-radius-xl (16px), --border-radius-lg (12px), --border-radius-md (8px) → valeurs directes
 * --padding-card (30px), --gap-lg (24px), --spacing-* → valeurs directes
 * --shadow-sm-light, --shadow-lg-light → valeurs directes
 * --backdrop-blur-md (blur(20px)) → valeur directe
 */

/* ==========================================================================
   SETTINGS CONTAINER
   Source: _content.css → .content
   ========================================================================== */

.settings-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 30px;
}

/* ==========================================================================
   SETTINGS GRID (2 colonnes : 400px + 1fr)
   Source: _content.css → .settings-grid
   ========================================================================== */

.settings-grid {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 24px;
    align-items: stretch;
}

.settings-grid > div {
    display: flex;
    flex-direction: column;
}

.settings-grid .section {
    flex: 1;
}

@media (max-width: 992px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   PAGE TITLE
   Source: settings_index_light.html (inline styles → classes)
   ========================================================================== */

.settings-page-title {
    font-size: 36px;
    font-weight: 800;
    color: var(--theme-accent);
    margin-bottom: 8px;
}

.settings-page-subtitle {
    font-size: 18px;
    color: var(--theme-text-secondary);
    margin-bottom: 0;
}

/* ==========================================================================
   SECTION CARD
   Source: _cards.css → .section
   ========================================================================== */

.section {
    background: var(--theme-card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 24px;
    border: 1px solid var(--theme-border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.section:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   SECTION HEADER
   Source: _cards.css → .section-header, .section-header h2
   ========================================================================== */

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--theme-bg-primary);
}

.section-header i {
    font-size: 24px;
    color: var(--theme-accent);
}

.section-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--theme-accent);
    margin: 0;
}

/* ==========================================================================
   SETTINGS SUBSECTION TITLE
   Source: settings_index_light.html → <h3 style="font-size: 16px ...">
   ========================================================================== */

.settings-subsection-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--theme-text-primary);
}

.settings-subsection-title.mt-subsection {
    margin-top: 24px;
}

/* ==========================================================================
   THEME GRID & CARDS
   Source: _cards.css → .theme-grid, .theme-card
   ========================================================================== */

.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.theme-card {
    border: 3px solid var(--theme-border-color);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 300ms ease-in-out;
    background: var(--theme-card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: relative;
}

.theme-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 48, 128, 0.15);
    border-color: var(--color-secondary);
}

.theme-card.active {
    border-color: var(--theme-accent);
    background: rgba(0, 48, 128, 0.02);
    box-shadow: 0 4px 16px rgba(0, 48, 128, 0.12);
}

/* État sélectionné via radio btn-check */
input.btn-check:checked + .theme-card {
    border-color: var(--theme-accent);
    background: rgba(0, 48, 128, 0.02);
    box-shadow: 0 4px 16px rgba(0, 48, 128, 0.12);
}

input.btn-check:checked + .theme-card:hover {
    transform: none;
}

/* ==========================================================================
   THEME PREVIEW (miniature)
   Source: _cards.css → .theme-preview, .theme-preview-*
   ========================================================================== */

.theme-preview {
    height: 80px;
    border-radius: 8px;
    margin-bottom: 12px;
    display: flex;
    overflow: hidden;
    position: relative;
}

.theme-preview-light {
    border: 1px solid #e3e4e9;
}

.theme-preview-dark-blue {
    border: 1px solid #2a3f5f;
}

.theme-preview-dark-red {
    border: 1px solid #3d1f27;
}

.theme-preview-bg {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
}

.theme-preview-sidebar {
    width: 70px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px;
    gap: 3px;
}

.theme-preview-logo {
    width: 24px;
    height: 24px;
    display: block;
    margin-bottom: 4px;
    object-fit: contain;
}

.theme-preview-section {
    width: 100%;
    height: 14px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.theme-preview-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
}

.theme-preview-icon {
    width: 100%;
    height: 18px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.theme-preview-bar {
    width: 30px;
    height: 4px;
    border-radius: 3px;
}

/* ==========================================================================
   THEME PREVIEW - VARIANTES COULEURS
   Source: _theme-preview.css
   ========================================================================== */

/* Light */
.theme-preview-light-bg {
    background: #f5f5f7;
}

.theme-preview-light-sidebar {
    background: #001f3f;
}

.theme-preview-light-section {
    background: rgba(0, 48, 128, 0.15);
    color: #003080;
}

.theme-preview-light-bar {
    background: #003080;
}

.theme-preview-light-icon {
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
}

/* Dark Blue */
.theme-preview-dark-blue-bg {
    background: linear-gradient(135deg, #0f1729 0%, #2a3f5f 100%);
}

.theme-preview-dark-blue-sidebar {
    background: #0a0f1a;
}

.theme-preview-dark-blue-section {
    background: rgba(95, 168, 211, 0.15);
    color: rgba(95, 168, 211, 0.7);
}

.theme-preview-dark-blue-bar {
    background: rgba(95, 168, 211, 0.3);
}

.theme-preview-dark-blue-icon {
    background: transparent;
    color: rgba(95, 168, 211, 0.5);
}

/* Dark Red */
.theme-preview-dark-red-bg {
    background: linear-gradient(135deg, #1a0a0e 0%, #3d1f27 100%);
}

.theme-preview-dark-red-sidebar {
    background: #0f0507;
}

.theme-preview-dark-red-section {
    background: rgba(211, 95, 141, 0.15);
    color: rgba(211, 95, 141, 0.7);
}

.theme-preview-dark-red-bar {
    background: rgba(211, 95, 141, 0.3);
}

.theme-preview-dark-red-icon {
    background: transparent;
    color: rgba(211, 95, 141, 0.5);
}

/* Label texte sous la miniature */
.theme-card-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-card-label i {
    font-size: 20px;
    color: var(--theme-accent);
}

.theme-card-label span {
    font-weight: 600;
    color: var(--theme-text-primary);
}

/* ==========================================================================
   LOCALE GRID & CARDS (réutilise .theme-card)
   Source: settings_index_light.html → grid auto-fit 200px
   ========================================================================== */

.locale-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.locale-card-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.locale-emoji {
    font-size: 32px;
}

.locale-card-label {
    font-weight: 600;
    color: var(--theme-text-primary);
}

/* ==========================================================================
   PROFILE HEADER & AVATAR
   Source: _profile.css → .profile-header, .avatar, .profile-info
   ========================================================================== */

.profile-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
}

.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--theme-accent) 0%, var(--color-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 32px;
    font-weight: 700;
    flex-shrink: 0;
    font-family: var(--font-family-title);
}

.profile-info h3 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 4px 0;
}

.profile-info p {
    color: var(--theme-text-secondary);
    margin: 0;
}

/* ==========================================================================
   COMPANY LOGO
   Source: _settings-social.css → .company-logo-placeholder, .company-logo-img
   ========================================================================== */

.company-logo-placeholder {
    width: 80px;
    height: 80px;
    border: 2px dashed var(--theme-border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--theme-card-bg);
    flex-shrink: 0;
}

.company-logo-img {
    max-width: 60px;
    max-height: 60px;
    object-fit: contain;
}

/* ==========================================================================
   SOCIAL ICONS
   Source: _settings-social.css → .social-icon, .social-icon-*
   ========================================================================== */

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.social-icon-linkedin {
    background-color: #0077b5;
}

.social-icon-facebook {
    background-color: #1877f2;
}

.social-icon-instagram {
    background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af);
}

.social-icon-google {
    background-color: #4285f4;
}

.social-icon-bing {
    background-color: #00a4ef;
}

/* ==========================================================================
   AVATAR SMALL
   Source: _settings-social.css → .avatar-sm
   ========================================================================== */

.avatar-sm {
    width: 40px;
    height: 40px;
    font-size: 0.875rem;
    font-weight: 600;
}

/* ==========================================================================
   SOCIAL CONNECT BUTTONS
   Source: _settings-social.css → .btn-linkedin, .btn-facebook, etc.
   ========================================================================== */

.btn-linkedin {
    background-color: #0077b5;
    border-color: #0077b5;
    color: white;
}

.btn-linkedin:hover {
    background-color: #005885;
    border-color: #005885;
    color: white;
}

.btn-facebook {
    background-color: #1877f2;
    border-color: #1877f2;
    color: white;
}

.btn-facebook:hover {
    background-color: #0d65d9;
    border-color: #0d65d9;
    color: white;
}

.btn-instagram {
    background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af);
    border: none;
    color: white;
}

.btn-instagram:hover {
    background: linear-gradient(135deg, #e07422, #c4246d, #722b9e);
    color: white;
}

.btn-google {
    background-color: #4285f4;
    border-color: #4285f4;
    color: white;
}

.btn-google:hover {
    background-color: #2a75f3;
    border-color: #2a75f3;
    color: white;
}

.btn-bing {
    background-color: #00a4ef;
    border-color: #00a4ef;
    color: white;
}

.btn-bing:hover {
    background-color: #0090d1;
    border-color: #0090d1;
    color: white;
}

/* ==========================================================================
   ACCORDION CUSTOMIZATION
   Source: _settings-social.css → #socialAccountsAccordion
   ========================================================================== */

#socialAccountsAccordion .accordion-button {
    padding: 1rem 1.25rem;
}

#socialAccountsAccordion .accordion-button:not(.collapsed) {
    background-color: var(--theme-card-bg);
    color: var(--theme-text-primary);
    box-shadow: none;
}

#socialAccountsAccordion .accordion-button:focus {
    box-shadow: none;
    border-color: var(--theme-border-color);
}

#socialAccountsAccordion .accordion-item {
    border-color: var(--theme-border-color);
    background-color: var(--theme-card-bg);
}

#socialAccountsAccordion .accordion-body {
    background-color: var(--theme-card-bg);
}

/* ==========================================================================
   PRIMARY BUTTON
   Source: _buttons.css → .btn-primary-custom
   ========================================================================== */

.btn-primary-custom {
    background: var(--theme-accent);
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 300ms ease-in-out;
    box-shadow: 0 2px 8px rgba(0, 48, 128, 0.2);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary-custom:hover {
    background: var(--color-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(57, 191, 239, 0.3);
    color: #ffffff;
}

.btn-primary-custom:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 48, 128, 0.2);
}

/* ==========================================================================
   UTILITAIRES COULEURS THÈME
   Source: inline styles supprimés (règle AssetMapper)
   ========================================================================== */

.settings-text-secondary {
    color: var(--theme-text-secondary);
}

.settings-text-accent {
    color: var(--theme-accent);
}

/* Label small au-dessus d'un champ (Organisation, ID CFI, etc.) */
.settings-info-label {
    font-size: 0.875rem;
    color: var(--theme-text-secondary);
    margin-bottom: 4px;
}

/* Bouton Enregistrer — taille augmentée pour la CTA principale */
.settings-container .btn-primary-custom {
    padding: 16px 48px;
    font-size: 16px;
}

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

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

    .settings-page-title {
        font-size: 28px;
    }
}
