/* ============================================
   CORESYSTEM - AUTH.CSS
   ============================================
   Styles pour le module d'authentification
   Contient les styles pour la modale d'authentification,
   les boutons de connexion/inscription, et les formulaires
   ============================================ */

/* ============================================
   STYLES D'AUTHENTIFICATION
   ============================================ */

/* Les styles de navigation auth ont été déplacés dans coreSystem/interface.css */

.hidden {
    display: none !important;
}

/* Style pour la scrollbar de la liste des pseudos */
.username-list-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: rgba(169, 186, 201, 0.5) rgba(0, 0, 0, 0.1);
}

.username-list-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.username-list-scrollbar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.username-list-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(169, 186, 201, 0.5);
    border-radius: 4px;
    transition: background 0.3s;
}

.username-list-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(169, 186, 201, 0.7);
}

/* Désactiver les pointer-events pour l'avatar afin de permettre l'interaction avec le contenu derrière */
#avatar-preview-container,
#avatar-preview-container * {
    pointer-events: none !important;
}

/* Les animations sont maintenant définies dans index.html */

/* Modale d'authentification - Utilise le style commun */
.modal {
    /* Le style de base est défini dans index.html */
    z-index: 10000;
}

.modal-content {
    background: linear-gradient(135deg, rgba(49, 176, 134, 0.25) 0%, rgba(116, 157, 145, 0.2) 50%, rgba(49, 176, 134, 0.25) 100%);
    padding: 30px;
    border-radius: 10px;
    max-width: 90%;
    max-height: none;
    width: auto;
    height: auto;
    min-width: 300px;
    position: relative;
    border: 2px solid #31b086;
    box-shadow: 
        0 0 30px rgba(49, 176, 134, 0.3),
        0 0 60px rgba(116, 157, 145, 0.2),
        inset 0 0 30px rgba(49, 176, 134, 0.1),
        inset 0 0 0 2px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    animation: hologramPulse 3s ease-in-out infinite, crtFlicker 0.15s infinite;
    overflow: visible;
}

.modal-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(49, 176, 134, 0.03) 2px,
        rgba(49, 176, 134, 0.03) 4px
    );
    pointer-events: none;
    z-index: 0;
}

@keyframes crtFlicker {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.98;
    }
}

@keyframes hologramPulse {
    0%, 100% {
        box-shadow: 
            0 0 30px rgba(49, 176, 134, 0.3),
            0 0 60px rgba(116, 157, 145, 0.2),
            inset 0 0 30px rgba(49, 176, 134, 0.1),
            inset 0 0 0 2px rgba(0, 0, 0, 0.3);
        border-color: #31b086;
    }
    50% {
        box-shadow: 
            0 0 40px rgba(49, 176, 134, 0.5),
            0 0 80px rgba(116, 157, 145, 0.3),
            inset 0 0 40px rgba(49, 176, 134, 0.15),
            inset 0 0 0 2px rgba(0, 0, 0, 0.3);
        border-color: rgba(49, 176, 134, 0.8);
    }
}

.modal-content .close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 32px;
    font-weight: bold;
    color: rgba(49, 176, 134, 0.9);
    cursor: pointer;
    z-index: 10001;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #31b086;
    box-shadow: 0 0 15px rgba(49, 176, 134, 0.3);
    transition: all 0.3s;
}

.modal-content .close:hover {
    background: rgba(49, 176, 134, 0.2);
    color: #31b086;
    box-shadow: 0 0 25px rgba(49, 176, 134, 0.6);
    border-color: rgba(49, 176, 134, 0.9);
    transform: scale(1.1);
}

