/* ============================================
   CORESYSTEM - PROFILES.CSS
   ============================================
   Styles pour le module de gestion des profils
   Contient les styles pour la modale de profil,
   l'affichage et l'édition des profils utilisateur,
   les badges, statistiques, réseaux sociaux, etc.
   ============================================ */


        /* ============================================
           STYLES POUR LES LIENS ET RÉSEAUX SOCIAUX
           ============================================ */
        
        /* Styles pour les liens du profil avec transition fluide */
        #profile-website-link,
        #profile-display-socials a {
            color: var(--theme-primary) !important;
            text-decoration: none !important;
            transition: color 0.2s ease, opacity 0.2s ease, background-color 0.2s ease !important;
        }
        
        #profile-website-link:hover,
        #profile-display-socials a:hover {
            color: var(--theme-primary) !important;
            opacity: 0.9 !important;
            background-color: rgba(var(--theme-primary-rgb), 0.1) !important;
        }
        
        #profile-website-link:active,
        #profile-display-socials a:active {
            color: var(--theme-primary) !important;
            opacity: 0.8 !important;
        }
        
        /* Styles pour la liste des réseaux sociaux */
        .profile-social-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 6px;
            padding: 4px 10px;
            background: rgba(var(--theme-primary-rgb), 0.2);
            border: 1px solid var(--theme-primary);
            border-radius: 4px;
            color: #C5D4E0;
            font-size: 13px;
            font-family: "Source Code Pro", monospace;
            width: 100%;
        }
        
        .profile-social-item .social-remove {
            cursor: pointer;
            color: #ff6b6b;
            font-weight: bold;
            font-size: 16px;
            line-height: 1;
            padding: 0 4px;
            transition: color 0.2s;
        }
        
        .profile-social-item .social-remove:hover {
            color: #ff4444;
        }
        
        #profile-social-add-btn:hover {
            background: var(--theme-primary) !important;
            transform: translateY(-1px);
        }
        
        #profile-social-add-btn:active {
            transform: translateY(0);
        }
        
        /* ============================================
           STYLES POUR LES TITRES ET TOOLTIPS
           ============================================ */
        
        /* Styles pour les titres h2 dans les modals - même couleur que le pseudo */
        .modal-content h2,
        .modal h2,
        #modal-title {
            color: var(--theme-primary) !important;
        }
        
        /* Style au survol du niveau dans le titre du profil */
        #profile-modal-title .level-box {
            transition: all 0.3s ease;
            position: relative;
        }
        
        #profile-modal-title .level-box:hover {
            background: rgba(var(--theme-primary-rgb), 0.2) !important;
            border-color: var(--theme-primary) !important;
            transform: scale(1.05);
            box-shadow: 0 0 10px rgba(var(--theme-primary-rgb), 0.4);
        }
        
        /* Style général pour tous les tooltips personnalisés */
        .custom-tooltip,
        .level-tooltip {
            position: absolute;
            bottom: 100%;
            left: 50%;
            transform: translateX(-50%);
            margin-bottom: 8px;
            padding: 10px 14px;
            background: linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(30, 50, 45, 0.9) 50%, rgba(0, 0, 0, 0.85) 100%);
            border: 2px solid var(--theme-primary);
            border-radius: 6px;
            color: var(--theme-primary);
            font-size: 13px;
            font-weight: 600;
            font-family: 'Source Code Pro', monospace;
            white-space: nowrap;
            z-index: 10001;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.3s ease;
            box-shadow: 0 0 20px rgba(var(--theme-primary-rgb), 0.6), 0 0 40px rgba(var(--theme-primary-rgb), 0.3), inset 0 0 15px rgba(var(--theme-primary-rgb), 0.3);
            text-shadow: 0 0 8px rgba(var(--theme-primary-rgb), 0.8);
        }
        
        .custom-tooltip::after,
        .level-tooltip::after {
            content: '';
            position: absolute;
            top: 100%;
            left: 50%;
            transform: translateX(-50%);
            border: 7px solid transparent;
            border-top-color: var(--theme-primary);
            filter: drop-shadow(0 2px 4px rgba(var(--theme-primary-rgb), 0.4));
        }
        
        /* Afficher le tooltip au survol */
        *:hover > .custom-tooltip,
        *:hover > .level-tooltip,
        #profile-modal-title .level-box:hover .level-tooltip {
            opacity: 1;
        }
        
        /* Style pour les éléments avec tooltip personnalisé */
        [data-tooltip] {
            position: relative;
            cursor: help;
        }
        
        /* ============================================
           STYLES UNIFORMISÉS POUR LE PROFIL
           ============================================ */
        
        /* Styles uniformes pour les labels et titres de section - même style */
        .profile-label,
        .profile-section-title,
        label.profile-label,
        h3.profile-section-title {
            color: #C5D4E0 !important;
            font-size: 14px !important;
            font-family: 'Source Code Pro', monospace !important;
            font-weight: 600 !important;
            text-transform: uppercase !important;
            letter-spacing: 0.5px !important;
            line-height: 1.2 !important;
        }
        
        .profile-label,
        label.profile-label {
            margin: 0 0 4px 0 !important;
            padding: 0 !important;
            display: block !important;
        }
        
        .profile-section-title,
        h3.profile-section-title {
            margin-bottom: 8px !important;
        }
        
        /* Styles uniformes pour les champs d'affichage */
        .profile-display-field {
            padding: 8px 10px;
            background: rgba(0, 0, 0, 0.3);
            border: 1px solid rgba(var(--theme-secondary-rgb), 0.3);
            border-radius: 4px;
            color: #C5D4E0;
            font-size: 15px;
            font-family: 'Source Code Pro', monospace;
            transition: all 0.2s ease;
        }
        
        .profile-display-field:hover {
            background: rgba(0, 0, 0, 0.4);
            border-color: rgba(var(--theme-secondary-rgb), 0.5);
        }
        
        /* Styles uniformes pour les sections */
        .profile-section {
            margin-top: 12px;
            padding-top: 12px;
            border-top: 2px solid rgba(var(--theme-secondary-rgb), 0.3);
        }
        
        .profile-section-title {
            margin-bottom: 8px;
        }
        
        /* Styles uniformes pour les cartes de statistiques */
        .profile-stat-card {
            padding: 8px;
            background: rgba(0, 0, 0, 0.3);
            border-radius: 6px;
            border: 1px solid rgba(var(--theme-secondary-rgb), 0.3);
            transition: all 0.2s ease;
        }
        
        .profile-stat-card.clickable {
            cursor: pointer;
        }
        
        .profile-stat-card.clickable:hover {
            background: rgba(0, 0, 0, 0.4);
            border-color: rgba(var(--theme-secondary-rgb), 0.5);
            transform: translateY(-1px);
        }
        
        .profile-stat-label {
            color: #A9BAC9;
            font-size: 10px;
            margin-bottom: 4px;
            font-family: 'Source Code Pro', monospace;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        
        .profile-stat-value {
            color: var(--theme-primary);
            font-size: 18px;
            font-weight: 600;
            font-family: 'Source Code Pro', monospace;
        }
        
        .profile-stat-xp {
            color: var(--theme-primary);
            font-size: 9px;
            font-weight: 600;
            font-family: 'Source Code Pro', monospace;
        }
        
        /* Styles uniformes pour les groupes de formulaire */
        .profile-form-group {
            margin-bottom: 4px;
        }
        
        .profile-form-group label:not(.profile-label) {
            font-size: 11px;
            margin-bottom: 3px;
            color: #A9BAC9;
            font-family: 'Source Code Pro', monospace;
            display: block;
        }
        
        /* Styles uniformes pour les inputs */
        .profile-input {
            padding: 6px 10px;
            font-size: 13px;
            background: white !important;
            background-color: white !important;
            color: #333 !important;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-family: 'Source Code Pro', monospace;
            width: 100%;
            transition: all 0.2s ease;
        }
        
        .profile-input:focus {
            outline: none;
            border-color: var(--theme-primary);
            box-shadow: 0 0 0 2px rgba(var(--theme-primary-rgb), 0.2);
        }
        
        .profile-input:disabled {
            background: #f0f0f0 !important;
            background-color: #f0f0f0 !important;
            color: #666 !important;
            cursor: not-allowed;
        }
        
        /* Styles uniformes pour les petits textes d'aide */
        .profile-help-text {
            color: #A9BAC9;
            font-size: 10px;
            display: block;
            margin-top: 3px;
            font-family: 'Source Code Pro', monospace;
        }
        
        /* Styles uniformes pour les conteneurs de badges */
        .profile-badges-container {
            width: 100%;
            max-width: 500px;
        }
        
        .profile-badges-list {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }
        
        /* Styles uniformes pour les séparateurs */
        .profile-divider {
            height: 2px;
            background: var(--theme-secondary);
            border: none;
            margin: 12px 0;
        }
        
        /* Styles uniformes pour les grilles de statistiques */
        .profile-stats-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 8px;
        }
        
        /* Styles uniformes pour les cartes pleine largeur */
        .profile-stat-card-full {
            grid-column: 1 / -1;
        }
        
        /* Styles uniformes pour les valeurs secondaires */
        .profile-stat-secondary {
            color: #C5D4E0;
            font-size: 13px;
            font-weight: 400;
            font-family: 'Source Code Pro', monospace;
        }
        
        /* Styles uniformes pour les conteneurs flex */
        .profile-flex-row {
            display: flex;
            gap: 10px;
            align-items: stretch;
        }
        
        .profile-flex-col {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        
        /* Styles uniformes pour les images personnalisées */
        .profile-custom-image {
            width: 150px;
            height: 150px;
            flex-shrink: 0;
            border-radius: 6px;
            overflow: hidden;
            border: 2px solid var(--theme-secondary);
            background: rgba(0, 0, 0, 0.3);
        }
        
        .profile-custom-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

/* ============================================
   CLASSES D'ÉTAT (OPTIMISATION JS)
   ============================================ */

/* Utilitaire générique pour masquer proprement avec transition possible */
.hidden-element {
    display: none !important;
}

/* Gestion du basculement Affichage / Édition */
/* Appliqué sur le conteneur principal ou la modale */
.profile-modal-container.is-editing .profile-view-only {
    display: none !important;
}

.profile-modal-container:not(.is-editing) .profile-edit-only {
    display: none !important;
}

/* États pour les images personnalisées */
.profile-custom-image-container.has-error {
    display: none !important;
}

/* Animation douce pour l'apparition des éléments */
.fade-in-element {
    animation: profileFadeIn 0.3s ease-out forwards;
}

@keyframes profileFadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   EFFET "DOUBLE MODALE" CÔTE À CÔTE
   ============================================ */

/* Rendre le conteneur principal de la modale profil transparent */
#profile-modal .modal-content {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 1000px !important;
    width: 95% !important;
    gap: 0 !important;
    overflow: visible !important;
}

