/**
 * Component - Profile
 * Copie fidèle du design system myCFiA
 * Sources :
 *   _content.css  → .content, .profile-grid
 *   _cards.css    → .section, .section-header, .pref-cards, .pref-card, .stat-card
 *   _profile.css  → .info-table, .stats-grid, .permissions-grid, .permission-list
 *   _fab.css      → .fab-back, .fab-tooltip
 * Tokens : DS → Projet
 *   --color-primary → --theme-accent
 *   --bg-card       → --theme-card-bg
 *   --text-secondary → --theme-text-secondary
 *   --border        → --theme-border-color
 *   --bg-primary    → --theme-bg-primary
 *   --shadow-sm-light → --theme-shadow
 *   --shadow-lg-light → --theme-shadow-lg
 *   --transition-base → --transition-normal
 *   valeurs numériques DS conservées telles quelles
 */

/* ==========================================================================
   CONTAINER
   Source : _content.css .content
   max-width: 1400px; margin: 0 auto; padding: 40px 30px
   align-self: stretch : nécessaire car .home-content a align-items: center
   ========================================================================== */
.profile-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px var(--space-xxl) 100px;
}

/* ==========================================================================
   PAGE HEADER
   Source : profile_light.html (inline styles)
   text-align: center; margin-bottom: 40px
   h1 : font-size: 36px; font-weight: 800; color: var(--color-primary); margin-bottom: 8px
   p : font-size: 18px; color: var(--text-secondary)
   ========================================================================== */
.profile-page-header {
    text-align: center;
    margin-bottom: 40px;
}

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

.profile-page-header > p {
    font-size: var(--font-size-lg);
    color: var(--theme-text-secondary);
    margin: 0;
}

/* ==========================================================================
   PROFILE GRID
   Source : _content.css .profile-grid
   display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-bottom: 24px
   ========================================================================== */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

/* Colonne droite
   Source : profile_light.html (inline style)
   display: flex; flex-direction: column; gap: 24px
   ========================================================================== */
.profile-col-right {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ==========================================================================
   SECTION
   Source : _cards.css .section
   background: var(--bg-card); backdrop-filter: blur(20px);
   border-radius: 16px (border-radius-xl); padding: 30px (padding-card);
   margin-bottom: 24px (margin-section-bottom);
   border: 1px solid var(--border); box-shadow: shadow-sm-light
   ========================================================================== */
.profile-section {
    background: var(--theme-card-bg);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: var(--space-xxl);
    margin-bottom: 24px;
    border: 1px solid var(--theme-border-color);
    box-shadow: var(--theme-shadow);
}

/* Dans grid/col-right : le gap gère l'espacement, margin-bottom annulé */
.profile-grid .profile-section,
.profile-col-right .profile-section {
    margin-bottom: 0;
}

/* Source : _cards.css .section:last-child */
.profile-section:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   SECTION HEADER
   Source : _cards.css .section-header
   display: flex; align-items: center; gap: 12px (gap-sm);
   margin-bottom: 24px (gap-lg); padding-bottom: 16px (spacing-lg);
   border-bottom: 2px solid var(--bg-primary)
   ========================================================================== */
.profile-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--theme-bg-primary);
}

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

/* Source : _cards.css .section-header h2
   font-size: 20px (font-size-xl DS); font-weight: bold; color: var(--color-primary)
   ========================================================================== */
.profile-section-header h2 {
    font-size: 20px;
    font-weight: var(--font-weight-bold);
    color: var(--theme-accent);
    margin: 0;
}

/* ==========================================================================
   INFO TABLE
   Source : _profile.css .info-table
   ========================================================================== */
.profile-info-table {
    width: 100%;
}

.profile-info-table tr {
    border-bottom: 1px solid var(--theme-border-color);
}

.profile-info-table tr:last-child {
    border-bottom: none;
}

/* padding: 16px (spacing-lg) 0 */
.profile-info-table td {
    padding: 16px 0;
}

/* color: var(--text-secondary); width: 40%; font-weight: 500 (font-weight-medium) */
.profile-info-table td:first-child {
    color: var(--theme-text-secondary);
    width: 40%;
    font-weight: 500;
}

.profile-info-table td:last-child {
    font-weight: var(--font-weight-semibold);
}

/* background: rgba(0, 48, 128, 0.1); color: var(--color-secondary);
   padding: 4px (spacing-xs) 8px (spacing-sm);
   border-radius: 4px (border-radius-sm); font-family: monospace */
.profile-info-table code {
    background: rgba(0, 48, 128, 0.1);
    color: var(--color-secondary);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-family: monospace;
}

/* ==========================================================================
   PREF CARDS
   Source : _cards.css .pref-cards
   display: flex; flex-wrap: wrap; gap: 16px (gap-md); justify-content: center
   ========================================================================== */
.profile-pref-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}

/* ==========================================================================
   PREF CARD
   Source : _cards.css .pref-card
   background: rgba(0, 48, 128, 0.05); border: 2px solid var(--border);
   border-radius: 12px (border-radius-lg); padding: 16px (spacing-lg) 20px (spacing-xl);
   display: flex; align-items: center; gap: 12px (gap-sm);
   transition: all var(--transition-base) ease-in-out
   ========================================================================== */
.profile-pref-card {
    background: rgba(0, 48, 128, 0.05);
    border: 2px solid var(--theme-border-color);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all var(--transition-normal);
}

.profile-pref-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--theme-shadow-lg);
    border-color: var(--color-secondary);
}

