/* Video Modal Component Styles */

/* Video Modal Container */
.video-modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    backdrop-filter: blur(5px);
    transition: opacity 0.3s ease-in-out;
}

.video-modal-container.show {
    display: flex !important;
    opacity: 1;
}

.video-modal-container.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Video Modal Content */
.video-modal-content {
    position: relative;
    width: auto;
    /* Change from 100% to auto */
    height: auto;
    /* Change from 100% to auto */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Video Container */
.video-container {
    position: relative;
    width: auto;
    height: var(--video-frame-height);
    aspect-ratio: 4/3;
    margin: auto;
    max-width: 90vw;
    max-height: 90vh;
}

/* Video Frame Styling */
.video-frame {
    position: absolute;
    z-index: 10;
    pointer-events: none;
    user-select: none;
    width: 100%;
    height: 100%;
    object-fit: contain;
    top: 0;
    left: 0;
    filter: drop-shadow(0px 0px 20px rgba(0, 0, 0, 0.7));
}

/* Modal Video Base */
.modal-video {
    padding: 7%;
    /* border-radius: 20%; */
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    top: 0;
    left: 0;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Main Video (Background Layer) */
.main-video {
    z-index: 5;
}

:root {
    --video-frame-height: 75vh;
    --controls-bottom-offset: -3%;
    /* Posisi relatif terhadap video frame */
    --control-btn-size: 12.6%;
    /* Ukuran button relatif terhadap lebar video frame (18% - 30% = 12.6%) */
    --control-gap: 2%;
    /* Gap antar button relatif terhadap video frame */
}

/* Volume Control Container */
.volume-slider-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 15%;
    /* Adjust width as needed */
    transform: rotate(-5deg) translateY(-8px);
}

.volume-btn {
    width: var(--control-btn-size);
    filter: none !important;
    /* Remove inherited drop-shadow */
}

#volume-icon {
    color: #94C0AE;
    font-size: 24px;
    text-shadow: 1px 1px 0px #1a4731, -1px -1px 0px #b4e0ce;
    display: inline-block;
    transform: translateY(-8px);
}

/* Volume Slider */
.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: #246345;
    border-radius: 5px;
    outline: none;
    transition: opacity 0.2s;
    cursor: pointer;
    border: 1px solid #1a4731;
    box-shadow: inset 1px 1px 2px #1a4731, inset -1px -1px 2px #3c8a65;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #f1f1f1;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #333;
}

.volume-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #f1f1f1;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #333;
}


/* Black Overlay (Transition Layer) */
.black-overlay {
    margin: 7%;
    padding: 7%;
    /* border-radius: 20%; */
    position: absolute;
    z-index: 9;
    width: 85%;
    height: 85%;
    top: 0;
    left: 0;
    background: #000000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.1s ease-in-out;
}

/* Black Overlay Active */
.black-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Transition Video (Overlay Layer) */
.transition-video {
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.01s ease-out;
}

/* Transition Video Active */
.transition-video.active {
    opacity: 1;
    pointer-events: auto;
}

/* Controls Container */
.controls-container {
    position: absolute;
    bottom: var(--controls-bottom-offset);
    left: 0;
    right: 0;
    z-index: 20;
    width: 100%;
}

.controls-wrapper {
    display: flex;
    justify-content: center;
    gap: var(--control-gap);
    background: none;
    backdrop-filter: none;
    border-radius: 0;
}

/* Control Buttons */
.control-btn {
    font-family: 'BubbleBaz', 'Arial', 'Helvetica', sans-serif;
    font-weight: normal;
    letter-spacing: 0.5px;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
    position: relative;
    padding: 0;
    border-radius: 0;
    outline: none;
    width: var(--control-btn-size);
    height: auto;
    aspect-ratio: 1;
    /* Bayangan serong realistis - cahaya dari atas kiri, bayangan ke kanan bawah */
    filter: drop-shadow(4px 6px 4px rgba(0, 0, 0, 0.5));
}

/* Hover effect - brightness increase on PNG only, no shadow change */
.control-btn:hover {
    /* Bayangan tidak berubah sama sekali saat hover */
    filter: drop-shadow(4px 6px 4px rgba(0, 0, 0, 0.5));
    transition: filter 0.2s ease;
}

.control-btn:hover .control-btn-img {
    filter: brightness(1.5);
    transition: filter 0.2s ease;
}

