/* =============================================
   PuffCase — notificaciones.css
   ============================================= */

/* ── CAMPANA ─────────────────────────────────── */
.notif-bell-wrap { position: relative; }

.notif-bell-btn {
    position: relative;
    background: rgba(255,255,255,.07);
    border: 1px solid var(--purple-border);
    border-radius: 10px;
    color: var(--gray-light);
    cursor: pointer;
    padding: 7px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, color .2s, border-color .2s;
    line-height: 1;
}
.notif-bell-btn:hover,
.notif-bell-btn--activa {
    background: rgba(124,58,237,.2);
    color: var(--white);
    border-color: var(--purple-accent);
}

/* Badge contador */
.notif-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #e53e3e;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    pointer-events: none;
    border: 2px solid var(--purple-deep);
    animation: notif-pop .3s ease;
}
@keyframes notif-pop {
    0%   { transform: scale(0); }
    70%  { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ── DROPDOWN ───────────────────────────────── */
.notif-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 340px;
    background: #151228;
    border: 1px solid rgba(124,58,237,.2);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,.7), 0 0 0 1px rgba(124,58,237,.08);
    z-index: 500;
    overflow: hidden;
    animation: notif-slide-in .18s cubic-bezier(.34,1.1,.64,1);
}
@keyframes notif-slide-in {
    from { opacity: 0; transform: translateY(-10px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── HEADER ─────────────────────────────────── */
.notif-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 12px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.notif-dropdown-header > span {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: .2px;
}

.notif-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Botón "Todas leídas" */
.notif-mark-all {
    background: rgba(124,58,237,.15);
    border: 1px solid rgba(124,58,237,.3);
    color: #a78bfa;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 20px;
    transition: all .2s;
    font-family: inherit;
    white-space: nowrap;
}
.notif-mark-all:hover {
    background: rgba(124,58,237,.28);
    border-color: rgba(124,58,237,.55);
    color: #c4b5fd;
}

/* Botón "Borrar" */
.notif-delete-all {
    background: rgba(239,68,68,.1);
    border: 1px solid rgba(239,68,68,.25);
    color: #f87171;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 20px;
    transition: all .2s;
    font-family: inherit;
    white-space: nowrap;
}
.notif-delete-all:hover {
    background: rgba(239,68,68,.2);
    border-color: rgba(239,68,68,.5);
    color: #fca5a5;
}

/* ── LISTA ──────────────────────────────────── */
.notif-list {
    max-height: 360px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(124,58,237,.25) transparent;
}
.notif-list::-webkit-scrollbar { width: 4px; }
.notif-list::-webkit-scrollbar-track { background: transparent; }
.notif-list::-webkit-scrollbar-thumb { background: rgba(124,58,237,.25); border-radius: 2px; }

/* Estado vacío */
.notif-empty {
    padding: 40px 16px;
    text-align: center;
    color: rgba(255,255,255,.22);
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.notif-empty::before {
    content: '🔔';
    font-size: 2rem;
    opacity: .35;
    display: block;
}

/* ── ÍTEM ───────────────────────────────────── */
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px 16px;
    border-bottom: 1px solid rgba(255,255,255,.04);
    transition: background .15s;
    position: relative;
    cursor: default;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: rgba(255,255,255,.03); }

/* Nueva — acento izquierdo + fondo sutil */
.notif-item--nueva {
    background: rgba(124,58,237,.07);
}
.notif-item--nueva::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #7c3aed, #a78bfa);
    border-radius: 0 2px 2px 0;
}

/* Icono del tipo */
.notif-item-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 1px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.05);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.06);
}

.notif-item-body { flex: 1; min-width: 0; }

.notif-item-titulo {
    font-size: 0.83rem;
    font-weight: 600;
    color: #e8e3ff;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-item-msg {
    font-size: 0.77rem;
    color: rgba(255,255,255,.45);
    line-height: 1.45;
}

.notif-item-fecha {
    font-size: 0.7rem;
    color: rgba(255,255,255,.25);
    margin-top: 5px;
}

/* Botón marcar como leída */
.notif-item-read {
    background: none;
    border: 1px solid rgba(124,58,237,.25);
    color: rgba(255,255,255,.3);
    border-radius: 6px;
    padding: 3px 7px;
    font-size: 0.7rem;
    cursor: pointer;
    flex-shrink: 0;
    align-self: center;
    transition: all .2s;
    font-family: inherit;
}
.notif-item-read:hover {
    border-color: rgba(124,58,237,.6);
    color: #a78bfa;
    background: rgba(124,58,237,.12);
}

/* ── RESPONSIVE ─────────────────────────────── */
@media (max-width: 768px) {
    .notif-dropdown { width: 300px; right: -50px; }
}
@media (max-width: 480px) {
    .notif-dropdown { width: calc(100vw - 24px); right: auto; left: 50%; transform: translateX(-50%); }
}

