/**
 * STYLES DES NOTIFICATIONS
 * 
 * Styles pour le système de notifications utilisateur
 * - Icône de notification dans le header
 * - Badge de compteur
 * - Dropdown des notifications
 * - Animations
 */

/* ========================================
   BOUTON DE NOTIFICATIONS
   ======================================== */

.notifications-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.notifications-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.notifications-btn:focus {
    outline: 2px solid var(--primary-color, #6441a5);
    outline-offset: 2px;
}

.notifications-icon {
    font-size: 20px;
    display: flex;
    align-items: center;
}

/* Badge de compteur */
.notifications-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background-color: #e74c3c;
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1.2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.notifications-badge.hidden {
    display: none;
}

/* Animation du badge */
@keyframes badge-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.notifications-badge.new {
    animation: badge-pulse 0.5s ease-in-out 3;
}

/* ========================================
   DROPDOWN DES NOTIFICATIONS
   ======================================== */

.notifications-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 380px;
    max-width: 90vw;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    max-height: 500px;
    display: flex;
    flex-direction: column;
}

.notifications-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Header du dropdown */
.notifications-header {
    padding: 16px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notifications-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.notifications-mark-all {
    background: none;
    border: none;
    color: #6441a5;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.notifications-mark-all:hover {
    background-color: rgba(100, 65, 165, 0.1);
}

.notifications-mark-all:disabled {
    color: #999;
    cursor: not-allowed;
}

/* Liste des notifications */
.notifications-list {
    overflow-y: auto;
    max-height: 400px;
    flex: 1;
}

.notifications-list::-webkit-scrollbar {
    width: 6px;
}

.notifications-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.notifications-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.notifications-list::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Item de notification */
.notification-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.notification-item:hover {
    background-color: #f8f9fa;
}

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

.notification-item.unread {
    background-color: #f0f4ff;
}

.notification-item.unread:hover {
    background-color: #e6edff;
}

/* Icône de type de notification */
.notification-type-icon {
    font-size: 24px;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(100, 65, 165, 0.1);
}

.notification-item.unread .notification-type-icon {
    background-color: rgba(100, 65, 165, 0.2);
}

/* Contenu de la notification */
.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.notification-message {
    font-size: 13px;
    color: #666;
    margin: 0 0 6px 0;
    line-height: 1.4;
    display: -webkit-box;
    /*-webkit-line-clamp: 2;*/
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-time {
    font-size: 12px;
    color: #999;
}

/* Actions de la notification */
.notification-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.notification-item:hover .notification-actions {
    opacity: 1;
}

.notification-delete-btn {
    background: none;
    border: none;
    color: #e74c3c;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    line-height: 1;
}

.notification-delete-btn:hover {
    background-color: rgba(231, 76, 60, 0.1);
}

/* État vide */
.notifications-empty {
    padding: 40px 20px;
    text-align: center;
    color: #999;
}

.notifications-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.notifications-empty-text {
    font-size: 14px;
}

/* État de chargement */
.notifications-loading {
    padding: 40px 20px;
    text-align: center;
    color: #999;
}

.notifications-spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #6441a5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   MODE SOMBRE
   ======================================== */

body.dark-mode .notifications-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .notifications-dropdown {
    background: #2c2c2c;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

body.dark-mode .notifications-header {
    border-bottom-color: #444;
}

body.dark-mode .notifications-title {
    color: #fff;
}

body.dark-mode .notification-item {
    border-bottom-color: #444;
}

body.dark-mode .notification-item:hover {
    background-color: #333;
}

body.dark-mode .notification-item.unread {
    background-color: #2a3a5a;
}

body.dark-mode .notification-item.unread:hover {
    background-color: #344266;
}

body.dark-mode .notification-title {
    color: #fff;
}

body.dark-mode .notification-message {
    color: #ccc;
}

body.dark-mode .notification-time {
    color: #999;
}

body.dark-mode .notifications-empty,
body.dark-mode .notifications-loading {
    color: #999;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .notifications-dropdown {
        width: 320px;
        right: -10px;
    }
    
    .notification-item {
        padding: 10px 12px;
    }
    
    .notification-type-icon {
        font-size: 20px;
        width: 28px;
        height: 28px;
    }
    
    .notification-title {
        font-size: 13px;
    }
    
    .notification-message {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .notifications-dropdown {
        width: calc(100vw - 20px);
        right: -60px;
    }
}
