/* ==================== NOTIFICATIONS ====================
   Dark/purple theme matching the rest of Última Tirada.
   ====================================================== */

/* ---- Wrapper ---- */
.notif-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* ---- Bell button ---- */
.notif-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--text-secondary, #a0a0b0);
    font-size: 1.05rem;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    padding: 0;
    flex-shrink: 0;
}

.notif-btn:hover,
.notif-btn.is-open {
    color: #c4b5fd;
    background: rgba(124, 58, 237, 0.14);
}

/* ---- Badge ---- */
.notif-badge {
    position: absolute;
    top: 1px;
    right: 1px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #ef4444;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    pointer-events: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.notif-badge[hidden] { display: none; }

/* ---- Dropdown panel ---- */
.notif-panel {
    display: none;
    flex-direction: column;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    max-height: 460px;
    background: linear-gradient(160deg, #1e1b38 0%, #16142a 100%);
    border: 1px solid rgba(124, 58, 237, 0.35);
    border-radius: 14px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(124, 58, 237, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    z-index: 10000;
    overflow: hidden;
    /* Prevent it from going off-screen on narrow viewports */
    max-width: calc(100vw - 20px);
}

.notif-panel.show { display: flex; }

/* ---- Panel header ---- */
.notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px 12px;
    border-bottom: 1px solid rgba(124, 58, 237, 0.18);
    flex-shrink: 0;
    gap: 8px;
    background: rgba(124, 58, 237, 0.06);
}

.notif-panel-header > span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #c4b5fd;
    letter-spacing: 0.01em;
}

.notif-panel-header > span i {
    font-size: 0.9rem;
    opacity: 0.8;
}

.notif-mark-all {
    background: transparent;
    border: 1px solid rgba(124, 58, 237, 0.3);
    color: #a78bfa;
    font-size: 0.72rem;
    padding: 3px 10px;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    font-family: inherit;
}

.notif-mark-all:hover {
    background: rgba(124, 58, 237, 0.18);
    color: #ddd6fe;
    border-color: rgba(124, 58, 237, 0.5);
}

/* ---- Scrollable list ---- */
.notif-list {
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: rgba(124, 58, 237, 0.25) transparent;
}

.notif-list::-webkit-scrollbar { width: 4px; }
.notif-list::-webkit-scrollbar-thumb {
    background: rgba(124, 58, 237, 0.25);
    border-radius: 2px;
}

/* ---- Notification item ---- */
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}

.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: rgba(124, 58, 237, 0.08); }

.notif-unread {
    background: rgba(124, 58, 237, 0.06);
}

.notif-unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #7c3aed, #a855f7);
    border-radius: 0 2px 2px 0;
}

/* ---- Type icon ---- */
.notif-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    margin-top: 1px;
}

.notif-icon-dm      { background: rgba(99, 102, 241, 0.18); color: #818cf8; }
.notif-icon-like    { background: rgba(239, 68,  68,  0.18); color: #f87171; }
.notif-icon-order   { background: rgba(16,  185, 129, 0.18); color: #34d399; }
.notif-icon-event   { background: rgba(245, 158, 11,  0.18); color: #fbbf24; }
.notif-icon-default,
.notif-icon-        { background: rgba(124, 58,  237, 0.18); color: #a78bfa; }

/* ---- Text content ---- */
.notif-content {
    flex: 1;
    min-width: 0;
}

.notif-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #e2e8f0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-body {
    font-size: 0.77rem;
    color: #94a3b8;
    margin-top: 2px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.notif-time {
    font-size: 0.7rem;
    color: #4b5563;
    margin-top: 3px;
}

/* ---- Delete button ---- */
.notif-delete {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: #4b5563;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s, color 0.15s;
    margin-top: 3px;
    padding: 0;
}

.notif-item:hover .notif-delete { opacity: 1; }
.notif-delete:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

/* ---- Empty state ---- */
.notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px 20px;
    color: #374151;
    font-size: 0.83rem;
    text-align: center;
}

.notif-empty i {
    font-size: 2rem;
    color: #1f2937;
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
    .notif-panel {
        width: calc(100vw - 20px);
        right: -8px;
    }
}
