/* ==========================================================================
   Program Cards - Homepage Interactive Section
   ========================================================================== */

/* Main wrapper */
.program-cards-wrapper {
    position: relative;
    width: 100%;
    padding: 2rem 0 3rem;
    margin: 0 auto;
}

/* Container with horizontal scroll */
.program-cards-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    cursor: grab;
    scroll-behavior: smooth;

    /* Hide scrollbar but keep functionality */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.program-cards-container::-webkit-scrollbar {
    display: none;  /* Chrome, Safari, Opera */
}

/* Active dragging state */
.program-cards-container.dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}

.program-cards-container.dragging .program-card {
    pointer-events: none;
    user-select: none;
}

/* Cards track */
.program-cards-track {
    display: flex;
    gap: 2rem;
    padding: 0 1rem;
    min-width: min-content;

    /* Center when cards fit in viewport */
    justify-content: center;
    align-items: stretch;
}

/* Force left alignment when scrollable */
.program-cards-container.scrollable .program-cards-track {
    justify-content: flex-start;
}

/* Card link wrapper */
.program-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    outline: none;
}

.program-card-link:focus {
    outline: none;
}

.program-card-link:focus-visible .program-card {
    outline: 2px solid var(--color-gold);
    outline-offset: 4px;
}

/* Individual program card */
.program-card {
    flex: 0 0 auto;
    position: relative;
    height: 245px;
    padding: 2rem 1.75rem;
    border-radius: 26px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

/* Dark variant (Cards 1, 3, 5) - 286px */
.program-card-dark {
    width: 286px;
    background: linear-gradient(180deg, rgba(0, 9, 47, 0.88) 0%, rgba(0, 45, 115, 0.88) 100%);
    opacity: 0.88;
    border: 1px solid #002D73;
    box-shadow: 0px 0px 12px 2px rgba(255, 174, 23, 0.3);
}

/* Light variant (Cards 2, 4, 6) - 378px */
.program-card-light {
    width: 378px;
    background: linear-gradient(180deg, rgba(0, 45, 115, 0.3) 0%, rgba(178, 167, 157, 0.47) 100%);
    opacity: 0.92;
    border: 1px solid #CCDDE7;
    box-shadow: 0px 0px 12px 2px rgba(255, 174, 23, 0.3);
}

/* Hover effects */
.program-card-link:hover .program-card {
    transform: translateY(-8px) scale(1.02);
}

.program-card-link:hover .program-card-dark {
    border-color: var(--color-gold);
    box-shadow: 0px 8px 24px 4px rgba(255, 174, 23, 0.5);
}

.program-card-link:hover .program-card-light {
    border-color: var(--color-teal);
    box-shadow: 0px 8px 24px 4px rgba(40, 117, 162, 0.5);
}

/* Card content wrapper */
.program-card-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Title (Megrim font - TITLE) */
.program-card-title {
    font-family: 'Megrim', var(--font-heading);
    font-size: 1.8rem;
    color: var(--color-white);
    margin: 0 0 1rem 0;
    letter-spacing: 0.08em;
    line-height: 1.2;
    font-weight: 400;
}

/* Time (Megrim font - UNDER_TITLE) */
.program-card-time {
    font-family: 'Megrim', var(--font-heading);
    font-size: 1.1rem;
    color: var(--color-gold);
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
    font-weight: 400;
}

/* Description (Alegreya font - UNDER_UNDER_TITLE) */
.program-card-description {
    font-family: 'Alegreya', var(--font-body);
    font-size: 1rem;
    color: var(--color-light-blue);
    line-height: 1.6;
    margin: auto 0 0 0;
    font-style: italic;
}

/* Optional number badge (commented out in widget by default) */
.program-card-number {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--color-gold) 0%, rgba(255, 177, 23, 0.7) 100%);
    color: var(--color-cosmic-blue);
    font-family: var(--font-numbers);
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(255, 177, 23, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.program-card-link:hover .program-card-number {
    transform: scale(1.15) rotate(10deg);
    box-shadow: 0 6px 16px rgba(255, 177, 23, 0.6);
}

/* Scroll hint indicator */
.scroll-hint {
    position: absolute;
    bottom: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 10;
}

.program-cards-container.scrollable ~ .scroll-hint {
    opacity: 0.6;
}

.program-cards-container.scrollable:hover ~ .scroll-hint {
    opacity: 0.9;
}

.scroll-hint-text {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--color-light-blue);
    font-style: italic;
    background: rgba(0, 9, 47, 0.8);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

/* ========================================================================
   Responsive Design
   ======================================================================== */

/* Large desktops (1400px+) */
@media (min-width: 1400px) {
    .program-cards-track {
        gap: 2.5rem;
    }
}

/* Standard desktop (1200px - 1399px) */
@media (max-width: 1399px) {
    .program-card-dark {
        width: 270px;
    }

    .program-card-light {
        width: 355px;
    }

    .program-cards-track {
        gap: 1.75rem;
    }
}

/* Small desktop / large tablet (992px - 1199px) */
@media (max-width: 1199px) {
    .program-card-dark {
        width: 260px;
    }

    .program-card-light {
        width: 340px;
    }

    .program-card {
        height: 260px;
        padding: 1.75rem 1.5rem;
    }

    .program-card-title {
        font-size: 1.6rem;
    }

    .program-card-time {
        font-size: 1rem;
    }
}

/* Tablet (768px - 991px) */
@media (max-width: 991px) {
    .program-card-dark,
    .program-card-light {
        width: 300px;
    }

    .program-card {
        height: 240px;
    }

    .program-cards-track {
        gap: 1.5rem;
    }

    .program-card-title {
        font-size: 1.5rem;
    }
}

/* Mobile (< 768px) - Switch to vertical stacking */
@media (max-width: 767px) {
    .program-cards-wrapper {
        padding: 1rem 0 2rem;
    }

    .program-cards-container {
        overflow-x: visible;
        cursor: default;
    }

    .program-cards-track {
        flex-direction: column;
        gap: 1.5rem;
        padding: 0;
        justify-content: flex-start;
    }

    .program-card-dark,
    .program-card-light {
        width: 100%;
        max-width: 100%;
    }

    .program-card {
        height: auto;
        min-height: 200px;
        padding: 1.5rem 1.25rem;
    }

    .program-card-link:hover .program-card {
        transform: translateY(-4px) scale(1.01);
    }

    .program-card-title {
        font-size: 1.4rem;
    }

    .program-card-time {
        font-size: 0.95rem;
    }

    .program-card-description {
        font-size: 0.9rem;
    }

    .scroll-hint {
        display: none;
    }
}

/* Small mobile (< 576px) */
@media (max-width: 575px) {
    .program-card {
        min-height: 180px;
        padding: 1.25rem 1rem;
        border-radius: 20px;
    }

    .program-card-title {
        font-size: 1.3rem;
        margin-bottom: 0.75rem;
    }

    .program-card-time {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
    }

    .program-card-description {
        font-size: 0.85rem;
    }
}

/* Animation for cards appearing */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.program-card {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Stagger animation for each card */
.program-card-link:nth-child(1) .program-card { animation-delay: 0.1s; }
.program-card-link:nth-child(2) .program-card { animation-delay: 0.2s; }
.program-card-link:nth-child(3) .program-card { animation-delay: 0.3s; }
.program-card-link:nth-child(4) .program-card { animation-delay: 0.4s; }
.program-card-link:nth-child(5) .program-card { animation-delay: 0.5s; }
.program-card-link:nth-child(6) .program-card { animation-delay: 0.6s; }

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .program-card {
        animation: none;
    }

    .program-card-link:hover .program-card {
        transform: translateY(-4px) scale(1.01);
    }

    .program-cards-container {
        scroll-behavior: auto;
    }
}
