:root {
    --brand: #123b66;
    --teal: #0e7490;
    --green: #0d7c66;
    --mindx: #37d5a1;
    --mindx-soft: #baf7e3;
    --ink: #17202a;
    --muted: #667085;
    --line: #d9e3ec;
    --bg: #f6f9fb;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--bg);
    font-family: "Noto Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.video-header {
    padding-top: 62px;
    color: #fff;
    background:
        linear-gradient(138deg, rgba(7, 28, 50, 0.98), rgba(9, 82, 88, 0.94) 48%, rgba(13, 124, 102, 0.92)),
        url("/static/technomind-logo-white.png") right 12% center / 360px auto no-repeat;
}

.video-nav,
.video-hero,
.video-main,
.video-footer {
    width: min(1320px, calc(100% - 44px));
    margin: 0 auto;
}

.video-nav {
    position: fixed;
    top: 0;
    left: 50%;
    z-index: 900;
    width: min(1320px, calc(100% - 44px));
    min-height: 62px;
    padding: 0 14px;
    border: 1px solid rgba(177, 241, 217, 0.14);
    border-top: 0;
    border-radius: 0 0 10px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: rgba(7, 28, 50, 0.94);
    box-shadow: 0 16px 38px rgba(4, 23, 41, 0.18);
    backdrop-filter: blur(14px);
    transform: translateX(-50%);
}

.video-brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: #fff;
    text-decoration: none;
}

.video-brand img {
    display: block;
    width: 150px;
    max-width: 42vw;
    height: auto;
}

.video-brand span {
    display: inline-flex;
    flex-direction: column;
    border-left: 1px solid rgba(186, 247, 227, 0.35);
    padding-left: 14px;
    line-height: 1;
}

.video-brand strong {
    color: #fff;
    font-size: 23px;
    font-weight: 950;
}

.video-brand em {
    margin-top: 4px;
    color: var(--mindx-soft);
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.video-nav nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px 14px;
}

.video-nav a {
    color: rgba(239, 255, 249, 0.86);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.video-nav a:hover {
    color: #fff;
}

.video-nav .nav-cta {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(177, 241, 217, 0.34);
    border-radius: 8px;
    padding: 0 12px;
    color: #fff;
    background: rgba(255, 255, 255, 0.09);
}

.video-hero {
    padding: 28px 0 34px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--mindx-soft);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.video-hero h1 {
    max-width: 840px;
    margin: 0;
    color: #fff;
    font-size: 34px;
    line-height: 1.12;
    letter-spacing: 0;
}

.video-hero p {
    max-width: 760px;
    margin: 12px 0 0;
    color: rgba(239, 255, 249, 0.86);
    font-size: 15px;
    line-height: 1.55;
}

.video-main {
    padding: 18px 0 0;
}

.video-main.is-theater {
    width: min(1480px, calc(100% - 24px));
}

.watch-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(330px, 380px);
    gap: 18px;
    align-items: start;
}

.watch-primary {
    min-width: 0;
}

.watch-sidebar {
    position: sticky;
    top: 14px;
    min-width: 0;
    max-height: calc(100vh - 28px);
    overflow: auto;
    padding-right: 2px;
    scrollbar-width: thin;
}

.watch-stage-anchor {
    height: 0;
    transition: height 180ms ease;
}

.watch-stage {
    overflow: hidden;
    border: 1px solid rgba(186, 247, 227, 0.18);
    border-radius: 10px;
    background:
        linear-gradient(145deg, rgba(7, 28, 50, 0.98), rgba(8, 48, 63, 0.98) 58%, rgba(8, 70, 66, 0.96)),
        #081827;
    box-shadow: 0 24px 60px rgba(8, 35, 60, 0.18);
    transform-origin: right bottom;
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.watch-stage.is-mini {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 850;
    width: min(420px, calc(100vw - 28px));
    border-color: rgba(186, 247, 227, 0.34);
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
    transform: translate3d(0, 0, 0);
}

.watch-stage.is-mini .watch-frame {
    padding: 8px;
}

.watch-stage.is-mini .player-shell {
    min-height: 0;
    border-radius: 7px;
    box-shadow: none;
}

.watch-stage.is-mini .player-meta {
    display: none;
}

.watch-stage.is-mini .mini-restore {
    display: inline-flex !important;
}

.watch-stage.is-theater-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 1001;
    width: min(1320px, calc(100vw - 44px));
    max-height: calc(100vh - 44px);
    overflow: auto;
    transform: translate(-50%, -50%);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
}

.watch-stage.is-theater-modal .player-shell {
    min-height: min(70vh, 760px);
}

