/* Video document viewer */
.doc-layer.video-mode {
    background:
        radial-gradient(circle at 86% 8%, rgba(82, 142, 244, 0.16), transparent 34%),
        linear-gradient(180deg, #f4f8ff 0%, #edf3fc 100%);
    overflow: auto;
}

.doc-layer.video-mode .doc-canvas {
    width: min(100%, var(--x-max-page-width, 1600px));
    max-width: var(--x-max-page-width, 1600px);
    min-height: 100%;
    height: auto;
    margin: 0 auto;
    padding: clamp(1rem, 1.65vw, 1.8rem);
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    display: flex;
    flex-direction: column;
}

.doc-layer.video-mode .title-bar,
.doc-layer.video-mode .doc-toolbar {
    display: none;
}

.doc-layer.video-mode #docHost,
.doc-layer.video-mode #docHostGeneric {
    height: auto;
    min-height: 0;
    overflow: visible;
    background: transparent;
}

.video-viewer-shell {
    flex: 1 1 auto;
    min-height: calc(100dvh - 178px);
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 1.25rem;
    color: #092554;
}

.video-breadcrumb {
    width: fit-content;
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    overflow: hidden;
    padding: 0.72rem 1rem;
    border-radius: 999px;
    background: rgba(16, 54, 115, 0.07);
    color: #5c7297;
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 0.09em;
    line-height: 1;
    text-transform: uppercase;
}

.video-breadcrumb-items {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    overflow: hidden;
}

.video-breadcrumb .is-current {
    color: #112a58;
    white-space: nowrap;
}

.video-breadcrumb i {
    flex: 0 0 auto;
    color: #0e58d0;
    font-size: 0.95rem;
}

.video-breadcrumb .viewer-crumb-separator {
    color: #90a1c0;
    font-weight: 900;
}

.video-breadcrumb .video-crumb-action {
    flex: 0 0 auto;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
}

.video-breadcrumb .video-crumb-action:hover,
.video-breadcrumb .video-crumb-action:focus-visible {
    color: #0b63ff;
    outline: none;
}

.video-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: clamp(1.25rem, 1.9vw, 2rem);
    border: 1px solid rgba(150, 187, 238, 0.72);
    border-radius: 28px;
    background:
        radial-gradient(circle at 92% 8%, rgba(76, 142, 255, 0.2), transparent 34%),
        linear-gradient(145deg, rgba(248, 251, 255, 0.98), rgba(228, 239, 255, 0.96));
    box-shadow:
        0 22px 52px rgba(24, 64, 124, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.video-hero::after {
    content: "";
    position: absolute;
    inset: auto -12% -50% 58%;
    height: 180px;
    pointer-events: none;
    background: radial-gradient(circle, rgba(45, 117, 255, 0.16), transparent 66%);
}

.video-hero-main {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 1.1rem;
}

.video-back-btn,
.video-action-btn,
.video-icon-btn,
.video-play-btn {
    border: 1px solid #bfd2ef;
    background: #f8fbff;
    color: #0a2a5a;
    box-shadow: 0 10px 22px rgba(25, 58, 116, 0.09);
}

.video-back-btn {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex: 0 0 auto;
    color: #0b63ff;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(226, 239, 255, 0.94));
    border-color: rgba(143, 184, 239, 0.72);
    box-shadow: 0 14px 30px rgba(33, 92, 174, 0.15);
}

.video-title-block {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 0.4rem;
}

.video-title-row {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.7rem;
}

.video-title-row h2 {
    margin: 0;
    color: #081f4a;
    max-width: min(760px, 48vw);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: clamp(1.45rem, 1.9vw, 2.15rem);
    font-weight: 850;
    line-height: 1.05;
}

.video-record-tag,
.video-kind {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    background: #dcecff;
    color: #0f6de7;
    font-size: 0.82rem;
    font-weight: 850;
    padding: 0.3rem 0.65rem;
}

.video-meta-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem 0.7rem;
    color: #7382a2;
    font-size: 0.98rem;
    font-weight: 650;
}

.video-meta-row > span:not(:first-child)::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 4px;
    margin-right: 0.7rem;
    border-radius: 999px;
    background: #9caac4;
    vertical-align: middle;
}