/* Click effect - depth/realistic button press */
.control-btn:active {
    transform: translateY(2px) scale(0.98);
    /* Mengurangi serong bayangan saat ditekan */
    filter: drop-shadow(2px 3px 4px rgba(0, 0, 0, 0.6));
    transition: transform 0.1s ease, filter 0.1s ease;
}

/* Reset hover effect when clicked */
.control-btn:active .control-btn-img {
    filter: brightness(1.2);
    transition: filter 0.1s ease;
}

/* Focus effect for accessibility - only when using keyboard */
.control-btn:focus-visible {
    outline: 2px solid #EA71CE;
    outline-offset: 2px;
}

/* Remove any default focus outline */
.control-btn:focus:not(:focus-visible) {
    outline: none;
}

/* Disabled state */
.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.control-btn:disabled:hover .control-btn-img {
    filter: none;
}

.control-btn:disabled:active {
    transform: none;
}

.control-btn-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: filter 0.2s ease;
    display: block;
    pointer-events: none;
    user-select: none;
    border: none;
    outline: none;
    box-shadow: none;
}

/* Special effect for exit button */
#exit-btn:hover {
    filter: drop-shadow(4px 6px 4px rgba(0, 0, 0, 0.5));
}

#exit-btn:hover .control-btn-img {
    filter: brightness(1.5) hue-rotate(10deg);
}

#exit-btn:active {
    filter: drop-shadow(2px 3px 4px rgba(0, 0, 0, 0.6));
}

#exit-btn:active .control-btn-img {
    filter: brightness(1.2) hue-rotate(5deg);
}

/* Special effect for navigation buttons */
#prev-btn:hover,
#next-btn:hover {
    filter: drop-shadow(4px 6px 4px rgba(0, 0, 0, 0.5));
}

#prev-btn:hover .control-btn-img,
#next-btn:hover .control-btn-img {
    filter: brightness(1.5) saturate(1.2);
}

#prev-btn:active,
#next-btn:active {
    filter: drop-shadow(2px 3px 4px rgba(0, 0, 0, 0.6));
}

#prev-btn:active .control-btn-img,
#next-btn:active .control-btn-img {
    filter: brightness(1.2) saturate(1.1);
}

/* Remove any browser default styling */
.control-btn::-moz-focus-inner {
    border: 0;
    padding: 0;
}

.control-btn::-webkit-focus-ring-color {
    outline: none;
}

/* Ensure no borders or outlines appear (keep drop-shadow) */
.control-btn * {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Hide video controls completely */
.modal-video::-webkit-media-controls {
    display: none !important;
}

.modal-video::-webkit-media-controls-panel {
    display: none !important;
}

.modal-video::-webkit-media-controls-play-button {
    display: none !important;
}

.modal-video::-webkit-media-controls-timeline {
    display: none !important;
}

.modal-video::-webkit-media-controls-current-time-display {
    display: none !important;
}

.modal-video::-webkit-media-controls-time-remaining-display {
    display: none !important;
}

.modal-video::-webkit-media-controls-mute-button {
    display: none !important;
}

.modal-video::-webkit-media-controls-volume-slider {
    display: none !important;
}

.modal-video::-webkit-media-controls-fullscreen-button {
    display: none !important;
}

.modal-video::-webkit-media-controls-overlay-play-button {
    display: none !important;
}

.modal-video::-webkit-media-controls-enclosure {
    display: none !important;
}

.modal-video::-moz-media-controls {
    display: none !important;
}

.modal-video::-ms-media-controls {
    display: none !important;
}

/* Responsive Design */

/* Large Desktop */
@media (max-width: 1200px) {
    /* Inherit default values */
}

/* Desktop */
@media (max-width: 992px) {
    /* Inherit default values */
}

/* Tablet */
@media (max-width: 768px) {
    :root {
        --video-frame-height: 65vh;
        --controls-bottom-offset: -4%;
        --control-btn-size: 14%;
        --control-gap: 2.5%;
    }
}

/* Mobile */
@media (max-width: 480px) {
    :root {
        --video-frame-height: 55vh;
        --controls-bottom-offset: -5%;
        --control-btn-size: 15.4%;
        --control-gap: 3%;
    }
}

/* Extra Small Mobile */
@media (max-width: 360px) {
    /* Inherit mobile values */
}