/* Style répliqué de .modal-content pour les sous-blocs */
.profile-modal-sub-block {
    background: linear-gradient(135deg, rgba(var(--theme-primary-rgb), 0.25) 0%, rgba(var(--theme-secondary-rgb), 0.2) 50%, rgba(var(--theme-primary-rgb), 0.25) 100%);
    border-radius: 10px;
    padding: 25px;
    border: 2px solid var(--theme-primary);
    box-shadow: 
        0 0 15px rgba(var(--theme-primary-rgb), 0.2),
        0 0 30px rgba(var(--theme-secondary-rgb), 0.1),
        inset 0 0 15px rgba(var(--theme-primary-rgb), 0.05),
        inset 0 0 0 2px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: profileHologramPulse 3s ease-in-out infinite, crtFlicker 0.15s infinite;
    pointer-events: auto;
}

/* Effet Scanline (répliqué de .modal-content::after) */
.profile-modal-sub-block::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(var(--theme-primary-rgb), 0.05) 2px,
        rgba(var(--theme-primary-rgb), 0.05) 4px
    );
    pointer-events: none;
    z-index: 0;
    border-radius: 8px;
}

.profile-display-grid {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    width: 100%;
    margin-top: 20px;
}

.profile-main-column {
    flex: 1.2;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.profile-stats-column {
    flex: 0.8;
    min-width: 300px;
}

/* Ajustement du bouton de fermeture car le parent est transparent */
#profile-modal .modal-close {
    top: -10px !important;
    right: -10px !important;
}