.video-hero-actions {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.video-action-btn {
    min-height: 54px;
    border-radius: 18px;
    padding: 0 1.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font-weight: 850;
    white-space: nowrap;
    border-color: rgba(143, 184, 239, 0.72);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 14px 30px rgba(33, 92, 174, 0.12);
}

.video-action-primary {
    border-color: #1172ee;
    background: linear-gradient(135deg, #1578f2, #0966e5);
    color: #ffffff;
    box-shadow: 0 16px 32px rgba(31, 109, 255, 0.24);
}

.video-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 370px;
    gap: 1.35rem;
    align-items: stretch;
    min-height: clamp(660px, 68dvh, 920px);
}

.video-player-panel {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.video-screen {
    position: relative;
    overflow: hidden;
    border: 1px solid #14254a;
    border-radius: 14px;
    background: #061429;
    box-shadow: 0 18px 38px rgba(13, 36, 77, 0.18);
    flex: 1 1 auto;
    min-height: clamp(520px, 64dvh, 860px);
}

.video-media-slot,
.video-native {
    width: 100%;
    height: 100%;
}

.video-native {
    display: block;
    object-fit: contain;
    background: #020816;
}

.video-controls {
    position: absolute;
    inset: auto 0 0;
    padding: 0.75rem 0.9rem 0.85rem;
    background: linear-gradient(180deg, transparent, rgba(3, 18, 42, 0.96) 34%);
    color: #fff;
}

.video-progress-line {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.65rem;
    color: #eaf2ff;
    font-size: 0.88rem;
    font-weight: 850;
}

.video-progress-line input[type="range"],
.video-control-left input[type="range"] {
    accent-color: #1682ff;
}

.video-control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.55rem;
}

.video-control-left,
.video-control-right {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.video-icon-btn,
.video-play-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.16rem;
    font-weight: 850;
    box-shadow: none;
}

.video-play-btn {
    width: 50px;
    background: rgba(255, 255, 255, 0.18);
    font-size: 1.25rem;
}

.video-control-left input[type="range"] {
    width: 90px;
}

.video-side-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid #c8d8f0;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 16px 36px rgba(39, 74, 130, 0.11);
    overflow: hidden;
}

.video-side-tabs {
    display: grid;
    grid-template-columns: 1fr;
    border-bottom: 1px solid #d9e5f5;
}

.video-side-tabs button {
    min-height: 58px;
    border: 0;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: #4d5e7d;
    font-weight: 850;
}

.video-side-tabs .is-active {
    border-bottom-color: #4f93de;
    color: #0f6de7;
}

.video-details {
    padding: 1.25rem;
}

.video-details h3 {
    margin: 0 0 0.95rem;
    color: #162a4d;
    font-size: 1rem;
    font-weight: 850;
}

.video-details dl {
    display: grid;
    gap: 0.8rem;
    margin: 0;
}

.video-details dt {
    color: #7d879a;
    font-weight: 750;
}

.video-details dd {
    margin: -0.6rem 0 0;
    color: #20365f;
    font-weight: 800;
    overflow-wrap: anywhere;
}

html[data-theme="dark"] .doc-layer.video-mode,
body[data-theme="dark"] .doc-layer.video-mode {
    background:
        radial-gradient(circle at 86% 8%, rgba(70, 126, 224, 0.2), transparent 34%),
        linear-gradient(180deg, #071a34 0%, #0a2547 100%) !important;
}

html[data-theme="dark"] .video-viewer-shell,
body[data-theme="dark"] .video-viewer-shell {
    color: #eaf2ff;
}

html[data-theme="dark"] .video-breadcrumb,
html[data-theme="dark"] .video-meta-row,
body[data-theme="dark"] .video-breadcrumb,
body[data-theme="dark"] .video-meta-row {
    color: #9db6dc;
}

html[data-theme="dark"] .video-breadcrumb,
body[data-theme="dark"] .video-breadcrumb {
    background: rgba(19, 66, 126, 0.38);
    color: #b8d3f8;
}

html[data-theme="dark"] .video-breadcrumb .bi,
body[data-theme="dark"] .video-breadcrumb .bi {
    color: #7fb9ff;
}

html[data-theme="dark"] .video-title-row h2,
html[data-theme="dark"] .video-breadcrumb .is-current,
html[data-theme="dark"] .video-details h3,
body[data-theme="dark"] .video-title-row h2,
body[data-theme="dark"] .video-breadcrumb .is-current,
body[data-theme="dark"] .video-details h3 {
    color: #f2f7ff;
}

html[data-theme="dark"] .video-side-panel,
body[data-theme="dark"] .video-side-panel {
    border-color: rgba(102, 141, 201, 0.5);
    background: rgba(13, 33, 62, 0.94);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.26);
}