.watch-frame {
    padding: 14px 14px 0;
}

.player-shell {
    position: relative;
    overflow: hidden;
    width: 100%;
    min-height: 430px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: #020b13;
    aspect-ratio: 16 / 9;
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.34);
}

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

.player-shell:fullscreen {
    width: 100vw;
    height: 100vh;
    border: 0;
    border-radius: 0;
    aspect-ratio: auto;
}

.mini-restore {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 2;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    border: 1px solid rgba(186, 247, 227, 0.35);
    border-radius: 999px;
    padding: 0 10px;
    color: #fff;
    background: rgba(2, 11, 19, 0.74);
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.player-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.82);
    background:
        radial-gradient(circle at 50% 38%, rgba(55, 213, 161, 0.2), transparent 28%),
        linear-gradient(145deg, #06192a, #092f3b 58%, #074d45);
    font-weight: 850;
}

.player-empty i {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    color: #08233c;
    background: var(--mindx-soft);
    font-size: 24px;
}

.player-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: start;
    padding: 18px 20px 20px;
    color: #eafdf7;
}

.player-copy {
    min-width: 0;
}

.player-meta h2,
.video-toolbar h2 {
    margin: 0;
    color: var(--brand);
    font-size: 26px;
    line-height: 1.2;
}

.player-meta h2 {
    color: #fff;
    font-size: 23px;
}

.video-toolbar h2 span {
    color: var(--muted);
    font-size: 14px;
    font-weight: 850;
}

.player-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.player-stats span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    border: 1px solid rgba(186, 247, 227, 0.2);
    border-radius: 999px;
    padding: 0 10px;
    color: rgba(234, 253, 247, 0.9);
    background: rgba(255, 255, 255, 0.08);
    font-size: 12px;
    font-weight: 850;
}

.player-meta p:last-of-type {
    margin: 10px 0 0;
    color: rgba(234, 253, 247, 0.75);
    font-size: 14px;
    line-height: 1.7;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.player-meta a,
.player-meta button,
.video-toolbar button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    border: 1px solid rgba(186, 247, 227, 0.24);
    border-radius: 8px;
    padding: 0 14px;
    color: #effff9;
    background: rgba(255, 255, 255, 0.09);
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
}

.player-meta button,
.video-toolbar button {
    cursor: pointer;
}

.player-meta button:hover,
.player-meta a:hover,
.video-toolbar button:hover {
    border-color: rgba(186, 247, 227, 0.55);
    color: #fff;
}

.player-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.video-toolbar {
    display: grid;
    gap: 12px;
    margin: 0 0 12px;
}

.theater-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 22px;
}

.theater-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 11, 19, 0.86);
    backdrop-filter: blur(8px);
}

.theater-dialog {
    position: relative;
    z-index: 1;
    width: min(1320px, 100%);
    max-height: calc(100vh - 44px);
    overflow: auto;
    pointer-events: none;
}

.theater-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(186, 247, 227, 0.35);
    border-radius: 999px;
    color: #fff;
    background: rgba(2, 11, 19, 0.72);
    cursor: pointer;
    pointer-events: auto;
}

body.video-modal-open {
    overflow: hidden;
}

.video-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}

.search-box {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    width: 100%;
    border: 1px solid #cddbe7;
    border-radius: 8px;
    padding: 0 12px;
    color: #53708a;
    background: #fff;
}

.search-box input {
    min-width: 0;
    width: 100%;
    border: 0;
    outline: 0;
    color: var(--ink);
    background: transparent;
    font: inherit;
    font-size: 14px;
}

.autoplay-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    border: 1px solid #cddbe7;
    border-radius: 8px;
    padding: 0 12px;
    color: #2f4a60;
    background: #fff;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    user-select: none;
    transition: border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.autoplay-toggle.is-on {
    border-color: rgba(13, 124, 102, 0.4);
    color: #0b5f4d;
    background: rgba(186, 247, 227, 0.35);
    box-shadow: 0 8px 18px rgba(13, 124, 102, 0.1);
}

.autoplay-toggle input {
    width: 16px;
    height: 16px;
    accent-color: var(--green);
    cursor: pointer;
    flex: 0 0 auto;
}

.autoplay-toggle span {
    pointer-events: none;
}

.playlist-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 12px;
}

.playlist-tabs:empty {
    display: none;
}

.playlist-tabs button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    border: 1px solid #cddbe7;
    border-radius: 999px;
    padding: 0 14px;
    color: #2f4a60;
    background: #fff;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
}

