/* Video Library overlay shared by non-home pages */
.video-overlay {
    position: fixed;
    inset: 0;
    z-index: 210;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    font-family: 'Nunito', 'Segoe UI', Arial, sans-serif;
}

.video-overlay.video-hidden {
    display: none;
}

.video-backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 18% 22%, rgba(99, 179, 237, 0.34), transparent 26%),
        radial-gradient(circle at 78% 18%, rgba(246, 173, 85, 0.28), transparent 28%),
        radial-gradient(circle at 50% 100%, rgba(104, 211, 145, 0.18), transparent 34%),
        rgba(2, 8, 23, 0.86);
    backdrop-filter: blur(8px);
}

.video-panel {
    position: relative;
    z-index: 1;
    width: min(1040px, 100%);
    max-height: 94vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 24px 28px;
    color: white;
    border-radius: 28px;
    background:
        radial-gradient(circle at 14% 18%, rgba(99, 179, 237, 0.26), transparent 22%),
        radial-gradient(circle at 78% 14%, rgba(251, 211, 141, 0.2), transparent 20%),
        radial-gradient(circle at 50% 56%, transparent 0 22%, rgba(99, 179, 237, 0.08) 23%, transparent 24%),
        radial-gradient(circle at 50% 56%, transparent 0 38%, rgba(251, 211, 141, 0.07) 39%, transparent 40%),
        linear-gradient(135deg, rgba(5, 16, 35, 0.98), rgba(13, 45, 78, 0.98) 56%, rgba(7, 24, 43, 0.98));
    border: 1px solid rgba(190, 227, 248, 0.22);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.video-panel::before {
    content: "";
    position: absolute;
    inset: 18px;
    pointer-events: none;
    border-radius: 22px;
    background:
        radial-gradient(circle at 24% 30%, rgba(99, 179, 237, 0.22) 0 2px, transparent 3px),
        radial-gradient(circle at 45% 18%, rgba(251, 211, 141, 0.18) 0 2px, transparent 3px),
        radial-gradient(circle at 70% 34%, rgba(104, 211, 145, 0.16) 0 2px, transparent 3px),
        linear-gradient(120deg, transparent 0 28%, rgba(99, 179, 237, 0.1) 29% 30%, transparent 31%),
        linear-gradient(40deg, transparent 0 40%, rgba(251, 211, 141, 0.08) 41% 42%, transparent 43%);
    background-size: 180px 120px;
    mask-image: radial-gradient(circle at 50% 40%, black, transparent 78%);
}

.video-panel::after {
    content: "";
    position: absolute;
    top: -80px;
    right: -80px;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    border: 2px solid rgba(251, 211, 141, 0.22);
    box-shadow: 0 0 70px rgba(99, 179, 237, 0.22);
    pointer-events: none;
}

.video-header {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 10px;
}

.video-title-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
}

.video-brain-mark {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 22px;
    background:
        radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.32), transparent 24%),
        linear-gradient(135deg, #1a4f8a, #63b3ed);
    font-size: 2rem;
    box-shadow: 0 0 34px rgba(99, 179, 237, 0.34);
}

.video-kicker {
    margin: 0 0 6px;
    color: #fbd38d;
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.video-header h2 {
    margin: 0;
    font-size: 1.7rem;
    line-height: 1.1;
    font-weight: 900;
    text-shadow: 0 0 24px rgba(99, 179, 237, 0.35);
}

.video-close-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.12);
    color: white;
    font-size: 1.7rem;
    line-height: 1;
    cursor: pointer;
}

.video-close-btn:hover {
    background: rgba(255, 255, 255, 0.22);
}

.video-intro {
    position: relative;
    z-index: 1;
    max-width: 680px;
    color: #dbeafe;
    font-size: 0.98rem;
    line-height: 1.5;
    margin: 0 0 14px;
}

.mental-tags {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 14px;
}

