/* ============================================================================
   NOTIFICATION SYSTEM - NHLPool
   ============================================================================
   
   Toast notifications en temps réel avec animations et sons
   Compatible dark mode via CSS variables
   ========================================================================= */

/* Container pour les toasts */
.notifications-container {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    pointer-events: none;
}

@media (max-width: 768px) {
    .notifications-container {
        top: 60px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Toast notification */
.toast-notification {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #dee2e6);
    border-left: 4px solid #007bff;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 4px 16px var(--card-shadow, rgba(0, 0, 0, 0.1));
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    pointer-events: auto;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease;
}

.toast-notification:hover {
    transform: translateX(-5px);
    box-shadow: 0 6px 20px var(--card-shadow, rgba(0, 0, 0, 0.15));
}

/* Animation d'entrée */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Animation de sortie */
@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast-notification.closing {
    animation: slideOut 0.3s ease forwards;
}

/* Types de notifications */
.toast-notification.toast-info {
    border-left-color: #17a2b8;
}

.toast-notification.toast-success {
    border-left-color: #28a745;
}

.toast-notification.toast-warning {
    border-left-color: #ffc107;
}

.toast-notification.toast-danger {
    border-left-color: #dc3545;
}

.toast-notification.toast-message {
    border-left-color: #6f42c1;
}

.toast-notification.toast-trade {
    border-left-color: #fd7e14;
}

.toast-notification.toast-goal {
    border-left-color: #28a745;
}

/* Icône */
.toast-icon {
    font-size: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.toast-info .toast-icon {
    color: #17a2b8;
}

.toast-success .toast-icon {
    color: #28a745;
}

.toast-warning .toast-icon {
    color: #ffc107;
}

.toast-danger .toast-icon {
    color: #dc3545;
}

.toast-message .toast-icon {
    color: #6f42c1;
}

.toast-trade .toast-icon {
    color: #fd7e14;
}

.toast-goal .toast-icon {
    color: #28a745;
}

/* Contenu */
.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary, #212529);
    margin-bottom: 4px;
}

.toast-message-text {
    font-size: 13px;
    color: var(--text-secondary, #6c757d);
    line-height: 1.4;
    word-wrap: break-word;
}

/* Bouton close */
.toast-close {
    background: none;
    border: none;
    color: var(--text-muted, #adb5bd);
    font-size: 18px;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.toast-close:hover {
    background: var(--bg-hover, #dee2e6);
    color: var(--text-primary, #212529);
}

/* Progress bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--btn-primary-bg, #007bff);
    width: 100%;
    animation: progressBar 5s linear forwards;
}

@keyframes progressBar {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

.toast-notification:hover .toast-progress {
    animation-play-state: paused;
}

/* Badge (pour compteurs) */
.toast-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #dc3545;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 6px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .toast-notification {
        min-width: 0;
        max-width: none;
    }
    
    .toast-icon {
        font-size: 20px;
    }
    
    .toast-title {
        font-size: 13px;
    }
    
    .toast-message-text {
        font-size: 12px;
    }
}

/* Permission request banner */
.notification-permission-banner {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 4px 16px var(--card-shadow, rgba(0, 0, 0, 0.1));
    z-index: 9998;
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 500px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.notification-permission-banner .banner-icon {
    font-size: 32px;
    color: #ffc107;
}

.notification-permission-banner .banner-content {
    flex: 1;
}

.notification-permission-banner .banner-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary, #212529);
    margin-bottom: 4px;
}

.notification-permission-banner .banner-text {
    font-size: 13px;
    color: var(--text-secondary, #6c757d);
}

.notification-permission-banner .banner-actions {
    display: flex;
    gap: 8px;
}

.notification-permission-banner .btn {
    font-size: 13px;
    padding: 6px 16px;
}

@media (max-width: 768px) {
    .notification-permission-banner {
        left: 10px;
        right: 10px;
        transform: none;
        max-width: none;
        flex-direction: column;
        text-align: center;
    }
    
    .notification-permission-banner .banner-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .notification-permission-banner .btn {
        width: 100%;
    }
}