.playlist-tabs button:hover {
    border-color: var(--teal);
    color: #0a5b58;
}

.playlist-tabs button.is-active {
    border-color: rgba(55, 213, 161, 0.55);
    color: #06283d;
    background: linear-gradient(135deg, rgba(186, 247, 227, 0.9), rgba(255, 255, 255, 0.98));
    box-shadow: 0 0 0 3px rgba(55, 213, 161, 0.15);
}

.video-toolbar button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.video-status {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    color: var(--muted);
    background: #fff;
    font-size: 14px;
    font-weight: 750;
}

.video-status.is-error {
    border-color: #f1c5c5;
    color: #8a1f1f;
    background: #fff7f7;
}

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

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

.video-card {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 10px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: none;
}

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

.video-card.is-selected {
    border-color: var(--green);
    background: #f1fbf7;
    box-shadow: 0 0 0 2px rgba(55, 213, 161, 0.2);
}

.video-thumb {
    position: relative;
    display: block;
    width: 100%;
    border: 0;
    padding: 0;
    background: #0b2238;
    cursor: pointer;
    aspect-ratio: 16 / 9;
}

.video-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-thumb span {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
    background: rgba(8, 35, 60, 0.18);
    font-size: 40px;
}

.video-duration {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    border-radius: 5px;
    padding: 0 7px;
    color: #fff;
    background: rgba(8, 24, 39, 0.88);
    font-size: 12px;
    font-weight: 900;
}

.video-card-content {
    min-width: 0;
    padding: 10px 10px 10px 0;
}

.video-card h3 {
    margin: 0;
    color: #1e3146;
    font-size: 13px;
    line-height: 1.35;
}

.video-card p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.video-card time {
    display: block;
    margin-top: 10px;
    color: #557086;
    font-size: 12px;
    font-weight: 800;
}

.video-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    color: #557086;
    font-size: 12px;
    font-weight: 800;
}

.video-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.video-footer {
    padding: 36px 0 28px;
}

.video-footer .platform-footer {
    margin-top: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 22px;
    color: #4d6072;
    background: #fff;
    box-shadow: 0 10px 24px rgba(18, 59, 102, 0.06);
}

.video-footer .platform-footer-inner {
    width: 100%;
    margin: 0;
}

.video-footer .platform-footer-brand {
    color: var(--brand);
}

.video-footer .platform-footer-contact {
    color: #5f7284;
}

.video-footer .platform-footer-links a {
    color: var(--teal);
}

.video-footer .platform-footer-links a:hover {
    color: var(--brand);
}

@media (max-width: 1120px) {
    .watch-layout {
        grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
        gap: 14px;
    }

    .video-card {
        grid-template-columns: 132px minmax(0, 1fr);
    }
}

@media (max-width: 900px) {
    .watch-layout {
        grid-template-columns: 1fr;
    }

    .watch-sidebar {
        position: static;
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    .video-toolbar {
        margin-top: 16px;
    }

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

    .video-card {
        grid-template-columns: 180px minmax(0, 1fr);
    }

    .player-meta {
        grid-template-columns: 1fr;
    }

    .player-actions {
        justify-content: flex-start;
    }

    .video-hero h1 {
        font-size: 30px;
    }
}

@media (max-width: 620px) {
    .video-header {
        padding-top: 112px;
    }

    .video-nav,
    .video-hero,
    .video-main,
    .video-footer {
        width: min(100% - 28px, 1160px);
    }

    .video-nav {
        min-height: 100px;
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        gap: 8px;
        padding: 0 14px;
    }

    .video-nav nav {
        width: 100%;
        justify-content: flex-start;
        gap: 8px 12px;
    }

    .video-nav a {
        font-size: 12px;
    }

    .video-hero {
        padding: 22px 0 28px;
    }

    .video-hero h1 {
        font-size: 27px;
    }

    .video-hero p {
        font-size: 16px;
    }

    .player-shell {
        min-height: 210px;
    }

    .watch-stage.is-mini {
        right: 10px;
        bottom: 10px;
        width: min(340px, calc(100vw - 20px));
    }

    .watch-frame {
        padding: 10px 10px 0;
    }

    .player-meta {
        padding: 18px;
    }

    .player-meta h2 {
        font-size: 22px;
    }

    .video-toolbar {
        align-items: stretch;
    }

    .video-controls,
    .search-box {
        width: 100%;
    }

    .video-controls {
        justify-content: flex-start;
    }

    .video-card {
        grid-template-columns: 128px minmax(0, 1fr);
    }

    .video-card p {
        display: none;
    }

}
