/*===== Notification Bell Widget =====*/
.notification-bell {
    position: fixed;
    bottom: 100px;
    right: 24px;
    z-index: 10000;
}

.notification-bell__btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary, #6366f1), var(--color-secondary, #8b5cf6));
    color: white;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.notification-bell__btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(99, 102, 241, 0.5);
}

.notification-bell__btn i {
    animation: bellRing 2s infinite;
}

@keyframes bellRing {
    0%, 100% { transform: rotate(0); }
    10% { transform: rotate(15deg); }
    20% { transform: rotate(-15deg); }
    30% { transform: rotate(10deg); }
    40% { transform: rotate(-10deg); }
    50%, 100% { transform: rotate(0); }
}

.notification-bell__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    background: #ef4444;
    color: white;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid white;
}

/* Popup */
.notification-popup {
    position: absolute;
    bottom: 70px;
    width: 320px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s;
}

/* Popup position per bell position */
.notification-bell[data-position="bottom-right"] .notification-popup,
.notification-bell[data-position="top-right"] .notification-popup {
    right: 0;
    left: auto;
}

.notification-bell[data-position="bottom-left"] .notification-popup,
.notification-bell[data-position="top-left"] .notification-popup {
    left: 0;
    right: auto;
}

/* Bottom positions: popup opens above */
.notification-bell[data-position="bottom-right"] .notification-popup,
.notification-bell[data-position="bottom-left"] .notification-popup {
    bottom: 70px;
    top: auto;
}

/* Top positions: popup opens below */
.notification-bell[data-position="top-right"] .notification-popup,
.notification-bell[data-position="top-left"] .notification-popup {
    top: 70px;
    bottom: auto;
}

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

.notification-popup__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--color-primary, #6366f1), var(--color-secondary, #8b5cf6));
    color: white;
}

.notification-popup__title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.notification-popup__close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.notification-popup__close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.notification-popup__body {
    padding: 24px 20px;
}

.notification-popup__footer {
    padding: 12px 20px;
    background: #f8f9fa;
    text-align: center;
    color: #6c757d;
    font-size: 0.75rem;
}

/* Subscribe Section */
.notification-subscribe {
    text-align: center;
}

.notification-subscribe__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--color-primary, #6366f1);
}

.notification-subscribe__title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px;
}

.notification-subscribe__desc {
    font-size: 0.9rem;
    color: #6c757d;
    margin: 0 0 20px;
    line-height: 1.5;
}

.notification-subscribe__btn {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--color-primary, #6366f1), var(--color-secondary, #8b5cf6));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.notification-subscribe__btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.notification-subscribe__btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.notification-subscribe__note {
    font-size: 0.75rem;
    color: #adb5bd;
    margin: 12px 0 0;
}

/* Subscribed Section */
.notification-subscribed {
    text-align: center;
}

.notification-subscribed__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(52, 211, 153, 0.1));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #10b981;
}

.notification-subscribed__title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px;
}

.notification-subscribed__desc {
    font-size: 0.9rem;
    color: #6c757d;
    margin: 0 0 20px;
    line-height: 1.5;
}

.notification-subscribed__btn {
    width: 100%;
    padding: 12px 20px;
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.notification-subscribed__btn:hover {
    background: #e9ecef;
    color: #495057;
}

/* Loading Spinner */
.notification-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.notification-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e9ecef;
    border-top-color: var(--color-primary, #6366f1);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast Notification */
.notification-toast {
    position: fixed;
    bottom: 100px;
    right: 24px;
    padding: 12px 20px;
    background: #1a1a1a;
    color: white;
    border-radius: 10px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    animation: toastIn 0.3s ease;
}

.notification-toast--success {
    background: #10b981;
}

.notification-toast--error {
    background: #ef4444;
}

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

/* Dark Mode Support */
[data-theme="dark"] .notification-popup {
    background: #1e293b;
}

[data-theme="dark"] .notification-popup__header {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

[data-theme="dark"] .notification-subscribe__title,
[data-theme="dark"] .notification-subscribed__title {
    color: #f1f5f9;
}

[data-theme="dark"] .notification-subscribe__desc,
[data-theme="dark"] .notification-subscribed__desc {
    color: #94a3b8;
}

[data-theme="dark"] .notification-subscribed__btn {
    background: #334155;
    border-color: #475569;
    color: #94a3b8;
}

[data-theme="dark"] .notification-popup__footer {
    background: #0f172a;
    color: #64748b;
}

/* Responsive */
@media (max-width: 480px) {
    .notification-bell[data-position="bottom-right"],
    .notification-bell[data-position="top-right"] {
        bottom: 16px;
        right: 16px;
    }

    .notification-bell[data-position="bottom-left"],
    .notification-bell[data-position="top-left"] {
        bottom: 16px;
        left: 16px;
    }
    
    .notification-popup {
        width: calc(100vw - 32px);
    }

    .notification-bell[data-position="bottom-right"] .notification-popup,
    .notification-bell[data-position="top-right"] .notification-popup {
        right: -8px;
        left: auto;
    }

    .notification-bell[data-position="bottom-left"] .notification-popup,
    .notification-bell[data-position="top-left"] .notification-popup {
        left: -8px;
        right: auto;
    }
}