/* Header au-dessus des blocs */
.profile-header-container {
    margin-bottom: 30px;
    padding: 0 10px;
    width: 100%;
}

.profile-block-label {
    font-family: 'Source Code Pro', monospace;
    font-size: 14px;
    font-weight: 700;
    color: var(--theme-primary);
    letter-spacing: 2px;
    margin-bottom: 12px;
    padding-left: 5px;
    text-shadow: 0 0 4px rgba(var(--theme-primary-rgb), 0.4);
    opacity: 0.9;
}

/* Animation de pulse plus douce pour le profil multi-blocs */
@keyframes profileHologramPulse {
    0%, 100% {
        box-shadow: 
            0 0 15px rgba(var(--theme-primary-rgb), 0.2),
            0 0 30px rgba(var(--theme-secondary-rgb), 0.1),
            inset 0 0 15px rgba(var(--theme-primary-rgb), 0.05),
            inset 0 0 0 2px rgba(0, 0, 0, 0.3);
        border-color: var(--theme-primary);
    }
    50% {
        box-shadow: 
            0 0 25px rgba(var(--theme-primary-rgb), 0.35),
            0 0 50px rgba(var(--theme-secondary-rgb), 0.2),
            inset 0 0 25px rgba(var(--theme-primary-rgb), 0.1),
            inset 0 0 0 2px rgba(0, 0, 0, 0.3);
        border-color: rgba(var(--theme-primary-rgb), 0.7);
    }
}

