/* ──────────────────────────────────────────────────
 * profil.css — Style UI avec Intégration Mobile Bord à Bord
 * Palette : Or (#d4af37), Noir (#111111) & Blanc (#ffffff)
 * ────────────────────────────────────────────────── */

:root {
    --profil-bg: #f5f5f7;
    --profil-card-bg: #ffffff;
    
    /* Couleurs Dorées (Gold) */
    --profil-gold: #d4af37;
    --profil-gold-hover: #b89628;
    --profil-gold-light: #fbf7e8;
    --profil-gold-border: #e6d598;

    /* Textes et Accent Noir */
    --profil-text-primary: #111111;
    --profil-text-secondary: #666666;
    --profil-border: #e2e8f0;
    --profil-danger: #dc2626;
    --radius-main: 12px;
}

body {
    background-color: var(--profil-bg);
}

/* Page Non Authentifié */
.profil-not-auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    padding: 20px;
}

.not-auth-card {
    background: var(--profil-card-bg);
    padding: 40px;
    border-radius: var(--radius-main);
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    max-width: 400px;
    width: 100%;
    border: 1px solid var(--profil-border);
}

.not-auth-card .lock-icon {
    font-size: 48px;
    color: var(--profil-gold);
    margin-bottom: 16px;
}

.btn-primary-custom {
    display: inline-block;
    background: var(--profil-text-primary);
    color: #fff;
    padding: 10px 24px;
    border-radius: 20px;
    text-decoration: none;
    margin-top: 15px;
    font-weight: 600;
    transition: background 0.2s, color 0.2s;
    border: none;
    cursor: pointer;
}

.btn-primary-custom:hover {
    background: var(--profil-gold);
    color: #111;
}

.btn-link-custom {
    background: transparent;
    border: none;
    color: var(--profil-text-primary);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    font-size: 13px;
}

/* Wrapper principal & Desktop Layout */
.profil-wrapper {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 15px;
}

.whatsapp-layout {
    display: flex;
    background: var(--profil-card-bg);
    border-radius: var(--radius-main);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    min-height: 650px;
    overflow: hidden;
    border: 1px solid var(--profil-border);
}

/* Sidebar Navigation (Gauche) */
.profil-sidebar {
    width: 320px;
    background: #fafafa;
    border-right: 1px solid var(--profil-border);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    flex-shrink: 0;
}

.sidebar-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px 20px 20px;
    border-bottom: 1px solid var(--profil-border);
}

.avatar-container {
    position: relative;
    margin-bottom: 12px;
}

.avatar-circle {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--profil-text-primary);
    color: var(--profil-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: bold;
    overflow: hidden;
    position: relative;
    border: 2px solid var(--profil-gold);
}

.avatar-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Badge icône d'édition (Crayon) */
.avatar-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    background: var(--profil-text-primary);
    color: var(--profil-gold);
    border: 2px solid #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
}

.avatar-badge:hover {
    background: var(--profil-gold);
    color: #111;
}

.user-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--profil-text-primary);
    margin: 4px 0 2px 0;
}

.user-handle {
    font-size: 13px;
    color: var(--profil-text-secondary);
}

.role-badge {
    display: inline-block;
    background: var(--profil-gold-light);
    color: var(--profil-gold-hover);
    border: 1px solid var(--profil-gold-border);
    font-size: 11px;
    text-transform: uppercase;
    padding: 3px 12px;
    border-radius: 12px;
    margin-top: 8px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Nav Menu */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    margin-top: 15px;
    flex-grow: 1;
}

.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    padding: 14px 24px;
    color: var(--profil-text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 4px solid transparent;
}

.sidebar-nav .nav-item i {
    font-size: 16px;
    margin-right: 15px;
    width: 20px;
    text-align: center;
}

.sidebar-nav .nav-item:hover {
    background: #f0f0f0;
    color: var(--profil-text-primary);
}

.sidebar-nav .nav-item.active {
    background: #ffffff;
    color: var(--profil-text-primary);
    border-left-color: var(--profil-gold);
    font-weight: 700;
}

.sidebar-nav .nav-item.active i {
    color: var(--profil-gold);
}

.sidebar-footer {
    padding: 0 20px;
}

.btn-logout {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--profil-border);
    border-radius: 8px;
    color: var(--profil-danger);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-logout:hover {
    background: #fef2f2;
}

/* Panneau principal */
.profil-main {
    flex-grow: 1;
    padding: 35px 40px;
    background: var(--profil-card-bg);
}

.profil-panel {
    display: none;
}

.profil-panel.active {
    display: block;
}

.panel-header {
    margin-bottom: 25px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--profil-border);
}

.panel-header h2 {
    font-size: 22px;
    color: var(--profil-text-primary);
    margin: 0 0 4px 0;
    font-weight: 700;
}

.panel-header p {
    color: var(--profil-text-secondary);
    font-size: 13px;
    margin: 0;
}

