/* ==========================================================================
   KAY Scholar - Hanging Clothesline Course Cards
   ========================================================================== */

/* Container and Horizontal Clothesline Wire */
.hanging-courses-container {
    position: relative;
    padding-top: 10px;
}

.hanging-clothesline {
    position: absolute;
    top: 14px;
    left: -15px;
    right: -15px;
    height: 3px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(133, 95, 235, 0.25) 4%,
        rgba(120, 80, 232, 0.65) 15%,
        #8258e8 50%,
        rgba(120, 80, 232, 0.65) 85%,
        rgba(133, 95, 235, 0.25) 96%,
        transparent 100%);
    box-shadow: 0 1px 3px rgba(120, 80, 232, 0.25);
    border-radius: 2px;
    z-index: 10;
    pointer-events: none;
}

/* Metallic eyelets/anchors on the far sides of the line */
.hanging-clothesline::before,
.hanging-clothesline::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #7850e8;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(120, 80, 232, 0.4);
}
.hanging-clothesline::before { left: 8px; }
.hanging-clothesline::after { right: 8px; }

/* Ensure Owl Carousel stage has room for threads, clips and pendulum sway */
.home-popular-courses .wpo-popular-slider .owl-stage-outer {
    padding: 18px 12px 34px !important;
    margin: -18px -12px -34px !important;
}

/* Card Rig & Suspension */
.hanging-card-rig {
    position: relative;
    padding-top: 4px;
}

.hanging-clothes-card {
    position: relative;
    padding-top: 34px; /* Space for the hanging thread and clips */
    transform-origin: 50% 0px; /* Pivots exactly from the clothesline wire */
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: transform;
}

/* Hanger Threads and Clothespins */
.hanging-hanger {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 38px;
    pointer-events: none;
    z-index: 6;
}

/* Vertical Suspended Cord/Thread */
.hanging-thread {
    position: absolute;
    top: 0;
    width: 2px;
    height: 24px;
    background: linear-gradient(180deg, #7850e8 0%, #a855f7 60%, #c084fc 100%);
    box-shadow: 0 0 3px rgba(120, 80, 232, 0.35);
}
.hanging-thread.thread-left {
    left: 20%;
}
.hanging-thread.thread-right {
    right: 20%;
}

/* Realistic Wooden Clothespin / Peg */
.hanging-clip {
    position: absolute;
    top: 18px; /* Extends 14px above card top and overlaps 10px onto the card */
    width: 12px;
    height: 24px;
    border-radius: 3px 3px 2px 2px;
    background: linear-gradient(135deg, #e4be88 0%, #cf9c6b 40%, #ad7644 100%);
    border: 1px solid rgba(120, 75, 35, 0.4);
    box-shadow: 0 3px 7px rgba(0, 0, 0, 0.22), inset 0 1px 1px rgba(255, 255, 255, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 7;
}
.hanging-clip.clip-left {
    left: calc(20% - 5px);
}
.hanging-clip.clip-right {
    right: calc(20% - 5px);
}

/* Metallic tension spring coil in the middle of the clothespin */
.clip-spring {
    width: 14px;
    height: 4px;
    background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 45%, #64748b 100%);
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* Clothespin pinch notch at bottom */
.hanging-clip::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 5px;
    background: rgba(70, 40, 18, 0.65);
    border-radius: 2px 2px 0 0;
}

/* ==========================================================================
   Desktop View: Interactive Pendulum Sway & Breeze on Hover
   ========================================================================== */
@media (min-width: 992px) and (hover: hover) {
    /* Subtle natural ambient breeze when not hovered */
    .wpo-popular-slider .item:nth-child(odd) .hanging-clothes-card {
        animation: hangingBreeze 6s ease-in-out infinite alternate;
    }
    .wpo-popular-slider .item:nth-child(even) .hanging-clothes-card {
        animation: hangingBreeze 6.5s ease-in-out infinite alternate-reverse;
        animation-delay: -2.2s;
    }

    /* Active realistic pendulum swing on hover */
    .hanging-clothes-card:hover {
        animation: hangingCardSwing 2s cubic-bezier(0.25, 0.46, 0.45, 0.94) both !important;
        z-index: 15;
    }

    .hanging-clothes-card:hover .wpo-popular-item {
        box-shadow: 0 20px 42px rgba(120, 80, 232, 0.18), 0 8px 18px rgba(35, 20, 70, 0.08) !important;
        border-color: rgba(133, 95, 235, 0.45) !important;
    }
}

/* Realistic physical pendulum damping swing keyframes */
@keyframes hangingCardSwing {
    0% {
        transform: rotate(0deg);
    }
    18% {
        transform: rotate(4.6deg);
    }
    38% {
        transform: rotate(-3.5deg);
    }
    58% {
        transform: rotate(2.2deg);
    }
    76% {
        transform: rotate(-1.1deg);
    }
    90% {
        transform: rotate(0.4deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

/* Very subtle organic ambient drift */
@keyframes hangingBreeze {
    0%, 100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(0.7deg);
    }
}

/* ==========================================================================
   Mobile & Touch View: Shows hanging clothesline & clips WITHOUT hover swing
   ========================================================================== */
@media (max-width: 991px) {
    .hanging-clothes-card {
        animation: none !important;
        transform: none !important;
    }
    .hanging-clothes-card:hover {
        animation: none !important;
        transform: none !important;
    }
    .hanging-thread.thread-left {
        left: 18%;
    }
    .hanging-thread.thread-right {
        right: 18%;
    }
    .hanging-clip.clip-left {
        left: calc(18% - 5px);
    }
    .hanging-clip.clip-right {
        right: calc(18% - 5px);
    }
}

