/* ===== RESET ===== */
.zp-video-learning {
    box-sizing: border-box;
    background: transparent;
}

.zp-video-learning *,
.zp-video-learning *::before,
.zp-video-learning *::after {
    box-sizing: inherit;
}

/* Prevent global h1-h6 theme styles from bleeding in */
.zp-video-learning h1,
.zp-video-learning h2,
.zp-video-learning h3,
.zp-video-learning h4,
.zp-video-learning h5,
.zp-video-learning h6 {
    margin: 0;
    padding: 0;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    color: inherit;
    border: none;
    background: none;
    font-family: inherit;
}

/* ===== LAYOUT ===== */
.zp-container {
    display: flex;
    margin: 0 auto;
    width: 100%;
}

.zp-left {
    flex: 0 0 58%;
    max-width: 58%;
    padding-right: 20px;
}

.zp-right {
    flex: 0 0 42%;
    max-width: 42%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* ===== HEADING ===== */
.zp-video-learning .zp-heading {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 56px;
    font-weight: 900;
    line-height: 1.2;
    color: #ffffff;
    margin: 0 0 18px;
    padding: 0;
    white-space: pre-line;
}

/* ===== SUBTITLE ===== */
.zp-video-learning .zp-subtitle {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 19px;
    font-weight: 400;
    line-height: 1.5;
    color: #ffffff;
    margin: 0 0 32px;
    padding: 0;
}

/* ===== PANEL ===== */
.zp-panel {
    max-width: 730px;
    background-color: #ffd200;
    border-radius: 12px;
    padding: 24px;
}

.zp-video-learning .zp-panel-title {
    margin: 0 0 24px;
    font-weight: 800;
    line-height: 1.2;
}

/* ===== TABS ===== */
.zp-tabs {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.zp-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition:
        background-color 0.2s,
        color 0.2s;
}

.zp-tab:focus-visible {
    outline: 2px solid #0a0a2e;
    outline-offset: 2px;
}

.zp-tab-content {
    display: none;
}

.zp-tab-content.active {
    display: block;
}

/* ===== CARDS ===== */
.zp-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.zp-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
    cursor: pointer;
    border: none;
    font-family: inherit;
    text-align: left;
    transition:
        background-color 0.2s,
        box-shadow 0.2s;
    min-width: 0;
    min-height: 84px;
    white-space: normal;
}

.zp-card:focus-visible {
    outline: 2px solid #0a0a2e;
    outline-offset: 2px;
}

.zp-card-title {
    min-width: 0;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 8px;
    overflow-wrap: anywhere;
}

.zp-card-duration {
    font-family: "Inter", sans-serif;
    font-size: 17px;
    font-weight: 400;
    line-height: 1.5;
    color: #0d0e34;
}

.zp-card-icon {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.zp-card-icon img {
    display: block;
}

/* ===== ACCORDION ===== */
.zp-accordion {
    margin-top: 16px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 12px;
}

.zp-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 54px;
    cursor: pointer;
    border: none;
    background-color: #ffffff;
    border-radius: 8px;
    font-family: inherit;
    text-align: left;
    padding: 0 16px;
    transition: none;
}

.zp-accordion-header:hover {
    background-color: #ffffff;
}

.zp-accordion-header:focus-visible {
    outline: 2px solid #0a0a2e;
    outline-offset: 2px;
}

.zp-accordion-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: "Inter", sans-serif;
    font-size: 19px;
    font-weight: 800;
    line-height: 1.5;
}

.zp-accordion-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 12px;
    width: 32px;
    height: 32px;
    background-color: #2f248f;
    border-radius: 50%;
    color: #ffffff;
    transition: transform 0.3s;
}

.zp-accordion-icon svg {
    stroke: #ffffff;
    color: #ffffff;
}

.zp-accordion-header.open .zp-accordion-icon {
    transform: rotate(45deg);
}

.zp-accordion-body {
    overflow: hidden;
}

/* ===== VIDEO BOX ===== */
.zp-video-box {
    position: relative;
    overflow: hidden;
    border: 3px solid #ff7a1a;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zp-video-learning .zp-video-thumb {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center center !important;
}

/* ===== PLAY BUTTON ===== */
.zp-play-btn {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent !important;
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s;
}

.zp-play-btn:hover,
.zp-play-btn:focus,
.zp-play-btn:active {
    background: transparent !important;
    transform: scale(1.08);
}