/* Grille Formulaire d'information */
.profil-info-display-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--profil-text-primary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--profil-border);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border 0.2s;
    box-sizing: border-box;
}

.form-input:focus {
    border-color: var(--profil-gold);
}

.form-input:disabled {
    background: #f5f5f5;
    color: var(--profil-text-secondary);
}

.form-help {
    font-size: 11px;
    color: var(--profil-text-secondary);
    margin-top: 4px;
    display: block;
}

.d-grid {
    display: grid;
}

.gap-2 {
    gap: 0.5rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.me-1 {
    margin-right: 0.25rem;
}

/* Grille de stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.stat-card {
    background: #fafafa;
    border: 1px solid var(--profil-border);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: var(--profil-text-primary);
    color: var(--profil-gold);
}

.stat-number {
    font-size: 20px;
    font-weight: 700;
    display: block;
    color: var(--profil-text-primary);
}

.stat-label {
    font-size: 12px;
    color: var(--profil-text-secondary);
}

/* Carte de la candidate votée */
.voted-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 16px;
    background: var(--profil-gold-light);
    border: 1px solid var(--profil-gold-border);
    border-radius: 10px;
}

.voted-card img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--profil-gold);
}

.voted-card .lbl {
    font-size: 11px;
    color: var(--profil-gold-hover);
    text-transform: uppercase;
    font-weight: 700;
}

.voted-card .nom {
    font-size: 15px;
    font-weight: 700;
    color: var(--profil-text-primary);
}

/* Timeline des activités */
.activity-feed {
    margin-top: 30px;
}

.activity-feed h3 {
    font-size: 15px;
    margin-bottom: 12px;
    font-weight: 700;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--profil-border);
}

.icon-act { 
    font-size: 16px; 
    color: var(--profil-gold);
}

.act-info {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    color: var(--profil-text-primary);
}

.act-info small {
    color: var(--profil-text-secondary);
    font-size: 11px;
}

/* Sécurité & Session */
.security-card {
    background: #fafafa;
    border: 1px solid var(--profil-border);
    border-radius: 10px;
    padding: 20px;
}

.sec-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.divider {
    border: 0;
    border-top: 1px solid var(--profil-border);
    margin: 15px 0;
}

.btn-vote-link {
    background: var(--profil-text-primary);
    color: var(--profil-gold);
    border: 1px solid var(--profil-gold);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
    display: inline-block;
}

.btn-vote-link:hover {
    background: var(--profil-gold);
    color: #111111;
}

/* Options Bottom Sheet Avatar */
.avatar-menu-list {
    display: flex;
    flex-direction: column;
    padding: 10px 16px 20px;
}

.avatar-menu-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 12px;
    background: none;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    font-size: 15px;
    font-weight: 600;
    color: var(--profil-text-primary);
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: background 0.15s;
}

.avatar-menu-item:hover {
    background: #f8f9fa;
}

.avatar-menu-item i {
    font-size: 20px;
    width: 24px;
    color: var(--profil-gold);
    text-align: center;
}

.avatar-menu-item.danger {
    color: var(--profil-danger);
    border-bottom: none;
}

.avatar-menu-item.danger i {
    color: var(--profil-danger);
}

.skel { opacity: 0.3; }

/* ──────────────────────────────────────────────────
 * ADAPTATION MOBILE (Plein écran & Espace de sécurité bas)
 * ────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
    .profil-wrapper.full-mobile-width {
        width: 100vw !important;
        max-width: 100vw !important;
        margin-left: calc(50% - 50vw) !important;
        margin-right: calc(50% - 50vw) !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        box-sizing: border-box;
    }

    .whatsapp-layout {
        flex-direction: column;
        border-radius: 0 !important;
        border: none !important;
        box-shadow: none !important;
        min-height: 100vh;
    }

    .profil-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--profil-border);
        padding-top: 15px;
    }

    .sidebar-nav {
        flex-direction: row;
        justify-content: space-around;
        margin-top: 10px;
    }

    .sidebar-nav .nav-item {
        padding: 12px;
        border-left: none;
        border-bottom: 3px solid transparent;
        font-size: 0;
    }

    .sidebar-nav .nav-item i {
        font-size: 20px;
        margin-right: 0;
    }

    .sidebar-nav .nav-item.active {
        border-left-color: transparent;
        border-bottom-color: var(--profil-gold);
        background: transparent;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .profil-info-display-grid {
        grid-template-columns: 1fr;
    }

    /* ── ESPACE DE SÉCURITÉ MOBILE (Empêche les boutons de se cacher sous le Nav du bas) ── */
    .profil-main {
        padding: 20px 16px 110px 16px !important; /* Dégage une marge de 110px au bas */
    }

    .d-grid,
    .security-card,
    #pwd-reset-wrap {
        margin-bottom: 25px;
    }

    #btn-save-infos,
    .btn-primary-custom,
    .btn-vote-link {
        position: relative;
        z-index: 5;
    }
}