.modal-content h2 {
    margin-bottom: 20px;
    color: rgba(49, 176, 134, 0.9);
    font-family: "Orbitron", "Source Code Pro", monospace;
    text-shadow: 0 0 10px rgba(49, 176, 134, 0.5);
    position: relative;
    z-index: 1;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: rgba(197, 212, 224, 0.9);
    font-size: 0.9em;
    font-family: "Source Code Pro", monospace;
    position: relative;
    z-index: 1;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 2px solid #749d91;
    border-radius: 4px;
    font-size: 0.95em;
    transition: border-color 0.3s;
    background: white !important;
    background-color: white !important;
    color: #333 !important;
    -webkit-box-shadow: 0 0 0 30px white inset !important;
    box-shadow: 0 0 0 30px white inset !important;
    font-family: Arial, sans-serif;
}

#auth-form-fields {
    max-width: 400px;
    margin: 0 auto;
}

.form-group input:focus {
    outline: none;
    border-color: #31b086;
    background: white !important;
    background-color: white !important;
    color: #333 !important;
    box-shadow: 0 0 10px rgba(49, 176, 134, 0.3);
}

.modal-content .btn {
    width: 100%;
    padding: 12px;
    border: 2px solid #31b086;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: "Source Code Pro", "Orbitron", monospace;
    margin-top: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.modal-content .btn-primary {
    background: rgba(49, 176, 134, 0.95);
    border: 2px solid #31b086;
    color: white;
    box-shadow: 
        0 4px 6px rgba(0, 0, 0, 0.3),
        0 0 15px rgba(49, 176, 134, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.modal-content .btn-primary:hover {
    background: rgba(49, 176, 134, 1);
    border-color: #2a9d75;
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.4),
        0 0 25px rgba(49, 176, 134, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.modal-content a {
    color: #fff !important;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease, text-decoration 0.3s ease;
}

.modal-content a:hover {
    color: #31b086 !important;
    text-decoration: underline;
}

.modal-content a:visited {
    color: #fff !important;
}

.modal-content a:active {
    color: #31b086 !important;
}

/* Messages de notification */
.message {
    padding: 15px;
    margin: 20px 0;
    border-radius: 5px;
    text-align: center;
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 99999; /* Z-index très élevé pour être au-dessus de toutes les modales */
    min-width: 200px;
    font-family: Arial, sans-serif;
    font-weight: bold;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Les styles des boutons de zoom ont été centralisés dans coreSystem/interface.css */

/* ============================================
   STYLES POUR L'ÉDITEUR D'AVATAR DANS LA MODALE
   ============================================ */

#avatar-editor-section {
    border: 2px solid #31b086;
    border-radius: 8px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    margin-right: 0;
}

#avatar-preview-external {
    border: 2px solid #31b086;
    border-radius: 8px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    margin-left: 20px;
}

#auth-form-content {
    display: flex;
    gap: 20px;
    align-items: center;
}

#auth-form-fields {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#avatar-editor-section {
    flex: 0 0 300px;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#avatar-preview-container {
    min-height: 200px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#avatar-layers-preview {
    height: 100%;
    overflow-y: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

#avatar-layers-preview::-webkit-scrollbar {
    width: 6px;
}

#avatar-layers-preview::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

#avatar-layers-preview::-webkit-scrollbar-thumb {
    background: #31b086;
    border-radius: 3px;
}

#avatar-layers-preview::-webkit-scrollbar-thumb:hover {
    background: #2a9d75;
}

.avatar-item-preview {
    transition: all 0.3s ease;
}

.avatar-item-preview:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(49, 176, 134, 0.5);
}

.avatar-item-preview.selected {
    box-shadow: 0 0 15px rgba(49, 176, 134, 0.8);
}

/* Animation de respiration pour l'aperçu de l'avatar */
@keyframes breathing {
    0%, 100% {
        transform: scaleY(1);
        filter: brightness(1);
    }
    50% {
        transform: scaleY(1.02);
        filter: brightness(1.05);
    }
}

#avatar-preview-container {
    animation: breathing 4s ease-in-out infinite;
    transform-origin: bottom center;
}

#avatar-preview-container img {
    animation: breathing 4s ease-in-out infinite;
    animation-delay: 0.1s;
    transform-origin: bottom center;
}