/* font-size: 24px (font-size-2xl DS); color: var(--color-primary) */
.profile-pref-card i {
    font-size: 24px;
    color: var(--theme-accent);
}

/* font-size: 18px (font-size-lg); font-weight: semibold; color: var(--color-primary) */
.profile-pref-card span {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--theme-accent);
}

/* Emoji (drapeau) — inline font-size: 28px dans profile_light.html */
.profile-pref-emoji {
    font-size: 28px;
}

/* Source : _cards.css .pref-card.clickable
   cursor: pointer; border-color: var(--color-primary) */
.profile-pref-clickable {
    cursor: pointer;
    text-decoration: none;
    border-color: var(--theme-accent);
}

.profile-pref-clickable:hover {
    background: rgba(0, 48, 128, 0.1);
}

/* ==========================================================================
   STATS GRID
   Source : _profile.css .stats-grid
   display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px (gap-sm)
   ========================================================================== */
.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* ==========================================================================
   STAT CARD
   Source : _profile.css .stat-card
   background: var(--bg-card); border: 2px solid var(--border);
   border-radius: 12px (border-radius-lg); padding: 16px (spacing-lg);
   text-align: center; transition
   ========================================================================== */
.profile-stat-card {
    background: var(--theme-card-bg);
    border: 2px solid var(--theme-border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    text-align: center;
    transition: all var(--transition-normal);
}

.profile-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--theme-shadow-lg);
    border-color: var(--color-secondary);
}

/* display: block; color: var(--text-secondary);
   font-size: 12px (font-size-sm DS); margin-bottom: 8px (spacing-sm);
   text-transform: uppercase; letter-spacing: 0.5px (letter-spacing-wide) */
.profile-stat-card small {
    display: block;
    color: var(--theme-text-secondary);
    font-size: 12px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* font-size: 18px (font-size-lg); font-weight: bold; color: var(--color-primary) */
.profile-stat-card h3 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--theme-accent);
    margin: 0;
}

/* font-size: 11px (font-size-xs DS); color: var(--text-secondary);
   margin-top: 4px (spacing-xs) */
.profile-stat-detail {
    font-size: 11px;
    color: var(--theme-text-secondary);
    margin-top: 4px;
}

/* ==========================================================================
   PERMISSIONS GRID
   Source : _profile.css .permissions-grid
   display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
   gap: 24px (gap-lg)
   ========================================================================== */
.profile-permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

/* font-size: 16px (font-size-md); font-weight: semibold; color: var(--text-secondary);
   margin-bottom: 16px (spacing-lg); display: flex; align-items: center; gap: 8px (spacing-sm) */
.profile-permission-category h3 {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    color: var(--theme-text-secondary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==========================================================================
   PERMISSION LIST
   Source : _profile.css .permission-list
   ========================================================================== */
.profile-permission-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* padding: 8px (spacing-sm) 0; display: flex; align-items: center;
   gap: 8px (spacing-sm); font-size: 14px (font-size-base DS) */
.profile-permission-list li {
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

/* font-size: 16px (font-size-md) */
.profile-permission-list li i {
    font-size: var(--font-size-md);
    flex-shrink: 0;
}

/* ==========================================================================
   FAB
   Source : _fab.css .fab-back
   position: fixed; bottom: 32px (spacing-4xl); right: 32px;
   background: var(--color-primary); color: var(--white);
   width: 56px; height: 56px; border-radius: full;
   display: flex; align-items: center; justify-content: center;
   font-size: 24px (font-size-2xl); cursor: pointer;
   box-shadow: 0 4px 12px rgba(0, 48, 128, 0.3) (shadow-fab);
   z-index: 1200
   ========================================================================== */
.profile-fab {
    position: fixed;
    bottom: 32px;
    right: 32px;
    background: var(--theme-accent);
    color: var(--color-white);
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 48, 128, 0.3);
    transition: all var(--transition-normal);
    z-index: 1200;
    text-decoration: none;
}

/* hover: background: var(--color-secondary);
   box-shadow: 0 6px 20px rgba(57, 191, 239, 0.4) (shadow-fab-hover) */
.profile-fab:hover {
    background: var(--color-secondary);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(57, 191, 239, 0.4);
    color: var(--color-white);
}

.profile-fab:active {
    transform: scale(0.95);
}

/* ==========================================================================
   FAB TOOLTIP
   Source : _fab.css .fab-tooltip
   position: absolute; right: 64px;
   background: rgba(0, 0, 0, 0.8) (black-alpha-80); color: var(--white);
   padding: 8px (spacing-sm) 16px (spacing-lg);
   border-radius: 8px (border-radius-md); font-size: 14px (font-size-base DS);
   white-space: nowrap; opacity: 0; pointer-events: none
   ========================================================================== */
.profile-fab-tooltip {
    position: absolute;
    right: 64px;
    background: rgba(0, 0, 0, 0.8);
    color: var(--color-white);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.profile-fab:hover .profile-fab-tooltip {
    opacity: 1;
}

/* ==========================================================================
   RESPONSIVE
   Source : _content.css (profile-grid) + _fab.css
   ========================================================================== */
@media (max-width: 992px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .profile-container {
        padding: 16px var(--space-md) 80px;
    }

    .profile-fab {
        width: 48px;
        height: 48px;
        font-size: 20px;
        bottom: 20px;
        right: 20px;
    }

    .profile-fab-tooltip {
        display: none;
    }
}
