/**
 * 🔔 Styles pour le système de notifications
 * Guide d'Agen - Interface utilisateur des notifications
 */

/* Bouton de notifications dans la navbar */
.notification-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 8px 12px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
}

.notification-btn:hover {
    background: var(--bg-hover);
    border-color: var(--text-accent);
    transform: translateY(-1px);
}

.notification-btn.active {
    background: var(--bg-success);
    border-color: var(--text-success);
    color: var(--text-success);
}

.notification-btn.denied {
    background: var(--bg-error);
    border-color: var(--text-error);
    color: var(--text-error);
}

/* Notifications de fallback (pour navigateurs non supportés) */
.fallback-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 8px 32px var(--shadow-color);
    backdrop-filter: blur(10px);
    max-width: 350px;
    animation: slideInRight 0.3s ease;
}

.fallback-notification .notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fallback-notification .notification-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.fallback-notification .notification-message {
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.4;
    flex: 1;
}

.fallback-notification .notification-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.fallback-notification .notification-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Modal des paramètres de notifications */
.notification-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.notification-settings-modal .modal-content {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 16px 64px var(--shadow-color);
    max-width: 450px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    animation: slideInUp 0.3s ease;
}

.notification-settings-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
}

.notification-settings-modal .modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
}

.notification-settings-modal .modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: bold;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.notification-settings-modal .modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.notification-settings-modal .modal-body {
    padding: 24px;
}

.notification-settings-modal .setting-item {
    margin-bottom: 16px;
}

.notification-settings-modal .setting-item:last-child {
    margin-bottom: 0;
}

.notification-settings-modal .setting-item label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
}

.notification-settings-modal .setting-item label:hover {
    background: var(--bg-hover);
}

.notification-settings-modal .setting-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--text-accent);
    cursor: pointer;
}

.notification-settings-modal .modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
}

.notification-settings-modal .btn-primary,
.notification-settings-modal .btn-secondary {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.notification-settings-modal .btn-primary {
    background: var(--bg-accent);
    color: white;
    border-color: var(--bg-accent);
}

.notification-settings-modal .btn-primary:hover {
    background: var(--bg-accent-hover);
    border-color: var(--bg-accent-hover);
    transform: translateY(-1px);
}

.notification-settings-modal .btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.notification-settings-modal .btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--text-accent);
}

/* Indicateur de statut des notifications */
.notification-status-indicator {
    position: relative;
}

.notification-status-indicator::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-success);
    border: 2px solid var(--bg-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.notification-btn.active .notification-status-indicator::after {
    opacity: 1;
}

/* Badge de notification (pour compteur) */
.notification-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--bg-error);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

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

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Toast notifications (alternative aux notifications browser) */
.toast-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--text-accent);
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 8px 32px var(--shadow-color);
    backdrop-filter: blur(10px);
    max-width: 350px;
    animation: slideInUp 0.3s ease;
}

.toast-notification.success {
    border-left-color: var(--text-success);
}

.toast-notification.warning {
    border-left-color: var(--text-warning);
}

.toast-notification.error {
    border-left-color: var(--text-error);
}

.toast-notification .toast-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.toast-notification .toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.toast-notification .toast-text {
    flex: 1;
}

.toast-notification .toast-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.toast-notification .toast-message {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.toast-notification .toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toast-notification .toast-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Adaptation mobile */
@media (max-width: 768px) {
    .fallback-notification,
    .toast-notification {
        left: 20px;
        right: 20px;
        max-width: none;
    }
    
    .notification-settings-modal .modal-content {
        margin: 20px;
        width: calc(100% - 40px);
    }
    
    .notification-settings-modal .modal-body {
        padding: 20px 16px;
    }
    
    .notification-settings-modal .modal-header,
    .notification-settings-modal .modal-footer {
        padding: 16px 20px;
    }
    
    .notification-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
}

/* Adaptation thème sombre */
[data-theme="dark"] .notification-btn {
    background: var(--bg-card);
    border-color: var(--border-color);
}

[data-theme="dark"] .notification-btn:hover {
    background: var(--bg-hover);
}

[data-theme="dark"] .fallback-notification,
[data-theme="dark"] .toast-notification {
    background: var(--bg-card);
    border-color: var(--border-color);
}

[data-theme="dark"] .notification-settings-modal .modal-content {
    background: var(--bg-primary);
    border-color: var(--border-color);
}

/* Animation de chargement pour les notifications */
.notification-loading {
    position: relative;
    overflow: hidden;
}

.notification-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--text-accent), transparent);
    animation: loading 2s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}