/**
 * ExamWindow Ultimate Notifications - Front-end Bell & Opt-in UI
 */

/* 1. Floating Notification Bell */
.ewun-bell-widget {
    position: fixed;
    z-index: 99998;
    bottom: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ewun-bell-widget.bottom-left {
    right: auto;
    left: 24px;
}

.ewun-bell-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #0284c7;
    color: #ffffff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s;
    position: relative;
}

.ewun-bell-btn:hover {
    transform: scale(1.08);
    background: #0369a1;
}

.ewun-bell-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 2. Slide-Down Opt-in Bar */
.ewun-slidedown-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: #ffffff;
    border-bottom: 2px solid #0284c7;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transform: translateY(-100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
}

.ewun-slidedown-bar.active {
    transform: translateY(0);
}

.ewun-slidedown-content {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ewun-slidedown-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.ewun-slidedown-text h4 {
    margin: 0 0 2px 0;
    font-size: 15px;
    color: #0f172a;
    font-weight: 700;
}

.ewun-slidedown-text p {
    margin: 0;
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
}

.ewun-slidedown-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.ewun-btn-allow {
    background: #0284c7;
    color: #ffffff;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.ewun-btn-allow:hover {
    background: #0369a1;
}

.ewun-btn-later {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.ewun-btn-later:hover {
    background: #e2e8f0;
}

/* 3. Preferences & Inbox Modal */
.ewun-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(3px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    padding: 16px;
}

.ewun-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.ewun-modal-card {
    background: #ffffff;
    width: 100%;
    max-width: 520px;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}

.ewun-modal-header {
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ewun-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ewun-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
}

.ewun-modal-close:hover {
    color: #0f172a;
}

.ewun-modal-body {
    padding: 20px;
    overflow-y: auto;
    font-size: 14px;
    color: #334155;
}

.ewun-pref-group {
    margin-bottom: 18px;
}

.ewun-pref-group label.group-title {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #0f172a;
}

.ewun-chips-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ewun-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s;
}

.ewun-chip input {
    margin-right: 6px;
}

.ewun-chip.active {
    background: #e0f2fe;
    border-color: #0284c7;
    color: #0284c7;
    font-weight: 600;
}

.ewun-modal-footer {
    padding: 14px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

@media (max-width: 640px) {
    .ewun-slidedown-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .ewun-slidedown-actions {
        justify-content: flex-end;
    }
}
