/**
 * ContentDB Discord unlock onboarding tip.
 * Calm but complete — all unlock points stay visible.
 */

.cdb-discord-unlock {
    position: fixed;
    z-index: 10050;
    width: min(300px, calc(100vw - 28px));
    padding: 0.9rem 0.9rem 0.95rem;
    border-radius: 14px;
    border: 1px solid rgba(88, 101, 242, 0.24);
    background:
        linear-gradient(165deg, rgba(18, 22, 38, 0.95) 0%, rgba(10, 12, 20, 0.97) 100%);
    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.38),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset;
    color: #eef2ff;
    font-family: 'Outfit', 'Inter', system-ui, sans-serif;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition:
        opacity 0.28s ease,
        transform 0.28s ease;
}

.cdb-discord-unlock--visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.cdb-discord-unlock--leaving {
    opacity: 0;
    transform: translateY(5px);
    pointer-events: none;
}

.cdb-discord-unlock__glow {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at 12% 0%, rgba(88, 101, 242, 0.1), transparent 50%);
    pointer-events: none;
    opacity: 0.85;
}

.cdb-discord-unlock__close {
    appearance: none;
    position: absolute;
    top: 0.28rem;
    right: 0.28rem;
    z-index: 2;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    color: rgba(196, 205, 240, 0.65);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.cdb-discord-unlock__close:hover,
.cdb-discord-unlock__close:focus-visible {
    color: #fff;
    background: rgba(88, 101, 242, 0.12);
    border-color: rgba(88, 101, 242, 0.28);
    outline: none;
}

.cdb-discord-unlock__head {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    padding-right: 1.15rem;
    margin-bottom: 0.65rem;
}

.cdb-discord-unlock__badge {
    flex-shrink: 0;
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    color: #fff;
    background: linear-gradient(135deg, #7289da 0%, #5865f2 55%, #4752c4 100%);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.22);
}

.cdb-discord-unlock__title {
    margin: 0 0 0.22rem;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.3;
    color: #f4f6ff;
}

.cdb-discord-unlock__body {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.4;
    color: rgba(190, 200, 235, 0.88);
}

.cdb-discord-unlock__features {
    position: relative;
    z-index: 1;
    list-style: none;
    margin: 0 0 0.75rem;
    padding: 0;
    display: grid;
    gap: 0.28rem;
}

.cdb-discord-unlock__features li {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.76rem;
    font-weight: 600;
    color: rgba(220, 228, 255, 0.92);
    opacity: 0;
    transform: translateY(3px);
}

.cdb-discord-unlock--visible .cdb-discord-unlock__features li {
    animation: cdbDiscordFeatureIn 0.28s ease forwards;
}

.cdb-discord-unlock--visible .cdb-discord-unlock__features li:nth-child(1) { animation-delay: 0.05s; }
.cdb-discord-unlock--visible .cdb-discord-unlock__features li:nth-child(2) { animation-delay: 0.09s; }
.cdb-discord-unlock--visible .cdb-discord-unlock__features li:nth-child(3) { animation-delay: 0.13s; }
.cdb-discord-unlock--visible .cdb-discord-unlock__features li:nth-child(4) { animation-delay: 0.17s; }
.cdb-discord-unlock--visible .cdb-discord-unlock__features li:nth-child(5) { animation-delay: 0.21s; }

.cdb-discord-unlock__features i {
    width: 1rem;
    text-align: center;
    color: #9bb4f0;
    font-size: 0.72rem;
    flex-shrink: 0;
}

.cdb-discord-unlock__cta {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 2.65rem;
    justify-content: center;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    text-decoration: none;
    font-size: 0.9rem;
}

.cdb-discord-unlock__pointer {
    position: absolute;
    top: -6px;
    right: 28px;
    width: 11px;
    height: 11px;
    background: rgba(18, 22, 38, 0.97);
    border-left: 1px solid rgba(88, 101, 242, 0.24);
    border-top: 1px solid rgba(88, 101, 242, 0.24);
    transform: rotate(45deg);
}

.cdb-discord-unlock--above .cdb-discord-unlock__pointer {
    top: auto;
    bottom: -6px;
    border-left: none;
    border-top: none;
    border-right: 1px solid rgba(88, 101, 242, 0.24);
    border-bottom: 1px solid rgba(88, 101, 242, 0.24);
}

.cdb-discord-unlock--mobile .cdb-discord-unlock__pointer {
    right: 50%;
    margin-right: -5.5px;
}

/* Soft pulse on Discord login — noticeable, not aggressive */
.btn-discord.cdb-discord-login--hint {
    box-shadow: 0 0 0 0 rgba(88, 101, 242, 0.28);
    animation: cdbDiscordLoginHint 2.8s ease-in-out infinite;
}

@keyframes cdbDiscordLoginHint {
    0%, 100% { box-shadow: 0 0 0 0 rgba(88, 101, 242, 0.28); }
    50% { box-shadow: 0 0 0 8px rgba(88, 101, 242, 0); }
}

@keyframes cdbDiscordFeatureIn {
    to { opacity: 1; transform: translateY(0); }
}

/* Desktop / tablet */
@media (min-width: 721px) {
    .cdb-discord-unlock {
        width: min(300px, calc(100vw - 32px));
    }
}

/* Phone */
@media (max-width: 720px) {
    .cdb-discord-unlock {
        width: min(292px, calc(100vw - 24px));
        max-height: min(70dvh, 70vh);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0.82rem 0.82rem 0.88rem;
        border-radius: 13px;
    }

    .cdb-discord-unlock__title {
        font-size: 0.88rem;
    }

    .cdb-discord-unlock__body {
        font-size: 0.75rem;
    }

    .cdb-discord-unlock__features {
        gap: 0.24rem;
        margin-bottom: 0.7rem;
    }

    .cdb-discord-unlock__features li {
        font-size: 0.74rem;
    }

    .cdb-discord-unlock__cta {
        min-height: 2.85rem;
    }

    .cdb-discord-unlock__close {
        width: 2.35rem;
        height: 2.35rem;
    }

    .auth-buttons .btn-discord {
        max-width: min(100%, 11.5rem);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 0.85rem;
        padding-left: 0.7rem;
        padding-right: 0.7rem;
    }
}

@media (max-width: 380px) {
    .cdb-discord-unlock {
        width: calc(100vw - 20px);
        padding: 0.75rem 0.75rem 0.8rem;
    }

    .cdb-discord-unlock__head {
        gap: 0.55rem;
        margin-bottom: 0.55rem;
    }

    .cdb-discord-unlock__badge {
        width: 2rem;
        height: 2rem;
        font-size: 0.95rem;
    }
}

/* Inline unlock chips (shop / chat gates — not a popup) */
.cdb-discord-unlock-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.85rem 0 1rem;
    padding: 0;
    list-style: none;
}

.cdb-discord-unlock-inline li {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(0, 212, 255, 0.2);
    background: rgba(0, 212, 255, 0.05);
    color: #b8d9f0;
    font-size: 0.75rem;
    font-weight: 600;
}

.cdb-discord-unlock-inline i {
    color: #7dd3fc;
    font-size: 0.7rem;
}

.hero-discord-unlock-inline {
    margin-top: 0.85rem;
    justify-content: center;
}

.shop-public-login-card .cdb-discord-unlock-banner {
    margin-bottom: 1rem;
}

.shop-public-login-card .cdb-discord-unlock-banner .btn-discord {
    white-space: nowrap;
}

.cdb-discord-unlock-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0 0 1rem;
    padding: 0.7rem 0.85rem;
    border-radius: 12px;
    border: 1px solid rgba(88, 101, 242, 0.22);
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.08), rgba(0, 212, 255, 0.04));
}

.cdb-discord-unlock-banner__text {
    margin: 0;
    color: rgba(210, 220, 255, 0.92);
    font-size: 0.86rem;
    line-height: 1.4;
}

@media (prefers-reduced-motion: reduce) {
    .cdb-discord-unlock {
        transition: opacity 0.15s ease;
        transform: none;
    }
    .cdb-discord-unlock--visible,
    .cdb-discord-unlock--leaving {
        transform: none;
    }
    .cdb-discord-unlock--visible .cdb-discord-unlock__features li {
        animation: none;
        opacity: 1;
        transform: none;
    }
    .btn-discord.cdb-discord-login--hint {
        animation: none;
    }
}
