/* Reset and base styles */
html {
    position: fixed;
    height: 100%;
    width: 100%;
    overflow: hidden;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior: none;
}

body {
    margin: 0;
    padding: 0;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    height: 100%;
    width: 100%;
    overflow: hidden;
    position: fixed;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    padding-bottom: env(safe-area-inset-bottom);
    overscroll-behavior: none;
    touch-action: none;
}

.artplayer-app {
    width: 100%;
    height: 100vh;
    height: calc(100vh - env(safe-area-inset-bottom));
    max-height: 100vh;
    max-height: calc(100vh - env(safe-area-inset-bottom));
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
}

/* Video container */
.art-video-player {
    width: 100% !important;
    height: 100% !important;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
}

.art-video {
    object-fit: contain;
    max-height: 100%;
    max-width: 100%;
    touch-action: none;
}

/* Controls positioning */
.art-controls {
    position: absolute !important;
    bottom: 0 !important;
    bottom: env(safe-area-inset-bottom) !important;
    left: 0 !important;
    right: 0 !important;
    padding: 0 !important;
    background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0)) !important;
    z-index: 100 !important;
}

.art-control-progress {
    position: absolute !important;
    bottom: 45px !important;
    bottom: calc(45px + env(safe-area-inset-bottom)) !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 100 !important;
}

/* Custom control buttons */
.art-control-rewind,
.art-control-forward {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    cursor: pointer;
    opacity: 0.9;
    transition: opacity 0.2s;
    background: none;
    border: none;
    outline: none !important;
    padding: 0;
}

.art-control-rewind:hover,
.art-control-forward:hover {
    opacity: 1;
}

.art-control-rewind:focus,
.art-control-forward:focus {
    outline: none !important;
    box-shadow: none !important;
}

.art-control-rewind svg,
.art-control-forward svg {
    width: 24px;
    height: 24px;
    fill: #fff;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .artplayer-app {
        height: calc(100vh - env(safe-area-inset-bottom));
        max-height: calc(100vh - env(safe-area-inset-bottom));
    }

    .art-video-player {
        height: calc(100% - env(safe-area-inset-bottom)) !important;
    }

    /* Adjust control sizes */
    .art-controls {
        padding-bottom: env(safe-area-inset-bottom) !important;
        height: calc(40px + env(safe-area-inset-bottom)) !important;
    }

    .art-control-progress {
        bottom: calc(40px + env(safe-area-inset-bottom)) !important;
    }

    /* Smaller icons */
    .art-icon {
        width: 20px !important;
        height: 20px !important;
    }

    /* Adjust time display */
    .art-control-time {
        font-size: 12px !important;
        min-width: 80px !important;
    }

    /* Compact controls layout */
    .art-controls-left,
    .art-controls-right {
        gap: 5px !important;
    }

    /* Custom rewind/forward buttons */
    .art-control-rewind,
    .art-control-forward {
        width: 35px !important;
        height: 35px !important;
        margin: 0 2px !important;
    }

    .art-control-rewind svg,
    .art-control-forward svg {
        width: 20px !important;
        height: 20px !important;
    }

    /* Controls container */
    .art-controls {
        height: 40px !important;
        padding: 0 5px !important;
    }

    /* Settings and other buttons */
    .art-control-quality,
    .art-control-screenshot,
    .art-control-pip {
        display: none !important;
    }

    /* Make volume icon smaller */
    .art-volume-panel {
        width: 60px !important;
    }

    /* Adjust spacing between controls */
    .art-controls .art-controls-left,
    .art-controls .art-controls-right {
        display: flex !important;
        align-items: center !important;
        gap: 2px !important;
    }
}

/* Lock button */
.art-lock-button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 35px;
    height: 35px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    border: none;
    outline: none !important;
}

.art-lock-button:focus {
    outline: none !important;
    box-shadow: none !important;
}

.art-lock-button svg {
    width: 18px;
    height: 18px;
    fill: white;
}

/* Controls state when locked */
.controls-locked .art-progress,
.controls-locked .art-controls {
    display: none !important;
}

/* Loading spinner */
.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #23ade5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Error message */
.error-message {
    color: white;
    text-align: center;
    background: rgba(255, 0, 0, 0.8);
    padding: 10px;
    border-radius: 4px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
}

/* Hide auto-playback notification */
.art-layer.art-layer-auto-playback {
    display: none !important;
}

/* Vietnamese language overrides */
.art-settings-panel[data-settings="loop"] .art-setting-item[data-value="true"]::after {
    content: "Bật" !important;
}

.art-settings-panel[data-settings="loop"] .art-setting-item[data-value="false"]::after {
    content: "Tắt" !important;
}

.art-settings-panel .art-setting-item span {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
}

/* Remove focus outline from all player controls */
.art-control button,
.art-control-inner button {
    outline: none !important;
    box-shadow: none !important;
}

.art-control button:focus,
.art-control-inner button:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Controls visibility */
.art-video-player .art-controls,
.art-video-player .art-control-progress {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.art-video-player.art-controls-show .art-controls,
.art-video-player.art-controls-show .art-control-progress {
    opacity: 1;
}

.art-video-player.art-controls-show .art-controls {
    background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0)) !important;
}

/* Touch device styles */
@media (hover: none) and (pointer: coarse) {
    .art-video-player .art-controls,
    .art-video-player .art-control-progress {
        opacity: 0;
    }

    .art-video-player.art-controls-show .art-controls,
    .art-video-player.art-controls-show .art-control-progress {
        opacity: 1;
    }
} 