/* Styles pour le système de notifications */

/* Indicateur de notification */
.notification-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(15, 23, 41, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid rgba(108, 92, 231, 0.3);
}

.notification-indicator:hover {
    transform: scale(1.1);
}

.notification-indicator.has-notifications {
    background-color: var(--primary-color);
    animation: pulse 2s infinite;
}

.notification-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ff4757;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.notification-link {
    color: white;
    text-decoration: none;
    font-size: 1.2rem;
}

/* Animation de pulsation pour les nouvelles notifications */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(108, 92, 231, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(108, 92, 231, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(108, 92, 231, 0);
    }
}

/* Masquer l'indicateur de notification sur les pages de chat */
body.chat-page .notification-indicator {
    display: none !important;
}

/* Popup de notification */
.notification-popup {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: rgba(15, 23, 41, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-left: 4px solid var(--primary-color);
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.notification-popup.show {
    transform: translateX(0);
    opacity: 1;
}

.notification-popup-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.notification-popup-content i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.notification-popup-content p {
    color: white;
    margin: 0;
    font-weight: 500;
}

/* Style pour la page de notifications */
.notifications-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

/* En-tête des notifications */
.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.notifications-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.mark-all-read-btn {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.3);
}

.mark-all-read-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.4);
    color: white;
}

.mark-all-read-btn i {
    margin-right: 0.5rem;
}

/* Bouton de lecture individuelle - Style simple avec icône */
.mark-read-btn {
    background: linear-gradient(45deg, #28a745, #20c997);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(40, 167, 69, 0.4);
    font-size: 1rem;
}

.mark-read-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.5);
    background: linear-gradient(45deg, #20c997, #28a745);
}

.mark-read-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.3);
}

.mark-read-btn i {
    font-size: 1rem;
}

.read-indicator {
    color: #28a745;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.read-indicator i {
    font-size: 1rem;
}

/* Amélioration des actions de notification */
.notification-actions {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    align-items: flex-end;
    min-width: 150px;
    padding: 0.5rem;
}

/* S'assurer que les boutons sont bien visibles */
.notification-card .notification-actions .btn {
    font-family: 'RussoOne', sans-serif !important;
    text-transform: none !important;
    letter-spacing: 0.5px !important;
}

/* Style pour les boutons d'action dans les notifications */
.notification-actions .action-btn {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color)) !important;
    border: none !important;
    color: white !important;
    padding: 0.8rem 1.2rem !important;
    border-radius: 8px !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 3px 10px rgba(108, 92, 231, 0.4) !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 140px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    text-align: center !important;
}

.notification-actions .action-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 15px rgba(108, 92, 231, 0.5) !important;
    color: white !important;
    background: linear-gradient(45deg, var(--secondary-color), var(--primary-color)) !important;
}

.notification-actions .action-btn i {
    margin-right: 0.5rem !important;
}

/* Bouton "Marquer comme lu" maintenant géré par .mark-read-btn simple */

/* Responsive pour les actions */
@media (max-width: 768px) {
    .notifications-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .notifications-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .notification-actions {
        min-width: auto;
        width: 100%;
        align-items: stretch;
        padding: 0.5rem;
        gap: 1rem !important;
    }
    
    .mark-read-btn {
        width: 100% !important;
        text-align: center !important;
        min-width: auto !important;
        padding: 1rem 1.2rem !important;
        font-size: 0.95rem !important;
        line-height: 1.3 !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        height: auto !important;
        min-height: 50px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
    }
    
    .action-btn {
        width: 100% !important;
        text-align: center !important;
        min-width: auto !important;
        padding: 1rem 1.2rem !important;
        font-size: 0.95rem !important;
        line-height: 1.3 !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        height: auto !important;
        min-height: 50px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
    }
    
    /* Bouton "Marquer comme lu" reste simple sur mobile */
    .mark-read-btn {
        width: 45px !important;
        height: 45px !important;
        font-size: 1.1rem !important;
    }
    
    /* Espacement entre les boutons sur mobile */
    .notification-actions > * {
        margin-bottom: 0.5rem !important;
    }
    
    .notification-actions > *:last-child {
        margin-bottom: 0 !important;
    }
}

/* Styles spécifiques pour très petits écrans (Android) */
@media (max-width: 480px) {
    .notification-actions {
        padding: 0.3rem !important;
        gap: 0.8rem !important;
    }
    
    .mark-read-btn {
        padding: 0.9rem 1rem !important;
        font-size: 0.9rem !important;
        min-height: 45px !important;
        line-height: 1.2 !important;
    }
    
    .action-btn {
        padding: 0.9rem 1rem !important;
        font-size: 0.9rem !important;
        min-height: 45px !important;
        line-height: 1.2 !important;
    }
    
    /* Bouton "Marquer comme lu" reste simple sur très petits écrans */
    .mark-read-btn {
        width: 40px !important;
        height: 40px !important;
        font-size: 1rem !important;
    }
    
    /* S'assurer que les icônes et textes ne se chevauchent pas */
    .mark-read-btn i,
    .action-btn i {
        margin-bottom: 0.2rem !important;
        margin-right: 0 !important;
        display: block !important;
    }
    
    .mark-read-btn span,
    .action-btn span {
        display: block !important;
        margin-top: 0.2rem !important;
    }
}

body.logged-in .notification-indicator {
    display: flex;
}

/* Style pour le badge de notification dans le menu */
.notification-badge {
    background-color: #ff4757;
    color: white;
    border-radius: 10px;
    font-size: 0.7rem;
    padding: 2px 6px;
    margin-left: 5px;
    display: inline-block;
}

/* Styles pour les notifications d'avertissement */
.notification-card.warning {
    border-left: 5px solid #f39c12;
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.1), rgba(230, 126, 34, 0.05));
    box-shadow: 0 0 15px rgba(243, 156, 18, 0.2);
}

.notification-card.warning .notification-icon {
    color: #f39c12;
    text-shadow: 0 0 10px rgba(243, 156, 18, 0.5);
}

.notification-card.warning .notification-title {
    color: #f39c12;
    text-shadow: 0 0 5px rgba(243, 156, 18, 0.3);
}

/* Animation pour les notifications d'avertissement */
.notification-card.warning {
    animation: warningPulse 3s ease-in-out infinite;
}

@keyframes warningPulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(243, 156, 18, 0.2);
    }
    50% {
        box-shadow: 0 0 25px rgba(243, 156, 18, 0.4);
    }
}

/* Indicateur de notification non lue */
.notification-indicator.has-unread {
    background-color: #ff4757;
    animation: urgentPulse 1.5s infinite;
}

@keyframes urgentPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(255, 71, 87, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 71, 87, 0);
    }
}
