/* Beamer+ Canvas and Display Styles */

/* Main content wrapper — singular view */
#main-content {
    display: flex;
    margin-left: 75px;
    height: calc(100vh - 60px);
}

/* Default single-view layout */
#pdf-container,
#viewer-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f0f0f0;
}

/* Second PDF container - hidden by default */
#pdf-container-2 {
    display: none;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    justify-content: center;
    align-items: center;
    background: #f0f0f0;
}

/* Split view active state */
body.split-view-active #main-content {
    margin-left: 0;
    margin-right: 0;
    height: calc(100vh - 60px - 75px);
}

body.split-view-active #pdf-container {
    width: 50%;
}

body.split-view-active #pdf-container-2 {
    display: flex;
    width: 50%;
}

/* Move left navigator to bottom in split view */
body.split-view-active #slide-navigator {
    left: 10px;
    right: calc(50% + 8px);
    bottom: 10px;
    top: auto;
    width: auto;
    height: 75px;
    flex-direction: row;
    padding: 0 10px;
    border: 2px solid #666;
    border-radius: 4px;
    overflow-x: auto;
    overflow-y: hidden;
}


body.split-view-active #slide-navigator-right {
    display: flex;
    left: calc(50% + 8px);
    right: 10px;
    bottom: 10px;
    width: auto;
    border-radius: 4px;
}


/* Slide nav items horizontal in split view */
body.split-view-active .slide-nav-item {
    margin: 0 4px;
}

.slide-nav-item.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

#pdf-container video, #pdf-container-2 video {
    position: absolute;
    object-fit: contain;
    pointer-events: auto;
}

#pdf-canvas, #pdf-canvas-2 {
    position: absolute;
    z-index: 1;
    background-color: #ffffff;
    border-radius: 4px;
    box-sizing: border-box;
    height: 95%;
    aspect-ratio: 4 / 3;
    max-width: 95%;
}

/* In split view, reduce the height to fit better */
body.split-view-active #pdf-canvas,
body.split-view-active #pdf-canvas-2 {
    height: auto;
    width: 98%;
    max-height: 98%;
}

#pdf-canvas canvas, #pdf-canvas-2 canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

#ann-canvas, #ann-canvas-2 {
    position: absolute;
    z-index: 2;
    pointer-events: none;
    box-sizing: border-box;
    height: 95%;
    aspect-ratio: 4 / 3;
    max-width: 95%;
}

/* In split view, reduce the height to fit better */
body.split-view-active #ann-canvas,
body.split-view-active #ann-canvas-2 {
    height: auto;
    width: 98%;
    max-height: 98%;
}

#ann-canvas canvas, #ann-canvas-2 canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* Slide videos */
.slide-video {
    position: absolute;
    object-fit: contain;
    pointer-events: none;
    z-index: 20;
}

.slide-video::-webkit-media-controls-pip-button,
.slide-video::-webkit-media-controls-picture-in-picture-button {
    display: none !important;
}

/* Model viewer */
model-viewer {
    pointer-events: auto !important;
}

/* Widget iframes */
.widget-iframe {
    position: absolute;
    border: none;
    background: transparent;
}

#both-displays-container {
    width: 100%;
    height: calc(100vh - 60px);
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: safe;
    border: 1px solid black;
    overflow: hidden;
}





/* Slide transition loading overlay */
.slide-loading-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    background: #ffffff;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.1s ease;
}

.slide-loading-overlay.visible {
    opacity: 1;
}

.slide-squiggle {
    width: 120px;
    height: 40px;
    display: block;
}

.slide-squiggle path {
    fill: none;
    stroke: #333;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 150;
    stroke-dashoffset: 150;
    animation: draw-slide-squiggle 1.6s ease-in-out infinite;
}

@keyframes draw-slide-squiggle {
    0%   { stroke-dashoffset: 150; opacity: 0.6; }
    40%  { stroke-dashoffset: 0;   opacity: 1;   }
    100% { stroke-dashoffset: -150; opacity: 0.6; }
}
