/* === STYLES AUTHENTIFICATION === */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.auth-modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: authModalSlide 0.3s ease-out;
}

@keyframes authModalSlide {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.auth-header {
    text-align: center;
    margin-bottom: 25px;
}

.auth-header h2 {
    margin: 0 0 5px 0;
    color: #2c3e50;
    font-size: 1.5em;
}

.auth-header p {
    margin: 0;
    color: #7f8c8d;
    font-size: 0.9em;
}

.auth-error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 0.9em;
}

.auth-field {
    margin-bottom: 20px;
}

.auth-field label {
    display: block;
    margin-bottom: 5px;
    color: #2c3e50;
    font-weight: 500;
    font-size: 0.9em;
}

.auth-field input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.auth-field input:focus {
    outline: none;
    border-color: #3498db;
}

.auth-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.auth-btn.primary {
    background: #3498db;
    color: white;
}

.auth-btn.primary:hover:not(:disabled) {
    background: #2980b9;
}

.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-footer {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e1e8ed;
    font-size: 0.85em;
    color: #7f8c8d;
}

.auth-footer p {
    margin: 5px 0;
}

.auth-footer code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Monaco', 'Courier New', monospace;
    color: #2c3e50;
}

.auth-footer .warning {
    color: #e67e22;
    font-weight: 500;
    margin-top: 10px;
}

.user-indicator {
    position: fixed;
    top: 80px;
    right: 20px;
    background: white;
    padding: 10px 15px;
    border-radius: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    font-size: 0.9em;
    border: 1px solid #e1e8ed;
}

.logout-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    cursor: pointer;
    transition: background-color 0.3s;
}

.logout-btn:hover {
    background: #c0392b;
}

.auth-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 20px;
    border-radius: 6px;
    color: white;
    z-index: 999999;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.auth-toast-success { background: #27ae60; }
.auth-toast-error { background: #e74c3c; }
.auth-toast-info { background: #3498db; }

.spinner { animation: spin 1s linear infinite; }

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* === MODAL D'ÉDITION === */
#edit-user-modal .modal-content {
    max-width: 600px;
    width: 90%;
}

.form-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.form-section h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1rem;
    font-weight: 600;
}

.form-row {
    margin-bottom: 20px;
}

.form-row label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 500;
    font-size: 0.95rem;
}

.form-row input,
.form-row select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.form-row input:focus,
.form-row select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-row input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

/* === MODAL RESPONSIVE === */
@media (max-width: 768px) {
    #edit-user-modal .modal-content {
        width: 95%;
        margin: 20px auto;
    }
    
    .form-row input,
    .form-row select {
        font-size: 16px; /* Évite le zoom sur mobile */
    }
}

/* === ANIMATIONS === */
@keyframes modalFadeIn {
    from { 
        opacity: 0;
        transform: scale(0.9);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

.modal-content {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from { 
        transform: translateY(-50px);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}

/* === AMÉLIORATION DU DESIGN === */
.modal-header {
    background: #303D4E;
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    color: white;
}

.modal-close {
    background: #303D4E;
    color: #94a3b8;
    opacity: 0.8;
}

.modal-close:hover {
    opacity: 1;
    background: #303D4E;
}

.modal-footer {
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

/* === INDICATEURS DE VALIDATION === */
.form-row input:invalid:not(:focus) {
    border-color: #e74c3c;
}

.form-row input:valid:not(:placeholder-shown) {
    border-color: #27ae60;
}

/* === STYLES POUR LES GROUPES DE CHAMPS === */
.form-row label[for*="password"] {
    color: #e67e22;
}

.form-row input[type="password"] {
    border-left: 4px solid #e67e22;
}

.form-row input[type="password"]:focus {
    border-left-color: #d35400;
}

/* Style pour l'indicateur utilisateur dans la sidebar */
.sidebar .user-indicator {
    margin: 15px 20px 20px 20px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.sidebar .user-indicator #userInfo {
    color: #ffffff;
    font-size: 13px;
    text-align: center;
    font-weight: 500;
}

.sidebar .user-indicator #userInfo i {
    margin-right: 6px;
    color: #4CAF50;
}

.sidebar .user-indicator .logout-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.sidebar .user-indicator .logout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}