/* Desktop-only "quick view" hover preview for course cards
   (frontend/js/course-hover-preview.js). One shared floating element is
   reused and repositioned per card — see the JS for why. */

#course-hover-tooltip {
    position: fixed;
    z-index: 2000;
    width: 300px;
    max-width: calc(100vw - 24px);
    background: #fff;
    border: 1px solid #ede8e0;
    border-radius: 12px;
    box-shadow: 0 18px 46px rgba(0,0,0,.16);
    padding: 18px 20px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
    pointer-events: none;
}
#course-hover-tooltip.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    cursor: pointer;
}

/* Pointer triangle — a rotated square, repositioned vertically by JS to
   stay aligned with the card's center even when the tooltip itself is
   vertically clamped near a viewport edge. */
#course-hover-tooltip .chp-arrow {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #fff;
    border: 1px solid #ede8e0;
    transform: rotate(45deg);
}
/* Tooltip sits to the RIGHT of the card — arrow on the tooltip's left edge, pointing left/back at the card. */
#course-hover-tooltip.chp-right .chp-arrow {
    left: -7px;
    border-top: none;
    border-right: none;
}
/* Tooltip sits to the LEFT of the card — arrow on the tooltip's right edge, pointing right at the card. */
#course-hover-tooltip.chp-left .chp-arrow {
    right: -7px;
    border-bottom: none;
    border-left: none;
}

#course-hover-tooltip .chp-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--primary-color, #202020);
    line-height: 1.35;
    margin: 0 0 8px;
}
#course-hover-tooltip .chp-desc {
    font-size: 12.5px;
    line-height: 1.6;
    color: #777;
    margin: 0 0 12px;
}
#course-hover-tooltip .chp-learn {
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
#course-hover-tooltip .chp-learn li {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    font-size: 12px;
    line-height: 1.5;
    color: #444;
}
#course-hover-tooltip .chp-learn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    margin-top: 1.5px;
    color: #087f5b;
}
#course-hover-tooltip .chp-btns {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 12px;
    border-top: 1px solid #f2eee8;
}
#course-hover-tooltip .chp-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 700;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: background .18s, color .18s, border-color .18s;
}
#course-hover-tooltip .chp-btn-primary {
    background: var(--accent-color, #872325);
    color: #fff;
}
#course-hover-tooltip .chp-btn-primary:hover { background: var(--primary-color, #202020); color: #fff; }
#course-hover-tooltip .chp-btn-outline {
    background: #fff;
    color: var(--primary-color, #202020);
    border-color: #e3ddd3;
}
#course-hover-tooltip .chp-btn-outline:hover { border-color: var(--accent-color, #872325); color: var(--accent-color, #872325); }

/* Desktop hover preview is intentionally desktop-only (see the JS
   matchMedia gate) — this belt-and-braces rule hides it under a coarse
   pointer even if something manages to toggle .visible anyway. */
@media (hover: none), (pointer: coarse) {
    #course-hover-tooltip { display: none !important; }
}