html[data-theme="dark"] .video-back-btn,
html[data-theme="dark"] .video-action-light,
body[data-theme="dark"] .video-back-btn,
body[data-theme="dark"] .video-action-light {
    border-color: rgba(97, 134, 192, 0.56);
    background: rgba(18, 43, 78, 0.96);
    color: #edf5ff;
}

html[data-theme="dark"] .video-back-btn,
body[data-theme="dark"] .video-back-btn {
    color: #b9d8ff;
    background: linear-gradient(145deg, rgba(18, 58, 103, 0.96), rgba(9, 36, 67, 0.96));
    border-color: rgba(99, 166, 255, 0.44);
    box-shadow: 0 14px 30px rgba(0, 10, 26, 0.34);
}

html[data-theme="dark"] .video-action-btn,
body[data-theme="dark"] .video-action-btn {
    background: rgba(18, 58, 103, 0.72);
    border-color: rgba(99, 166, 255, 0.4);
    box-shadow: 0 14px 30px rgba(0, 10, 26, 0.28);
}

html[data-theme="dark"] .video-action-primary,
body[data-theme="dark"] .video-action-primary {
    background: linear-gradient(135deg, #2389ff, #0b62e8);
    border-color: rgba(66, 150, 255, 0.86);
}

html[data-theme="dark"] .video-side-tabs,
body[data-theme="dark"] .video-side-tabs {
    border-bottom-color: rgba(97, 134, 192, 0.42);
}

html[data-theme="dark"] .video-details dt,
body[data-theme="dark"] .video-details dt {
    color: #9db6dc;
}

html[data-theme="dark"] .video-details dd,
body[data-theme="dark"] .video-details dd {
    color: #e7f0ff;
}

@media (max-width: 1180px) {
    .video-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .video-hero-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .video-layout {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .video-title-row {
        flex-wrap: wrap;
    }

    .video-title-row h2 {
        max-width: 100%;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
}

@media (max-width: 760px) {
    .doc-layer.video-mode .doc-canvas {
        padding: 0.85rem !important;
    }

    .video-hero-main {
        display: grid;
        grid-template-columns: auto 1fr;
        align-items: start;
    }

    .video-action-btn {
        width: 100%;
    }

    .video-control-row,
    .video-control-left,
    .video-control-right {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .video-screen {
        min-height: 420px;
    }
}

/* Final dark-mode polish for video viewer */
html[data-theme="dark"] .video-hero,
body[data-theme="dark"] .video-hero {
    border-color: rgba(75, 111, 169, 0.62) !important;
    background:
        radial-gradient(circle at top right, rgba(72, 140, 255, 0.18), transparent 28%),
        linear-gradient(145deg, rgba(20, 45, 82, 0.98), rgba(16, 37, 66, 0.96)) !important;
    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(142, 186, 255, 0.09) !important;
}

html[data-theme="dark"] .video-record-tag,
html[data-theme="dark"] .video-kind,
body[data-theme="dark"] .video-record-tag,
body[data-theme="dark"] .video-kind {
    background: rgba(76, 139, 235, 0.16) !important;
    color: #a8ccff !important;
}

html[data-theme="dark"] .video-player-panel,
html[data-theme="dark"] .video-screen,
html[data-theme="dark"] .video-controls,
body[data-theme="dark"] .video-player-panel,
body[data-theme="dark"] .video-screen,
body[data-theme="dark"] .video-controls {
    border-color: rgba(97, 134, 192, 0.46) !important;
    background: rgba(12, 31, 58, 0.94) !important;
}

html[data-theme="dark"] .video-icon-btn,
html[data-theme="dark"] .video-play-btn,
body[data-theme="dark"] .video-icon-btn,
body[data-theme="dark"] .video-play-btn {
    border-color: rgba(97, 134, 192, 0.56) !important;
    background: rgba(18, 43, 78, 0.96) !important;
    color: #edf5ff !important;
}

