/* ============================================================
   🔔 SYSTÈME DE NOTIFICATIONS — MON CRYPTO
   Style : Dark luxury, épuré, élégant
   ============================================================ */

/* --- TOAST CONTAINER --- */
#toastContainer {
    position: fixed;
    bottom: 30px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
    pointer-events: none;
    max-width: 360px;
    width: calc(100vw - 48px);
}

/* --- TOAST BASE --- */
.mc-toast {
    pointer-events: all;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 14px;
    background: rgba(10, 14, 23, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    position: relative;
    overflow: hidden;
}

.mc-toast.hiding {
    animation: toastSlideOut 0.35s cubic-bezier(0.4, 0, 1, 1) forwards;
}

/* Barre colorée en haut */
.mc-toast::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    border-radius: 14px 14px 0 0;
}

.mc-toast.success::before { background: linear-gradient(90deg, #00ff88, #00d2ff); }
.mc-toast.error::before   { background: linear-gradient(90deg, #ef4444, #ff6b6b); }
.mc-toast.info::before    { background: linear-gradient(90deg, #00d2ff, #3a7bd5); }
.mc-toast.warning::before { background: linear-gradient(90deg, #ffa500, #ffcc00); }
.mc-toast.admin::before   { background: linear-gradient(90deg, #a855f7, #ec4899); }

/* --- ICÔNE TOAST --- */
.toast-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.mc-toast.success .toast-icon { background: rgba(0, 255, 136, 0.1); border: 1px solid rgba(0, 255, 136, 0.2); }
.mc-toast.error   .toast-icon { background: rgba(239, 68, 68, 0.1);  border: 1px solid rgba(239, 68, 68, 0.2); }
.mc-toast.info    .toast-icon { background: rgba(0, 210, 255, 0.1);  border: 1px solid rgba(0, 210, 255, 0.2); }
.mc-toast.warning .toast-icon { background: rgba(255, 165, 0, 0.1);  border: 1px solid rgba(255, 165, 0, 0.2); }
.mc-toast.admin   .toast-icon { background: rgba(168, 85, 247, 0.1); border: 1px solid rgba(168, 85, 247, 0.2); }

/* --- CONTENU TOAST --- */
.toast-body { flex: 1; min-width: 0; }

.toast-title {
    font-family: 'Sora', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 3px;
    letter-spacing: 0.01em;
}

.toast-message {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.4;
    font-family: 'Sora', sans-serif;
}

/* --- BOUTON FERMER --- */
.toast-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.25);
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
    flex-shrink: 0;
    margin-top: 1px;
}
.toast-close:hover { color: rgba(255, 255, 255, 0.7); }

/* --- BARRE DE PROGRESSION TOAST --- */
.toast-progress {
    position: absolute;
    bottom: 0; left: 0;
    height: 2px;
    border-radius: 0 0 14px 14px;
    animation: toastProgress linear forwards;
}
.mc-toast.success .toast-progress { background: rgba(0, 255, 136, 0.4); }
.mc-toast.error   .toast-progress { background: rgba(239, 68, 68, 0.4); }
.mc-toast.info    .toast-progress { background: rgba(0, 210, 255, 0.4); }
.mc-toast.warning .toast-progress { background: rgba(255, 165, 0, 0.4); }
.mc-toast.admin   .toast-progress { background: rgba(168, 85, 247, 0.4); }

/* --- ANIMATIONS TOAST --- */
@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(30px) scale(0.95); }
    to   { opacity: 1; transform: translateX(0)    scale(1); }
}
@keyframes toastSlideOut {
    from { opacity: 1; transform: translateX(0)    scale(1);    max-height: 120px; }
    to   { opacity: 0; transform: translateX(30px) scale(0.95); max-height: 0; padding: 0; margin: 0; }
}
@keyframes toastProgress {
    from { width: 100%; }
    to   { width: 0%; }
}

/* ============================================================
   🔔 CLOCHE NAVBAR
   ============================================================ */
.notif-bell-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.notif-bell-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    padding: 6px;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.notif-bell-btn:hover { color: #fff; background: rgba(255,255,255,0.06); }

.notif-badge {
    position: absolute;
    top: 0; right: 0;
    background: linear-gradient(135deg, #ef4444, #ff6b6b);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    font-family: 'Sora', sans-serif;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 1.5px solid #050a14;
    transform: translate(4px, -4px);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.notif-badge.hidden { display: none; }
.notif-badge.pulse {
    animation: badgePulse 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes badgePulse {
    0%   { transform: translate(4px, -4px) scale(1); }
    50%  { transform: translate(4px, -4px) scale(1.4); }
    100% { transform: translate(4px, -4px) scale(1); }
}

/* --- DROPDOWN NOTIFICATIONS --- */
.notif-dropdown {
    position: absolute;
    top: calc(100% + 14px);
    right: -10px;
    width: 320px;
    background: rgba(10, 14, 23, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(24px);
    overflow: hidden;
    z-index: 9999;
    animation: dropdownOpen 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform-origin: top right;
}
.notif-dropdown.hidden {
    display: none;
}
@keyframes dropdownOpen {
    from { opacity: 0; transform: scale(0.95) translateY(-8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.notif-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.notif-dropdown-header span {
    font-family: 'Sora', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.notif-mark-all {
    background: none;
    border: none;
    font-size: 0.7rem;
    color: #00d2ff;
    cursor: pointer;
    font-family: 'Sora', sans-serif;
    padding: 0;
    transition: opacity 0.2s;
}
.notif-mark-all:hover { opacity: 0.7; }

/* --- LISTE DES NOTIFICATIONS --- */
.notif-list {
    max-height: 320px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.notif-list::-webkit-scrollbar { width: 4px; }
.notif-list::-webkit-scrollbar-track { background: transparent; }
.notif-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}
.notif-item:hover { background: rgba(255, 255, 255, 0.03); }
.notif-item.unread { background: rgba(0, 210, 255, 0.03); }
.notif-item.unread::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: #00d2ff;
    border-radius: 0 2px 2px 0;
}

.notif-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.notif-item-body { flex: 1; min-width: 0; }
.notif-item-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    font-family: 'Sora', sans-serif;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notif-item-desc {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    font-family: 'Sora', sans-serif;
    line-height: 1.3;
}
.notif-item-time {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.25);
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
    margin-top: 2px;
}

.notif-empty {
    padding: 30px 18px;
    text-align: center;
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.78rem;
    font-family: 'Sora', sans-serif;
}
.notif-empty span { display: block; font-size: 1.5rem; margin-bottom: 8px; opacity: 0.4; }

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 480px) {
    #toastContainer {
        bottom: 20px;
        right: 12px;
        left: 12px;
        width: auto;
        max-width: 100%;
    }
    .notif-dropdown {
        width: 290px;
        right: -5px;
    }
}