/* ── POPUP DE VICTORIA ──────────────────────── */
.win-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.72);
    backdrop-filter: blur(4px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: wpo-fade-in .25s ease;
}
@keyframes wpo-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.win-popup {
    position: relative;
    background: linear-gradient(160deg, #18133a, #0f0c24);
    border: 1px solid rgba(124,58,237,.35);
    border-radius: 22px;
    box-shadow: 0 0 0 1px rgba(124,58,237,.12), 0 30px 80px rgba(0,0,0,.8), 0 0 60px rgba(124,58,237,.15);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
    animation: wpo-pop-in .38s cubic-bezier(.34,1.3,.64,1);
    text-align: center;
}
@keyframes wpo-pop-in {
    from { opacity: 0; transform: scale(.7) translateY(30px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Barra de brillo superior */
.win-popup::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #7c3aed, #a78bfa, #7c3aed, transparent);
}

/* Partículas de confeti (CSS puro) */
.win-popup-confetti {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    border-radius: 22px;
}
.win-popup-confetti span {
    position: absolute;
    top: -10px;
    width: 8px; height: 8px;
    border-radius: 2px;
    animation: wpo-confetti 1.8s ease-out forwards;
    opacity: 0;
}
@keyframes wpo-confetti {
    0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(320px) rotate(720deg); opacity: 0; }
}

.win-popup-inner { padding: 32px 28px 28px; position: relative; z-index: 1; }

/* Icono trofeo animado */
.win-popup-icon {
    font-size: 3.2rem;
    line-height: 1;
    margin-bottom: 8px;
    display: inline-block;
    animation: wpo-bounce .6s .3s cubic-bezier(.34,1.5,.64,1) both;
}
@keyframes wpo-bounce {
    from { transform: scale(0) rotate(-15deg); }
    to   { transform: scale(1) rotate(0deg); }
}

.win-popup-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.9rem;
    font-weight: 800;
    background: linear-gradient(135deg, #a78bfa, #c4b5fd, #e0d5ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
    margin-bottom: 6px;
}

.win-popup-sorteo {
    font-size: 0.82rem;
    color: rgba(255,255,255,.45);
    margin-bottom: 18px;
    font-style: italic;
}

/* Imagen del premio */
.win-popup-img-wrap {
    margin: 0 auto;
    width: 150px;
    height: 150px;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(124,58,237,.2);
    display: flex;
    align-items: center;
    justify-content: center;
}
.win-popup-img-wrap img {
    width: 100%; height: 100%;
    object-fit: contain;
    padding: 8px;
}
.win-popup-img-wrap .win-popup-img-fallback {
    font-size: 3.5rem;
    opacity: .55;
}

/* Moneda dorada (premio PuffCoins) */
.win-popup-img-wrap--coin {
    background: radial-gradient(circle at 35% 35%, #fde68a, #f59e0b, #92400e);
    border-color: rgba(245,158,11,.45);
    box-shadow: 0 0 30px rgba(245,158,11,.3);
}
.win-popup-coin {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fef3c7, #fbbf24, #d97706);
    border: 4px solid rgba(253,230,138,.6);
    box-shadow: inset 0 -4px 8px rgba(0,0,0,.25), 0 6px 20px rgba(245,158,11,.5);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: wpo-coin-spin 1s .3s cubic-bezier(.34,1.3,.64,1) both;
}
@keyframes wpo-coin-spin {
    from { transform: scale(0) rotateY(90deg); }
    to   { transform: scale(1) rotateY(0deg); }
}
.win-popup-coin-label {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.3rem;
    font-weight: 900;
    color: #78350f;
    text-shadow: 0 1px 2px rgba(255,255,255,.4);
    letter-spacing: .5px;
}

/* Nombre del premio */
.win-popup-prize {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #f0c040;
    margin-bottom: 6px;
}

/* Descripción del mensaje */
.win-popup-msg {
    font-size: 0.82rem;
    color: rgba(255,255,255,.5);
    line-height: 1.5;
    margin-bottom: 24px;
}

/* Botón cerrar */
.win-popup-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 36px;
    background: linear-gradient(135deg, #5b21b6, #7c3aed, #9333ea);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .4px;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 6px 20px rgba(124,58,237,.35);
}
.win-popup-close:hover {
    background: linear-gradient(135deg, #6d28d9, #8b5cf6, #a855f7);
    box-shadow: 0 8px 28px rgba(124,58,237,.5);
    transform: translateY(-1px);
}
.win-popup-close:active { transform: translateY(0); }

/* Múltiples premios — navegación entre cards */
.win-popup-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.win-popup-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Fila imagen + flechas */
.win-popup-img-row {
    position: relative;
    margin-bottom: 18px;
}

.win-popup-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 50%;
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,.5);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all .2s;
    line-height: 1;
    padding: 0;
    font-family: inherit;
    z-index: 2;
}
.win-popup-arrow:first-child { left: 0; }
.win-popup-arrow:last-child  { right: 0; }
.win-popup-arrow:hover {
    background: rgba(124,58,237,.25);
    border-color: rgba(124,58,237,.5);
    color: #c4b5fd;
}

.win-popup-nav-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,.2);
    cursor: pointer;
    transition: background .2s, transform .2s;
}
.win-popup-nav-dot--active {
    background: #a78bfa;
    transform: scale(1.4);
}

/* X para cerrar en esquina */
.win-popup-x {
    position: absolute;
    top: 14px; right: 16px;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 50%;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,.4);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all .2s;
    z-index: 2;
}
.win-popup-x:hover {
    background: rgba(255,255,255,.14);
    color: #fff;
}

@media (max-width: 480px) {
    .win-popup { border-radius: 18px; }
    .win-popup-inner { padding: 28px 20px 24px; }
    .win-popup-title { font-size: 1.6rem; }
}
