/* ===========================================
   INVITATIONS MODAL STYLES
   =========================================== */

/* Modal Container - Centré et avec effet fluorescent */
#inviteModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

#inviteModal.show,
#inviteModal[style*="display: flex"] {
    display: flex !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Modal Content - Avec bordure fluorescente et padding */
#inviteModal .modal-content {
    position: relative;
    background: linear-gradient(135deg, #1a1a1f 0%, #0f0f14 100%);
    border-radius: 20px;
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 40px;
    box-shadow: 
        0 0 60px rgba(139, 92, 246, 0.4),
        0 0 120px rgba(139, 92, 246, 0.2),
        0 20px 60px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(139, 92, 246, 0.5);
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from {
        transform: scale(0.9) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Bouton de fermeture - Coin supérieur droit */
#inviteModal .modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid rgba(239, 68, 68, 0.3);
    border-radius: 50%;
    color: #ef4444;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

#inviteModal .modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

/* Titre du modal */
#inviteModal h2 {
    color: #c9a9ff;
    margin: 0 0 30px 0;
    padding-right: 50px;
    font-size: 1.8rem;
    font-weight: 600;
    background: linear-gradient(135deg, #c9a9ff 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Tabs d'invitation - Design amélioré */
.invite-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 35px;
    padding: 5px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(201, 169, 255, 0.1);
}

.invite-tab {
    flex: 1;
    padding: 14px 24px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #a1a1aa;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.invite-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(201, 169, 255, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: 8px;
}

.invite-tab:hover {
    color: #c9a9ff;
    transform: translateY(-2px);
}

.invite-tab:hover::before {
    opacity: 1;
}

.invite-tab.active {
    color: #fff;
    background: linear-gradient(135deg, #8b5cf6 0%, #667eea 100%);
    box-shadow: 
        0 0 20px rgba(139, 92, 246, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.invite-tab.active::before {
    opacity: 0;
}

.invite-tab i {
    margin-right: 8px;
    font-size: 1.1rem;
}

/* Email Rows pour saisie manuelle - Avec sélection de rôle */
.email-row {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1.5fr 1.5fr auto;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.email-row input,
.email-row select {
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(201, 169, 255, 0.3);
    border-radius: 5px;
    color: #e4e4e7;
    font-size: 0.95rem;
}

.email-row input:focus,
.email-row select:focus {
    outline: none;
    border-color: #c9a9ff;
    background: rgba(201, 169, 255, 0.1);
}

.email-row select option {
    background: #2d2d3d;
    color: #e4e4e7;
}

.btn-remove {
    padding: 10px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 5px;
    color: #ef4444;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-remove:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

.btn-add-row {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    background: rgba(201, 169, 255, 0.1);
    border: 2px dashed rgba(201, 169, 255, 0.3);
    border-radius: 5px;
    color: #c9a9ff;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-add-row:hover {
    background: rgba(201, 169, 255, 0.2);
    border-color: #c9a9ff;
}

/* Zone upload CSV */
.csv-upload-zone {
    text-align: center;
    padding: 60px 20px;
    background: rgba(201, 169, 255, 0.05);
    border: 2px dashed rgba(201, 169, 255, 0.3);
    border-radius: 10px;
    margin: 20px 0;
    transition: all 0.3s;
}

.csv-upload-zone:hover {
    background: rgba(201, 169, 255, 0.1);
    border-color: #c9a9ff;
}

/* Aperçu CSV */
.csv-preview {
    max-height: 300px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(201, 169, 255, 0.2);
    border-radius: 5px;
    padding: 15px;
}

.csv-preview-row {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1.5fr 2fr;
    gap: 10px;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(201, 169, 255, 0.1);
    font-size: 0.9rem;
}

.csv-preview-row:hover {
    background: rgba(201, 169, 255, 0.05);
}

.csv-preview-row.invalid {
    background: rgba(239, 68, 68, 0.1);
    border-left: 3px solid #ef4444;
}

/* Liste d'aperçu des invitations */
.invite-preview-list {
    max-height: 250px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(201, 169, 255, 0.2);
    border-radius: 5px;
    padding: 10px;
}

.invite-preview-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px;
    border-bottom: 1px solid rgba(201, 169, 255, 0.1);
    font-size: 0.9rem;
    transition: background 0.2s;
}

.invite-preview-item:hover {
    background: rgba(201, 169, 255, 0.05);
}

.invite-preview-item:last-child {
    border-bottom: none;
}

.invite-preview-item .email {
    color: #c9a9ff;
    font-weight: 600;
    font-size: 14px;
}

.invite-preview-item .name {
    color: #a1a1aa;
    font-size: 13px;
}

/* Zones de contenu - Padding amélioré */
.invite-tab-content {
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(201, 169, 255, 0.1);
}

/* Section aperçu des invitations */
#invitePreview {
    margin-top: 30px;
    padding: 20px;
    background: rgba(139, 92, 246, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

#invitePreview h4 {
    color: #c9a9ff;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

/* Actions du modal - Amélioration */
#inviteModal .modal-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 35px;
    padding-top: 25px;
    border-top: 2px solid rgba(201, 169, 255, 0.1);
}

#inviteModal .modal-actions button {
    padding: 14px 32px;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
}

#inviteModal .btn-secondary {
    background: rgba(201, 169, 255, 0.1);
    border-color: rgba(201, 169, 255, 0.3);
    color: #c9a9ff;
}

#inviteModal .btn-secondary:hover {
    background: rgba(201, 169, 255, 0.2);
    border-color: #c9a9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(201, 169, 255, 0.2);
}

#inviteModal .btn-primary {
    background: linear-gradient(135deg, #8b5cf6 0%, #667eea 100%);
    border-color: transparent;
    color: white;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

#inviteModal .btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 
        0 0 30px rgba(139, 92, 246, 0.5),
        0 8px 20px rgba(0, 0, 0, 0.3);
}

#inviteModal .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(50%);
}

/* Animation pulsante pour le bouton envoyer quand activé */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(139, 92, 246, 0.6);
    }
}

#inviteModal .btn-primary:not(:disabled) {
    animation: pulse 2s infinite;
}

/* Scrollbar personnalisée pour le modal */
#inviteModal .modal-content::-webkit-scrollbar {
    width: 8px;
}

#inviteModal .modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

#inviteModal .modal-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #8b5cf6 0%, #667eea 100%);
    border-radius: 10px;
}

#inviteModal .modal-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #7c4dff 0%, #5568d3 100%);
}

/* Responsivité */
@media (max-width: 768px) {
    #inviteModal .modal-content {
        width: 95%;
        padding: 25px;
        max-height: 90vh;
    }
    
    #inviteModal h2 {
        font-size: 1.4rem;
    }
    
    #inviteModal .modal-close {
        top: 15px;
        right: 15px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
    
    .email-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .invite-tabs {
        flex-direction: column;
        gap: 8px;
    }
    
    .csv-preview-row {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    
    #inviteModal .modal-actions {
        flex-direction: column-reverse;
    }
    
    #inviteModal .modal-actions button {
        width: 100%;
    }
}

