/**
 * MotChill ArtPlayer Styles - PhimUs Style
 * Custom styling for ArtPlayer.js
 */

/* ========================================
   ARTPlayer CUSTOM STYLES
   ======================================== */

/* Player Container */
#motchill-artplayer {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 600px !important;
    max-height: 800px !important;
    background: #000 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
    margin-bottom: 30px !important;
    border: 2px solid rgba(221, 0, 63, 0.2) !important;
    z-index: 1 !important;
}

/* Force show iframe for embed videos */
#motchill-artplayer iframe {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    border-radius: 12px !important;
    background: #000 !important;
    position: relative !important;
    z-index: 1000 !important;
}

/* ArtPlayer Theme Colors */
.artplayer-app {
    --art-theme: #DD003F !important;
    --art-background: #000 !important;
    --art-foreground: #fff !important;
    --art-border-radius: 8px !important;
}

/* Controls Styling */
.artplayer .art-controls {
    background: linear-gradient(transparent, rgba(0,0,0,0.9)) !important;
    padding: 20px !important;
    min-height: 80px !important;
    border-radius: 0 0 12px 12px !important;
    backdrop-filter: blur(10px) !important;
    border-top: 1px solid rgba(221, 0, 63, 0.3) !important;
}

.artplayer .art-controls .art-control {
    background: rgba(255,255,255,0.1) !important;
    color: white !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    margin: 0 5px !important;
}

.artplayer .art-controls .art-control:hover {
    background: rgba(221, 0, 63, 0.8) !important;
    transform: scale(1.1) !important;
}

/* Progress Bar */
.artplayer .art-progress {
    height: 8px !important;
    background: rgba(255,255,255,0.3) !important;
    border-radius: 4px !important;
    margin: 15px 0 !important;
}

.artplayer .art-progress .art-progress-loaded {
    background: rgba(255,255,255,0.5) !important;
}

.artplayer .art-progress .art-progress-played {
    background: #DD003F !important;
    box-shadow: 0 0 10px rgba(221, 0, 63, 0.5) !important;
}

.artplayer .art-progress .art-progress-hover {
    background: rgba(221, 0, 63, 0.3) !important;
}

/* Volume Control */
.artplayer .art-volume {
    background: rgba(255,255,255,0.1) !important;
    border-radius: 20px !important;
    height: 6px !important;
}

.artplayer .art-volume .art-volume-played {
    background: #DD003F !important;
}

/* Time Display */
.artplayer .art-time {
    color: white !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    font-family: 'Roboto', sans-serif !important;
}

/* Play Button */
.artplayer .art-control[data-name="play"] {
    background: rgba(221, 0, 63, 0.8) !important;
    border-radius: 50% !important;
    width: 50px !important;
    height: 50px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important;
}

/* Seek Buttons */
.artplayer .art-control[data-name="seek-back"],
.artplayer .art-control[data-name="seek-forward"] {
    background: rgba(255,255,255,0.1) !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
}

/* Volume Button */
.artplayer .art-control[data-name="volume"] {
    background: rgba(255,255,255,0.1) !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 16px !important;
}

/* Settings Button */
.artplayer .art-control[data-name="setting"] {
    background: rgba(255,255,255,0.1) !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 16px !important;
}

/* Fullscreen Button */
.artplayer .art-control[data-name="fullscreen"] {
    background: rgba(255,255,255,0.1) !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 16px !important;
}

/* Picture-in-Picture Button */
.artplayer .art-control[data-name="pip"] {
    background: rgba(255,255,255,0.1) !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 16px !important;
}

/* Settings Menu */
.artplayer .art-setting {
    background: rgba(0,0,0,0.9) !important;
    border-radius: 12px !important;
    border: 1px solid rgba(221, 0, 63, 0.3) !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5) !important;
    backdrop-filter: blur(10px) !important;
}

.artplayer .art-setting-item {
    color: white !important;
    padding: 12px 20px !important;
    border-bottom: 1px solid rgba(255,255,255,0.1) !important;
    transition: all 0.3s ease !important;
}

.artplayer .art-setting-item:hover {
    background: rgba(221, 0, 63, 0.2) !important;
}

.artplayer .art-setting-item.active {
    background: rgba(221, 0, 63, 0.3) !important;
    color: #DD003F !important;
}

.artplayer .art-setting-item .art-setting-label {
    font-size: 14px !important;
    font-weight: 500 !important;
}

/* Episode Navigation Overlay */
.episode-navigation-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    pointer-events: none !important;
    z-index: 10 !important;
}

.episode-nav-btn {
    position: absolute !important;
    background: rgba(221, 0, 63, 0.8) !important;
    color: white !important;
    border: none !important;
    padding: 15px 20px !important;
    border-radius: 25px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    opacity: 0 !important;
    transition: all 0.3s ease !important;
    pointer-events: auto !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3) !important;
    backdrop-filter: blur(10px) !important;
}

