* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #000;
    overflow: hidden;
    font-family: Arial, sans-serif;
    user-select: none;
}

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

#preloader-logo {
    width: auto;
    height: 150px;
    animation: blink 1.5s infinite ease-in-out;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

#video-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.video-fixed-size {
    width: 100% !important;
    height: 100% !important;
    max-width: 1920px !important;
    max-height: 1080px !important;
    object-fit: contain !important;
}

.hidden {
    display: none;
}

.click-area {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 20%;
    cursor: pointer;
    z-index: 10;
}

.left-click-area {
    left: 0;
}

.right-click-area {
    right: 0;
}

/* Loading Animation */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    backdrop-filter: blur(2px);
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: white;
    margin-top: 20px;
    font-size: 16px;
    text-align: center;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Progress bar for loading */
.loading-progress {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin-top: 15px;
    overflow: hidden;
}

.loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Cache status indicator */
.cache-status {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    z-index: 100;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.cache-status.cached {
    background: rgba(76, 175, 80, 0.7);
    border-color: rgba(76, 175, 80, 0.5);
}

.cache-status.downloading {
    background: rgba(255, 193, 7, 0.7);
    border-color: rgba(255, 193, 7, 0.5);
    animation: pulse 1.5s ease-in-out infinite;
}

/* Controls */
.controls {
    position: fixed;
    bottom: 20px;
    /* left: 50%; */
    /* transform: translateX(-50%); */
    display: flex;
    justify-content: center;
    gap: 10px;
    z-index: 100;
    /* background: rgba(0, 0, 0, 0.7); */
    padding: 10px 20px;
    border-radius: 25px;
    /* backdrop-filter: blur(10px); */
    opacity: 0;
    width: 100vw;
    transition: opacity 0.3s ease;
}

.controls.show {
    opacity: 1;
}

.control-btn {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 12px 17px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 5px;
    position: relative;
    min-width: 80px;
    justify-content: center;
}

.control-btn:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.5);
    transform: translateY(-2px);
}

.control-btn:active:not(:disabled) {
    transform: translateY(0);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.1);
}

.control-btn:disabled:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: none;
}

/* Loading state for buttons */
.control-btn.loading {
    opacity: 0.7;
    cursor: wait;
    background: rgba(255, 255, 255, 0.1);
}

.control-btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 5px;
}

/* Page indicator */
.page-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.page-indicator.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Zoom controls */
.zoom-controls {
    position: fixed;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 100;
}

.zoom-btn {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.zoom-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Auto-hide controls */
.auto-hide {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.auto-hide.show {
    opacity: 1;
}

/* Disabled click areas during loading */
.click-area.disabled {
    pointer-events: none;
    cursor: wait;
}

/* Responsive */
@media (max-width: 768px) {
    .controls {
        bottom: 10px;
        gap: 3px;
        padding: 5px 10px;
    }

    .control-btn {
        padding: 4px 7px;
        font-size: 13px;
        min-width: 50px;
        border-radius: 5px;
    }

    .zoom-controls {
        top: 10px;
        left: 10px;
    }

    .zoom-btn {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }

    .page-indicator {
        top: 10px;
        right: 10px;
        padding: 6px 12px;
        font-size: 12px;
    }

    .cache-status {
        top: 10px;
        right: 10px;
        padding: 4px 8px;
        font-size: 10px;
    }

    .loading-spinner {
        width: 50px;
        height: 50px;
    }

    .loading-text {
        font-size: 14px;
    }

    .loading-progress {
        width: 150px;
    }
}

.d-none {
    display: none !important;
}

/* Styling untuk video yang bisa di-drag */
video.draggable {
    cursor: grab !important;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

video.draggable:active {
    cursor: grabbing !important;
}

/* Smooth transition untuk zoom dan drag */
video {
    transition: transform 0.2s ease-out;
}

/* Disable transition saat sedang dragging untuk responsivitas */
video.dragging {
    transition: none !important;
}

/* Update kontrol untuk menambah tombol reset posisi */
.reset-position-btn {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.reset-position-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Indikator drag mode */
.drag-indicator {
    position: fixed;
    top: 60px;
    right: 20px;
    background: rgba(255, 165, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    z-index: 100;
    backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.drag-indicator.show {
    opacity: 1;
}

/* Mobile optimization */
@media (max-width: 768px) {
    .drag-indicator {
        top: 36px;
        right: 10px;
        font-size: 9px;
        padding: 3px 6px;
    }

    #preloader-logo {
        height: 68px;
    }
}