.mental-tags a {
    padding: 7px 13px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(190, 227, 248, 0.18);
    color: #bee3f8;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 900;
}

.mental-tags a:hover {
    background: rgba(99, 179, 237, 0.18);
    color: white;
}

.video-library-content {
    position: relative;
    z-index: 1;
    counter-reset: videoNumber;
}

.video-category {
    margin-top: 8px;
    scroll-margin-top: 18px;
}

.video-category:first-child {
    margin-top: 0;
}

.video-category-title {
    margin: 0 0 7px;
    color: #fbd38d;
    font-size: 0.92rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-left: 4px solid #63b3ed;
    padding-left: 10px;
}

.video-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.video-item {
    display: flex;
    position: relative;
    gap: 12px;
    align-items: flex-start;
    padding: 10px 12px;
    background:
        radial-gradient(circle at 12% 16%, rgba(99, 179, 237, 0.12), transparent 22%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.07));
    border: 1px solid rgba(190, 227, 248, 0.18);
    border-radius: 18px;
    color: white;
    text-decoration: none;
    overflow: hidden;
    transition: transform 0.15s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
    counter-increment: videoNumber;
}

.video-item::before {
    content: counter(videoNumber);
    position: absolute;
    top: 10px;
    right: 12px;
    color: rgba(251, 211, 141, 0.24);
    font-size: 2.4rem;
    font-weight: 900;
    line-height: 1;
}

.video-item::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 3px;
    background: linear-gradient(90deg, #63b3ed, #fbd38d);
    opacity: 0;
    transition: opacity 0.15s;
}

.video-item:hover {
    transform: translateY(-3px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(99, 179, 237, 0.1));
    border-color: rgba(251, 211, 141, 0.38);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.24);
}

.video-item:hover::after {
    opacity: 1;
}

.video-play {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #f6ad55, #fbd38d);
    color: #1a202c;
    font-size: 0.95rem;
    font-weight: 900;
    box-shadow: 0 0 22px rgba(251, 211, 141, 0.35);
}

.video-item h3 {
    margin: 0 0 3px;
    color: white;
    font-size: 0.92rem;
    line-height: 1.2;
    font-weight: 900;
    padding-right: 26px;
}

.video-category-label {
    display: block;
    width: fit-content;
    margin-bottom: 7px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(99, 179, 237, 0.16);
    color: #fbd38d;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.video-item p {
    margin: 0;
    color: #dbeafe;
    font-size: 0.9rem;
    line-height: 1.4;
}

.video-player-view {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 26px 30px 32px;
    box-sizing: border-box;
    color: #fff;
    background:
        radial-gradient(circle at 18% 16%, rgba(99, 179, 237, 0.24), transparent 26%),
        linear-gradient(145deg, rgba(5, 16, 35, 0.99), rgba(13, 45, 78, 0.99));
    border-radius: inherit;
}

.video-player-view[hidden] {
    display: none;
}

.video-player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.video-player-back,
.video-player-close {
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    font-family: inherit;
    font-weight: 800;
    cursor: pointer;
}

.video-player-back {
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 0.88rem;
}

.video-player-close {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 1.7rem;
    line-height: 1;
}

.video-player-back:hover,
.video-player-close:hover {
    background: rgba(255, 255, 255, 0.18);
}

.video-player-copy {
    margin-bottom: 18px;
}

.video-player-title {
    margin: 0;
    color: #fff;
    font-size: clamp(1.35rem, 3vw, 2rem);
    line-height: 1.2;
}

.video-player-frame-wrap {
    position: relative;
    width: 100%;
    margin: auto 0;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    background: #000;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.4);
}

.video-player-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

@media (max-width: 760px) {
    .video-panel {
        padding: 24px 20px;
    }

    .video-header h2 {
        font-size: 1.55rem;
    }

    .video-list {
        grid-template-columns: 1fr;
    }

    .video-player-view {
        padding: 20px 18px 24px;
    }
}
