/* ─────────────────────────────────────────────────────────────────────────────
   The sticky bootcamp banner (#bootcamp-ad), shown to signed-in visitors on the
   roadmap, list, lesson and problem pages. Moved verbatim out of style.css; the
   roadmap-only in-table variant (.section-bootcamp-ad) stays there.
   Needs brand.css for its tokens.
   ───────────────────────────────────────────────────────────────────────────── */

/* Sticky advertisement */
#bootcamp-ad {
    position: sticky;
    top: 0;
    background: linear-gradient(120deg, #0f172a 0%, #323C52 45%, #4f46e5 100%);
    padding: 14px 56px 14px 22px;
    text-align: center;
    z-index: 1000;
    width: 100%;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    color: #fff;
    font-family: var(--font-ui);
    cursor: pointer;
    overflow: hidden;
    box-sizing: border-box;
    font-size: 0.9rem;   /* = the roadmap body's 90%, so em sizes match on every page */
    line-height: normal; /* ditto: the roadmap's body sets none */
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Animated diagonal shine */
#bootcamp-ad::before {
    content: '';
    position: absolute;
    top: 0;
    left: -60%;
    width: 50%;
    height: 100%;
    background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.14) 50%, transparent 100%);
    transform: skewX(-20deg);
    animation: bootcampShine 5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes bootcampShine {
    0% { left: -60%; }
    60%, 100% { left: 120%; }
}

#bootcamp-ad:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(79, 70, 229, 0.45);
}

#bootcamp-ad a {
    text-decoration: none;
    color: inherit;
    position: static;
    z-index: 1;
}

#bootcamp-ad > a::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.bootcamp-ad-inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    animation: fadeInDown 0.7s ease;
}

.bootcamp-ad-badge {
    display: inline-block;
    font-size: 0.7em;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #fff;
    backdrop-filter: blur(4px);
}

#bootcamp-ad h1 {
    font-size: 1.5em;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.3px;
    text-transform: none;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    color: #fff;
}

.bootcamp-ad-headline {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    text-align: left;
}
.bootcamp-ad-subline {
    font-size: 0.78em;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.82);
    letter-spacing: 0.2px;
}
.section-bootcamp-ad .bootcamp-ad-subline { font-size: 0.7em; }

.bootcamp-ad-faang {
    background: linear-gradient(90deg, #fbbf24, #f97316);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.bootcamp-ad-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9em;
    font-weight: 600;
    padding: 7px 18px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    backdrop-filter: blur(4px);
    transition: background 0.2s ease, transform 0.2s ease;
    color: #fff;
}

#bootcamp-ad:hover .bootcamp-ad-cta {
    background: rgba(255, 255, 255, 0.28);
}

#bootcamp-ad:hover .bootcamp-ad-arrow {
    transform: translateX(3px);
}

.bootcamp-ad-arrow {
    transition: transform 0.2s ease;
    display: inline-block;
}

/* Close button styles */
#close-ad-btn {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    font-size: 18px;
    font-weight: 400;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.9);
    background-color: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    text-align: center;
    line-height: 26px;
    z-index: 2;
    transition: background-color 0.2s ease, color 0.2s ease;
}

#close-ad-btn:hover {
    background-color: rgba(255, 255, 255, 0.28);
    color: #fff;
}

/* Keyframe animations */
@keyframes fadeInDown {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Add media query for responsiveness */
@media (max-width: 768px) {
    #bootcamp-ad {
        padding: 12px 48px 12px 16px;
    }

    #bootcamp-ad h1 {
        font-size: 1.15em;
    }

    .bootcamp-ad-inner {
        gap: 8px;
    }

    .bootcamp-ad-cta {
        font-size: 0.78em;
        padding: 5px 13px;
    }

    .bootcamp-ad-badge {
        font-size: 0.62em;
        padding: 2px 8px;
    }
}

/* The shine is an infinite animation on ::before, which the `#bootcamp-ad *`
   selector in style.css's reduced-motion block never matched. */
@media (prefers-reduced-motion: reduce) {
    #bootcamp-ad::before { animation: none; display: none; }
    #bootcamp-ad, #bootcamp-ad * { animation: none !important; transition: none !important; }
    #bootcamp-ad:hover { transform: none; }
}