.episode-nav-btn:hover {
    background: rgba(221, 0, 63, 1) !important;
    transform: scale(1.05) !important;
    box-shadow: 0 8px 25px rgba(221, 0, 63, 0.4) !important;
}

.episode-nav-btn.prev-episode {
    left: 20px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
}

.episode-nav-btn.next-episode {
    right: 20px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
}

/* Loading Spinner */
.artplayer .art-loading {
    background: rgba(0,0,0,0.8) !important;
    border-radius: 12px !important;
}

.artplayer .art-loading .art-loading-spinner {
    border-color: #DD003F !important;
    border-top-color: transparent !important;
}

/* Error Display */
.artplayer .art-error {
    background: rgba(0,0,0,0.9) !important;
    color: white !important;
    border-radius: 12px !important;
    padding: 20px !important;
}

/* Tooltip */
.artplayer .art-tooltip {
    background: rgba(0,0,0,0.9) !important;
    color: white !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    border: 1px solid rgba(221, 0, 63, 0.3) !important;
}

/* Context Menu */
.artplayer .art-contextmenu {
    background: rgba(0,0,0,0.9) !important;
    border-radius: 12px !important;
    border: 1px solid rgba(221, 0, 63, 0.3) !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5) !important;
    backdrop-filter: blur(10px) !important;
}

.artplayer .art-contextmenu-item {
    color: white !important;
    padding: 12px 20px !important;
    border-bottom: 1px solid rgba(255,255,255,0.1) !important;
    transition: all 0.3s ease !important;
}

.artplayer .art-contextmenu-item:hover {
    background: rgba(221, 0, 63, 0.2) !important;
    color: #DD003F !important;
}

/* Danmuku Plugin */
.artplayer .art-danmuku {
    pointer-events: none !important;
}

.artplayer .art-danmuku-item {
    color: white !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8) !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    line-height: 1.4 !important;
}

/* Thumbnail Preview */
.artplayer .art-thumbnail {
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    #motchill-artplayer {
        min-height: 400px !important;
        max-height: 500px !important;
        margin-bottom: 20px !important;
    }
    
    .artplayer .art-controls {
        padding: 15px !important;
        min-height: 60px !important;
    }
    
    .artplayer .art-control {
        margin: 0 3px !important;
    }
    
    .artplayer .art-control[data-name="play"] {
        width: 40px !important;
        height: 40px !important;
        font-size: 16px !important;
    }
    
    .episode-nav-btn {
        padding: 10px 15px !important;
        font-size: 12px !important;
    }
    
    .episode-nav-btn.prev-episode {
        left: 10px !important;
    }
    
    .episode-nav-btn.next-episode {
        right: 10px !important;
    }
}

@media (max-width: 480px) {
    #motchill-artplayer {
        min-height: 300px !important;
        max-height: 400px !important;
        border-radius: 8px !important;
    }
    
    .artplayer .art-controls {
        padding: 10px !important;
        min-height: 50px !important;
    }
    
    .artplayer .art-time {
        font-size: 12px !important;
    }
    
    .episode-nav-btn {
        padding: 8px 12px !important;
        font-size: 11px !important;
    }
}

/* Fullscreen Mode */
.artplayer.art-fullscreen {
    background: #000 !important;
}

.artplayer.art-fullscreen #motchill-artplayer {
    border-radius: 0 !important;
    margin-bottom: 0 !important;
}

/* Hide Default ArtPlayer Styles */
.artplayer * {
    box-sizing: border-box !important;
}

/* Custom Scrollbar */
.artplayer ::-webkit-scrollbar {
    width: 6px !important;
}

.artplayer ::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1) !important;
    border-radius: 3px !important;
}

.artplayer ::-webkit-scrollbar-thumb {
    background: #DD003F !important;
    border-radius: 3px !important;
}

.artplayer ::-webkit-scrollbar-thumb:hover {
    background: rgba(221, 0, 63, 0.8) !important;
}

/* Animation for Episode Navigation */
@keyframes slideInLeft {
    from {
        transform: translateY(-50%) translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(-50%) translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateY(-50%) translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateY(-50%) translateX(0);
        opacity: 1;
    }
}

.episode-nav-btn.prev-episode {
    animation: slideInLeft 0.3s ease-out !important;
}

.episode-nav-btn.next-episode {
    animation: slideInRight 0.3s ease-out !important;
}

/* Custom Focus Styles */
.artplayer .art-control:focus {
    outline: 2px solid #DD003F !important;
    outline-offset: 2px !important;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .artplayer .art-control {
        border: 2px solid white !important;
    }
    
    .artplayer .art-progress-played {
        border: 2px solid white !important;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .artplayer .art-control,
    .episode-nav-btn,
    .art-setting-item {
        transition: none !important;
    }
    
    .episode-nav-btn.prev-episode,
    .episode-nav-btn.next-episode {
        animation: none !important;
    }
}
