:root {
    --primary-color: #0f172a;
    --text-color: #f1f5f9;
    --accent-color: #3b82f6;
    --overlay-bg: rgba(0, 0, 0, 0.4);
    --btn-bg: rgba(255, 255, 255, 0.1);
    --btn-hover: rgba(255, 255, 255, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    -webkit-tap-highlight-color: transparent;
    font-family: 'Inter', sans-serif;
    background-color: var(--primary-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}



.viewer-container:fullscreen {
    padding: 0;
    max-width: none;
    background-color: black;
}

.viewer-container:fullscreen .slide-wrapper {
    height: 100vh;
    border-radius: 0;
    box-shadow: none;
}

.viewer-container:fullscreen .controls-bar {
    position: absolute;
    bottom: 20px;
    z-index: 40;
}



.viewer-container {
    width: 100%;
    max-width: 1200px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
}

.slide-wrapper {
    position: relative;
    width: 100%;
    height: 80vh;

    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
    overflow: hidden;
    background-color: #1e293b;

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.image-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#slide-image,
#slide-video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

/* Security Layer */
.security-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    background: transparent;
    cursor: default;
}

/* Navigation Buttons */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--btn-bg);
    border: none;
    color: white;
    padding: 1rem;
    cursor: pointer;
    border-radius: 50%;
    z-index: 20;
    transition: background 0.3s ease, transform 0.2s ease;
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover {
    background: var(--btn-hover);
    transform: translateY(-50%) scale(1.1);
}

.nav-btn.prev {
    left: 20px;
}

.nav-btn.next {
    right: 20px;
}

.nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.controls-bar {
    margin-top: 20px;
    padding: 8px 16px;
    background: rgba(30, 41, 59, 0.8);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.fullscreen-btn {
    background: var(--btn-bg);
    border: none;
    color: white;
    padding: 6px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-btn:hover {
    background: var(--btn-hover);
    transform: scale(1.1);
}


/* Video Controls Overlay */
.video-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 800px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 20px;
    z-index: 30;
    /* Above video, below security layer if interacting, but we'll manage z-index in JS */
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.controls-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.progress-row {
    width: 100%;
}

.main-controls {
    justify-content: center;
    position: relative;
}

/* Custom Progress Bar (Range Slider) */
#progress-bar {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
    outline: none;
}

#progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.ctrl-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.ctrl-btn:active {
    transform: scale(0.95);
}

.main-play {
    background: var(--accent-color);
    width: 44px;
    height: 44px;
}

.main-play:hover {
    background: #2563eb;
}

.time-display {
    position: absolute;
    right: 0;
    font-size: 0.8rem;
    font-family: monospace;
    color: rgba(255, 255, 255, 0.7);
}

/* Adjust Security Layer for Interaction */
.security-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    /* Lower than buttons when they need interaction */
    background: transparent;
    cursor: default;
}

/* Specifically allow interaction with controls even if security layer exists */
.video-controls {
    pointer-events: auto;
    z-index: 40;
}

@media (max-width: 768px) {
    .nav-btn {
        padding: 0.8rem;
    }

    .nav-btn.prev {
        left: 10px;
    }

    .nav-btn.next {
        right: 10px;
    }

    .time-display {
        position: static;
        margin-top: 4px;
    }
}