.zp-play-btn img {
    width: 64px;
    height: 64px;
    display: block;
}

.zp-play-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 4px;
}

/* ===== VIDEO WRAPPER (inline mode) ===== */
.zp-video-wrapper {
    position: absolute;
    inset: 0;
    z-index: 3;
}

.zp-video-wrapper iframe,
.zp-video-wrapper video {
    width: 100%;
    height: 100%;
    border: none;
}

.zp-video-wrapper.is-vertical {
    left: 50%;
    right: auto;
    width: auto;
    height: 100%;
    aspect-ratio: 9 / 16;
    transform: translateX(-50%);
    background: #000000;
}

.zp-video-wrapper.inline-active ~ .zp-play-btn,
.zp-video-wrapper.inline-active ~ .zp-video-thumb {
    display: none;
}

/* ===== LIGHTBOX ===== */
.zp-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.zp-lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
}

.zp-lightbox-content {
    position: relative;
    width: 80%;
    max-width: 960px;
    aspect-ratio: 16 / 9;
    max-height: 80vh;
    z-index: 1;
}

.zp-lightbox-content.is-vertical {
    width: min(420px, 92vw, calc(80vh * 9 / 16));
    max-width: none;
    height: auto;
    max-height: none;
    aspect-ratio: 9 / 16;
}

.zp-lightbox > .zp-lightbox-close {
    position: absolute !important;
    top: calc(env(safe-area-inset-top, 0px) + 16px) !important;
    right: calc(env(safe-area-inset-right, 0px) + 16px) !important;
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    appearance: none;
    background: #ff7a1a;
    border: none;
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.zp-lightbox > .zp-lightbox-close svg {
    display: block;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
}

.zp-lightbox > .zp-lightbox-close:hover {
    opacity: 0.85;
}

.zp-lightbox-video,
.zp-lightbox-video iframe,
.zp-lightbox-video video {
    width: 100%;
    height: 100%;
    border: none;
}

/* ===== STACKED LAYOUT (≤1024px) ===== */
@media (max-width: 1024px) {
    /* Heading & subtitle hidden on stacked */
    .zp-video-learning .zp-heading,
    .zp-video-learning .zp-subtitle {
        display: none;
    }

    .zp-container {
        flex-direction: column;
    }

    .zp-left,
    .zp-right {
        flex: 0 0 100%;
        max-width: 100%;
        padding-right: 0;
    }

    /* Video on top, 10px gap below it */
    .zp-right {
        order: -1;
        margin-bottom: 10px;
        justify-content: flex-start;
    }

    .zp-video-learning .zp-panel {
        max-width: 100%;
        padding: 12px !important;
    }

    .zp-accordion {
        padding: 4px;
    }

    .zp-cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* ponytail: !important needed — Elementor's per-widget CSS wins over media queries otherwise */
    .zp-video-learning .zp-tabs .zp-tab {
        font-size: 12px !important;
        padding: 14px !important;
    }

    .zp-video-learning .zp-accordion-label {
        font-size: 16px !important;
    }

    /* Override Elementor's column_gap which becomes row gap in column direction */
    .zp-video-learning .zp-container {
        gap: 0 !important;
    }

    /* gradient overlay on thumbnail in stacked layout */
    .zp-video-box::after {
        content: "";
        position: absolute;
        z-index: 1;
        inset: 0;
        background: linear-gradient(
            180deg,
            rgba(13, 14, 52, 0) 0%,
            #0d0e34 100%
        );
        pointer-events: none;
    }

    .zp-video-learning .zp-panel-title {
        margin-bottom: 12px !important;
    }
}

/* ===== MOBILE (≤767px): single-row cards ===== */
@media (max-width: 767px) {
    /* Cards become single horizontal row */
    .zp-card {
        flex-direction: row;
        align-items: center;
        min-height: unset;
        padding: 8px 12px;
        border-radius: 8px;
        position: relative;
    }

    .zp-card-title {
        flex: 1;
        margin-bottom: 0;
    }

    .zp-card-duration {
        font-size: 12px;
        margin: 0 8px 0 12px;
    }

    .zp-card-icon {
        position: static;
    }

    .zp-cards-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    /* Scrollable tabs */
    .zp-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .zp-tabs::-webkit-scrollbar {
        display: none;
    }

    .zp-tab {
        flex-shrink: 0;
    }

    .zp-video-box {
        min-height: 445px !important;
    }

    .zp-lightbox-content {
        width: 95%;
    }
}
