/* CS 145 Course Tour — lightweight overlay tour
   Used on the index page (auto-run on first visit) and triggerable
   from Module0-Kickoff/how-to-navigate.html via the "Take the Tour"
   button. No external dependencies. */

.cstour-mask {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: auto;
}
.cstour-mask.cstour-visible { opacity: 1; }

.cstour-spotlight {
    position: absolute;
    border: 3px solid #3B82F6;
    border-radius: 10px;
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.55);
    transition: all 0.3s ease;
    z-index: 9999;
    pointer-events: none;
}

.cstour-popover {
    position: absolute;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    padding: 1.25rem 1.4rem;
    width: min(360px, 90vw);
    z-index: 10000;
    font-family: 'Inter', sans-serif;
    color: #0F172A;
    line-height: 1.5;
    transition: top 0.3s ease, left 0.3s ease, opacity 0.2s ease;
}

.cstour-step {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #64748B;
    font-weight: 600;
    margin-bottom: 0.4rem;
}
.cstour-popover h3 {
    font-size: 1.05rem;
    margin: 0 0 0.5rem 0;
    color: #0F172A;
    font-weight: 600;
}
.cstour-popover p {
    margin: 0 0 1rem 0;
    color: #475569;
    font-size: 0.92rem;
}
.cstour-popover .cstour-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}
.cstour-popover button {
    font-family: inherit;
    cursor: pointer;
    font-weight: 600;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
.cstour-popover .cstour-skip {
    background: transparent;
    border: none;
    color: #64748B;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}
.cstour-popover .cstour-skip:hover { color: #0F172A; }
.cstour-popover .cstour-next,
.cstour-popover .cstour-back {
    border: 1px solid #E2E8F0;
    background: #FFFFFF;
    color: #0F172A;
    padding: 0.55rem 1rem;
    font-size: 0.9rem;
}
.cstour-popover .cstour-back:hover { background: #F1F5F9; }
.cstour-popover .cstour-next { background: #3B82F6; color: #FFFFFF; border-color: #3B82F6; }
.cstour-popover .cstour-next:hover { background: #2563EB; border-color: #2563EB; }

/* Caret arrow on the popover, pointing at the spotlight */
.cstour-popover::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background: #FFFFFF;
    transform: rotate(45deg);
}
.cstour-popover[data-pos="bottom"]::before { top: -7px; left: 36px; box-shadow: -1px -1px 1px rgba(0,0,0,0.04); }
.cstour-popover[data-pos="top"]::before    { bottom: -7px; left: 36px; box-shadow: 1px 1px 2px rgba(0,0,0,0.06); }
.cstour-popover[data-pos="right"]::before  { left: -7px; top: 28px; box-shadow: -1px 1px 2px rgba(0,0,0,0.06); }
.cstour-popover[data-pos="left"]::before   { right: -7px; top: 28px; box-shadow: 1px -1px 1px rgba(0,0,0,0.06); }
.cstour-popover[data-pos="center"]::before { display: none; }

/* Centered popover when no target element exists for this step */
.cstour-popover.cstour-centered {
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%);
}

@media (max-width: 700px) {
    .cstour-popover { width: 92vw; }
}
