* {
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

@keyframes gradientFlow {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

body {
    background: linear-gradient(45deg, #ef4444, #3b82f6, #10b981, #f97316, #8b5cf6, #ec4899);
    background-size: 400% 400%;
    animation: gradientFlow 15s ease infinite;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.slide-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
    touch-action: pan-x pan-y;
}

/* Floating Navigation Buttons */
.nav-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.95), rgba(139, 92, 246, 0.95));
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.nav-btn:not(:disabled):active {
    transform: translateY(-50%) scale(0.9);
}

.nav-btn-left {
    left: 15px;
}

.nav-btn-right {
    right: 15px;
}

/* Bottom Navigation Buttons */
.bottom-nav-btn {
    position: fixed;
    bottom: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.95), rgba(139, 92, 246, 0.95));
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.bottom-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.bottom-nav-btn:not(:disabled):active {
    transform: scale(0.9);
}

.bottom-nav-prev {
    left: calc(50% - 70px);
}

.bottom-nav-next {
    right: calc(50% - 70px);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 50%;
    right: -80px;
    transform: translateY(-50%);
    width: 70px;
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.95), rgba(139, 92, 246, 0.95));
    border-radius: 20px 0 0 20px;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.3);
    z-index: 150;
    transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    backdrop-filter: blur(10px);
    padding: 15px 0;
    max-height: 90vh;
    scrollbar-width: thin;
    scrollbar-color: #93c5fd rgba(255, 255, 255, 0.1);
}

/* Styling scrollbar (khusus WebKit, seperti Chrome/Safari) */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(147, 197, 253, 0.6);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background-color: rgba(147, 197, 253, 0.9);
}

.sidebar.open {
    right: 0;
}

.sidebar-toggle {
    position: absolute;
    left: -45px;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 60px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.95), rgba(139, 92, 246, 0.95));
    border: none;
    border-radius: 15px 0 0 15px;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: -3px 0 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 160;
    /* Tambahkan z-index lebih tinggi */
}

.sidebar-toggle:active {
    transform: translateY(-50%) scale(0.95);
}

.sidebar-btn {
    width: 50px;
    height: 50px;
    margin: 8px auto;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.sidebar-btn:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.3);
}

.sidebar-btn.active {
    background: rgba(255, 255, 255, 0.4);
}

.sound-on {
    color: #10b981;
}

.sound-off {
    color: #ef4444;
}

.bgm-on {
    color: #fbbf24;
}

.bgm-off {
    color: #9ca3af;
}

/* Slide info badge */
.slide-info {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Zoom indicator */
.zoom-indicator {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Help button */
.help-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.help-btn:active {
    transform: scale(0.9);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 1rem;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    max-width: 500px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

/* Slide viewer */
.slide-viewer {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: auto;
}

/* Volume slider popup */
.volume-popup {
    height: 60%;
    position: absolute;
    bottom: 60px;
    right: 10px;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 15px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    z-index: 9999;
}

.volume-popup.show {
    opacity: 1;
    visibility: visible;
}


input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 120px;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.3);
    outline: none;
    transform: rotate(-90deg);
    transform-origin: center;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.keyboard-shortcut {
    display: inline-block;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-family: monospace;
    color: #374151;
}

/* Drag cursor */
.slide-viewer.dragging {
    cursor: grabbing;
}

.slide-viewer.draggable {
    cursor: grab;
}

/* Game Icon Button */
.game-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    border-radius: 50%;
    width: 120px;
    height: 120px;
    font-size: 3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 300;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
    text-decoration: none;
}

.game-button:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.game-button:active {
    transform: translate(-50%, -50%) scale(0.95);
}

/* Slide List Item */
.slide-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.slide-item:hover {
    background-color: #f3f4f6;
}

.slide-item.active {
    background-color: #dbeafe;
    border-left: 4px solid #3b82f6;
}

.slide-number {
    width: 30px;
    height: 30px;
    background-color: #3b82f6;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 12px;
    flex-shrink: 0;
}

.slide-description {
    font-size: 0.9rem;
    color: #374151;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .nav-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .nav-btn-left {
        left: 10px;
    }

    .nav-btn-right {
        right: 10px;
    }

    .bottom-nav-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .bottom-nav-prev {
        left: calc(50% - 60px);
    }

    .bottom-nav-next {
        right: calc(50% - 60px);
    }

    .help-btn {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
        top: 15px;
        right: 15px;
    }

    .slide-info {
        top: 15px;
        font-size: 0.8rem;
        padding: 8px 16px;
    }

    .zoom-indicator {
        bottom: 85px;
        font-size: 0.75rem;
        padding: 6px 12px;
    }

    .sidebar {
        width: 60px;
        right: -70px;
    }

    .sidebar-btn {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    .sidebar-toggle {
        width: 40px;
        height: 55px;
        left: -40px;
    }

    .game-button {
        width: 100px;
        height: 100px;
        font-size: 2.5rem;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    .slide-info {
        top: 10px;
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    .help-btn {
        width: 40px;
        height: 40px;
        top: 10px;
        right: 10px;
        font-size: 1rem;
    }

    .nav-btn {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    .bottom-nav-btn {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    .game-button {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

.hidden {
    display: none;
}

.dubbing {
    display: block;
}

.nodubbing {
    display: none;
}

.start-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    z-index: 300;
    transition: all 0.3s ease;
}

.start-button:hover {
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.start-button:active {
    transform: translate(-50%, -50%) scale(0.95);
}

.start-button i {
    font-size: 1.5rem;
}

.hidden {
    display: none !important;
}