﻿html {
    height: 100%;
    background: #000;
}

body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #000;
    min-height: 100%;
    min-height: 100dvh;
}

#slideshow-container,
#background-image {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#background-image {
    z-index: 1;
}

#bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(80%) blur(5px);
    transform: scale(1.1);
}

#slideshow-container {
    z-index: 2;
}

#safe-slideshow-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#bg-blur-layer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    overflow: hidden;
}

#bg-img-blur,
#bg-video-blur {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(60px) brightness(0.4);
    transform: scale(1.15);
}

#triptych-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    display: flex;
    flex-direction: row;
    background-color: #000;
}

#triptych-container.vertical-stack {
    flex-direction: column;
}

.triptych-part {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.triptych-part.main {
    flex: 0 0 auto;
    z-index: 5;
}

.triptych-part.main img,
.triptych-part.main video {
    height: 100dvh;
    width: auto;
    display: block;
    object-fit: cover;
}

#triptych-container.vertical-stack .triptych-part.main img,
#triptych-container.vertical-stack .triptych-part.main video {
    width: 100dvw;
    height: auto;
}

#login-triptych-container {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: row;
    background-color: #000;
}

.login-triptych-part {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.login-triptych-part.main {
    flex: 0 0 auto;
    z-index: 2;
}

.login-triptych-part.main img {
    height: 100dvh;
    width: auto;
    display: block;
    object-fit: cover;
}

.login-triptych-part.side img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.8) blur(10px);
    transform: scale(1.05);
}

#login-container {
    z-index: 20;
}

.triptych-part.side {
    z-index: 3;
}

.triptych-part.side img,
.triptych-part.side video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
    filter: brightness(0.8) blur(10px);
}

#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000;
    opacity: 0;
    transition: opacity 0.5s ease-in;
    z-index: 10;
    pointer-events: none;
}

#login-container,
#delete-container {
    position: fixed;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: auto;
}

#login-container:hover,
#delete-container:hover {
    opacity: 1;
}

#login-container { top: 100px; left: 100px; }
#delete-container { top: 120px; left: 100px; }

#login-container input, #login-container button,
#delete-container input, #delete-container button {
    padding: 0; margin: 0;
    width: 20px; height: 20px;
    background-color: transparent;
    opacity: 0.1;
    border: none;
    cursor: pointer;
    color: white;
}

#login-container input:hover, #delete-container input:hover,
#login-container button:hover, #delete-container button:hover {
    opacity: 1;
}

#keyboard {
    display: grid;
    grid-template-columns: repeat(3, 15px);
    gap: 5px;
}

#duration-container {
    position: fixed;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.2s ease;
    top: 50px;
    left: 10px;
}

#duration-container:hover {
    opacity: 1;
}

video {
    color-interpolation: sRGB;
    content-visibility: auto;
}

.seek-feedback {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 20px;
    font-weight: bold;
    padding: 12px 20px;
    border-radius: 12px;
    z-index: 1000;
    pointer-events: none;
    backdrop-filter: blur(4px);
    animation: seekFade 0.6s ease forwards;
}

@keyframes seekFade {
    0%   { opacity: 1; transform: translateY(-50%) scale(1); }
    100% { opacity: 0; transform: translateY(-50%) scale(1.3); }
}

/* --- Scrubber wrap --- */
#scrubber-wrap {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#scrubber-wrap.dragging,
#scrubber-wrap.visible {
    opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
    #scrubber-wrap:hover {
        opacity: 1;
    }
}

/* --- Scrubber track row --- */
#scrubber-area {
    width: 100%;
    height: 44px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    box-sizing: border-box;
    cursor: pointer;
}

#scrubber-track {
    position: relative;
    width: 100%;
    height: 3px;
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
}

#scrubber-fill {
    height: 100%;
    width: 0%;
    background: #ff0055;
    border-radius: 4px;
    box-shadow: 0 0 8px #ff005566;
    transition: width 0.1s linear;
}

#scrubber-handle {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: #fff;
    border: 2px solid #ff0055;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.15s, left 0.1s linear;
}

#scrubber-wrap.dragging #scrubber-handle {
    opacity: 1;
}

/* --- Controls row: strictly one line --- */
#scrubber-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 0 14px;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    height: 40px;
    box-sizing: border-box;
    overflow: visible;
}

#safe-area-spacer {
    background: rgba(0,0,0,0.5);
    height: env(safe-area-inset-bottom);
}

#scrubber-current {
    font-size: 11px;
    font-family: monospace;
    color: #ff0055;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

#scrubber-total {
    font-size: 11px;
    font-family: monospace;
    color: rgba(255,255,255,0.5);
    white-space: nowrap;
    flex-shrink: 0;
}

#scrubber-fill-space {
    flex: 1;
    min-width: 0;
}

/* --- Volume --- */
#volume-container {
    position: relative;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#volume-icon {
    font-size: 16px;
    cursor: pointer;
    color: rgba(255,255,255,0.6);
    user-select: none;
    line-height: 1;
}

#volume-popup {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 110px;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(8px);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 200;
}

#volume-container:hover #volume-popup,
#volume-popup.visible {
    opacity: 1;
    pointer-events: auto;
}

#volume-track {
    position: relative;
    width: 4px;
    height: 80px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    cursor: pointer;
}

#volume-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: #ff0055;
    border-radius: 4px;
}

#volume-handle {
    position: absolute;
    left: 50%;
    bottom: 0%;
    transform: translate(-50%, 50%);
    width: 14px;
    height: 14px;
    background: #fff;
    border: 2px solid #ff0055;
    border-radius: 50%;
}

#volume-slider {
    writing-mode: vertical-lr;
    direction: rtl;
    appearance: slider-vertical;
    -webkit-appearance: slider-vertical;
    width: 4px;
    height: 80px;
    cursor: pointer;
    accent-color: #ff0055;
    margin: 0;
    padding: 0;
    display: block;
}

/* --- Fullscreen button --- */
#fullscreen-btn {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    margin: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}

#fullscreen-btn:hover { color: #fff; }

/* --- Floating time bubble above scrubber --- */
#scrubber-thumb {
    position: absolute;
    bottom: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    transform: translateX(-50%);
    z-index: 200;
}

#scrubber-wrap.dragging #scrubber-thumb { opacity: 1; }

#scrubber-thumb-time {
    background: rgba(255,0,85,0.9);
    color: #fff;
    font-size: 12px;
    font-family: monospace;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

#scrubber-thumb-line {
    width: 2px;
    height: 12px;
    background: rgba(255,0,85,0.6);
}