/* Ajustements pour les écrans plus petits (empilement) */
@media (max-width: 900px) {
    .profile-display-grid {
        flex-direction: column;
        gap: 20px;
    }
    
    .profile-stats-column {
        width: 100%;
        min-width: 0;
    }
}
/* ============================================
   SECTION RECORDS DE JEU
   ============================================ */

.game-record-item {
    background: rgba(0, 0, 0, 0.25) !important;
    border: 1px solid rgba(var(--theme-primary-rgb), 0.2) !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    transition: all 0.3s ease !important;
    position: relative;
    overflow: hidden;
}

.game-record-item:hover {
    background: rgba(var(--theme-primary-rgb), 0.1) !important;
    border-color: rgba(var(--theme-primary-rgb), 0.5) !important;
    box-shadow: 0 0 15px rgba(var(--theme-primary-rgb), 0.15);
    transform: translateY(-2px);
}

.game-record-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(var(--theme-primary-rgb), 0.3), transparent);
}

.game-record-item div:first-child {
    filter: drop-shadow(0 0 5px rgba(var(--theme-primary-rgb), 0.4));
}

/* ============================================
   BOUTONS D'ACTION DU PROFIL (MODIFIER / DÉCONNEXION)
   ============================================ */

#profile-edit-btn,
#profile-logout-btn {
    height: 32px !important;
    padding: 0 16px !important;
    font-size: 11px !important;
    font-family: var(--interface-font-main), var(--interface-font-mono) !important;
    font-weight: 700 !important;
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    width: auto !important;
    min-width: auto !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(var(--theme-primary-rgb), 0.3) !important;
}

/* Style spécifique pour le bouton Modifier (Couleur Primaire) */
#profile-edit-btn {
    background: rgba(var(--theme-primary-rgb), 0.9) !important;
    color: white !important;
    margin: 0 50px 0 0 !important; /* Marge à droite pour éviter le bouton de fermeture */
}

#profile-edit-btn:hover {
    background: rgba(var(--theme-primary-rgb), 1) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 15px rgba(var(--theme-primary-rgb), 0.4) !important;
}

/* Style spécifique pour le bouton Déconnexion (Couleur Secondaire/Rouge) */
#profile-logout-btn {
    background: rgba(40, 45, 51, 0.8) !important;
    color: #A9BAC9 !important;
    border-color: rgba(255, 107, 107, 0.3) !important;
    margin: 0 10px 0 0 !important;
}

#profile-logout-btn:hover {
    background: rgba(255, 107, 107, 0.2) !important;
    color: #ff6b6b !important;
    border-color: #ff6b6b !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.2) !important;
}

#profile-edit-btn:active,
#profile-logout-btn:active {
    transform: translateY(0) !important;
}
