/* Continuous Music Player - Mobile Optimized CSS */

/* Reset and base styles */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Wrapper - Fixed positioning with mobile considerations */
#cmp-wrapper {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    z-index: 999999 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    -khtml-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

/* Show Button - Improved for mobile */
.cmp-show-btn {
    width: 60px !important;
    height: 60px !important;
    border: none !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    font-size: 24px !important;
    cursor: pointer !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    outline: none !important;
    -webkit-transform: translateZ(0) !important;
    transform: translateZ(0) !important;
    -webkit-backface-visibility: hidden !important;
    backface-visibility: hidden !important;
}

.cmp-show-btn:hover,
.cmp-show-btn:active {
    transform: translateY(-2px) translateZ(0) !important;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4) !important;
}

.cmp-show-btn:active {
    transform: translateY(0) translateZ(0) !important;
}

/* Main Popup - Enhanced for mobile */
.cmp-popup {
    width: 350px !important;
    max-width: calc(100vw - 40px) !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3) !important;
    color: white !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    -webkit-transform: translateZ(0) !important;
    transform: translateZ(0) !important;
    -webkit-backface-visibility: hidden !important;
    backface-visibility: hidden !important;
}

/* Header - Improved touch targets */
.cmp-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 15px 20px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
    margin: 0 !important;
    min-height: 50px !important;
}

.cmp-header span {
    font-weight: 600 !important;
    font-size: 14px !important;
    margin: 0 !important;
    color: white !important;
}

.cmp-header-buttons {
    display: flex !important;
    gap: 8px !important;
    margin: 0 !important;
}

.cmp-header-buttons button {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    border: none !important;
    background: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: bold !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    margin: 0 !important;
    padding: 0 !important;
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

.cmp-header-buttons button:hover,
.cmp-header-buttons button:active {
    background: rgba(255, 255, 255, 0.3) !important;
    transform: scale(1.05) !important;
}

.cmp-header-buttons button:active {
    transform: scale(0.95) !important;
}

/* Content */
.cmp-content {
    padding: 20px !important;
    margin: 0 !important;
}

/* Current Track Info - Mobile optimized */
.cmp-current {
    display: flex !important;
    align-items: center !important;
    margin-bottom: 20px !important;
    gap: 15px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    padding: 15px !important;
    border-radius: 8px !important;
}

.cmp-artwork {
    width: 60px !important;
    height: 60px !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
    background: rgba(255, 255, 255, 0.1) !important;
    margin: 0 !important;
}

.cmp-artwork img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

.cmp-info {
    flex: 1 !important;
    min-width: 0 !important;
    margin: 0 !important;
}

#cmp-title {
    font-weight: 600 !important;
    font-size: 16px !important;
    margin: 0 0 5px 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    color: white !important;
}

#cmp-artist {
    font-size: 14px !important;
    opacity: 0.8 !important;
    margin: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    color: white !important;
}

/* Controls - Enhanced for mobile touch */
.cmp-controls {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 15px !important;
    margin-bottom: 20px !important;
}

.cmp-controls button {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    border: none !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    cursor: pointer !important;
    font-size: 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    margin: 0 !important;
    padding: 0 !important;
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

.cmp-controls button:hover,
.cmp-controls button:active {
    background: rgba(255, 255, 255, 0.3) !important;
    transform: scale(1.05) !important;
}

.cmp-controls button:active {
    transform: scale(0.95) !important;
}

#cmp-play {
    width: 64px !important;
    height: 64px !important;
    min-width: 64px !important;
    min-height: 64px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    color: #667eea !important;
    font-size: 28px !important;
}

/* Progress - Improved mobile interaction */
.cmp-progress {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin-bottom: 15px !important;
}

.cmp-progress-bar {
    flex: 1 !important;
    position: relative !important;
    height: 8px !important;
    background: rgba(255, 255, 255, 0.2) !important;
    border-radius: 4px !important;
    margin: 0 !important;
    cursor: pointer !important;
}

#cmp-progress-fill {
    height: 100% !important;
    background: rgba(255, 255, 255, 0.8) !important;
    border-radius: 4px !important;
    width: 0% !important;
    transition: width 0.1s linear !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none !important;
}

#cmp-progress-slider {
    position: absolute !important;
    top: -6px !important;
    left: 0 !important;
    width: 100% !important;
    height: 20px !important;
    opacity: 0 !important;
    cursor: pointer !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    outline: none !important;
    border: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

#cmp-time-current,
#cmp-time-total {
    font-size: 12px !important;
    opacity: 0.8 !important;
    min-width: 35px !important;
    text-align: center !important;
    margin: 0 !important;
    color: white !important;
}

/* Volume - Mobile-friendly */
.cmp-volume {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin-bottom: 20px !important;
}

.cmp-volume span {
    font-size: 16px !important;
    margin: 0 !important;
    min-width: 20px !important;
}

#cmp-volume {
    flex: 1 !important;
    height: 6px !important;
    background: rgba(255, 255, 255, 0.2) !important;
    border-radius: 3px !important;
    outline: none !important;
    cursor: pointer !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

#cmp-volume::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 20px !important;
    height: 20px !important;
    background: white !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

#cmp-volume::-moz-range-thumb {
    width: 20px !important;
    height: 20px !important;
    background: white !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    border: none !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

/* Playlist - Enhanced mobile scrolling */
.cmp-playlist h4 {
    font-size: 14px !important;
    font-weight: 600 !important;
    margin: 0 0 10px 0 !important;
    opacity: 0.9 !important;
    color: white !important;
    border-top: 1px solid rgba(255, 255, 255, 0.2) !important;
    padding-top: 15px !important;
}

#cmp-playlist-list {
    max-height: 150px !important;
    overflow-y: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-overflow-scrolling: touch !important;
}

.cmp-playlist-item {
    padding: 12px !important;
    margin-bottom: 5px !important;
    border-radius: 6px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    border: none !important;
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
    -webkit-tap-highlight-color: transparent !important;
}

.cmp-playlist-item:hover,
.cmp-playlist-item:active {
    background: rgba(255, 255, 255, 0.1) !important;
}

.cmp-playlist-item.cmp-active {
    background: rgba(255, 255, 255, 0.2) !important;
}

.cmp-playlist-info {
    flex: 1 !important;
    min-width: 0 !important;
}

.cmp-playlist-title {
    font-size: 13px !important;
    font-weight: 500 !important;
    margin: 0 0 3px 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    color: white !important;
}

.cmp-playlist-artist {
    font-size: 11px !important;
    opacity: 0.7 !important;
    margin: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    color: white !important;
}

/* Scrollbar - Mobile friendly */
#cmp-playlist-list::-webkit-scrollbar {
    width: 6px !important;
}

#cmp-playlist-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: 3px !important;
}

#cmp-playlist-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3) !important;
    border-radius: 3px !important;
}

/* Shortcode Button */
.cmp-shortcode-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: none !important;
    padding: 12px 24px !important;
    border-radius: 25px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4) !important;
    margin: 0 !important;
    outline: none !important;
    min-height: 44px !important;
    -webkit-tap-highlight-color: transparent !important;
}

.cmp-shortcode-btn:hover,
.cmp-shortcode-btn:active {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6) !important;
}

.cmp-shortcode-btn:active {
    transform: translateY(0) !important;
}

/* Dark Theme */
.cmp-popup.cmp-theme-dark {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%) !important;
}

/* Loading state */
.cmp-loading {
    text-align: center !important;
    padding: 20px !important;
    opacity: 0.7 !important;
    color: white !important;
    margin: 0 !important;
}

/* Mobile Responsive - Tablet */
@media (max-width: 768px) {
    #cmp-wrapper {
        bottom: 15px !important;
        right: 15px !important;
        left: 15px !important;
    }
    
    .cmp-popup {
        width: auto !important;
        max-width: none !important;
    }
    
    .cmp-show-btn {
        width: 56px !important;
        height: 56px !important;
        font-size: 22px !important;
    }
    
    .cmp-current {
        gap: 12px !important;
    }
    
    .cmp-controls {
        gap: 12px !important;
    }
    
    .cmp-controls button {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
    }
    
    #cmp-play {
        width: 60px !important;
        height: 60px !important;
        min-width: 60px !important;
        min-height: 60px !important;
        font-size: 24px !important;
    }
}

/* Mobile Responsive - Phone */
@media (max-width: 480px) {
    #cmp-wrapper {
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
    }
    
    .cmp-popup {
        border-radius: 12px 12px 0 0 !important;
        max-height: 70vh !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .cmp-content {
        padding: 15px !important;
    }
    
    .cmp-current {
        flex-direction: column !important;
        text-align: center !important;
        gap: 12px !important;
    }
    
    .cmp-artwork {
        width: 80px !important;
        height: 80px !important;
    }
    
    #cmp-title {
        font-size: 18px !important;
        text-align: center !important;
    }
    
    #cmp-artist {
        font-size: 14px !important;
        text-align: center !important;
    }
    
    .cmp-show-btn {
        width: 50px !important;
        height: 50px !important;
        font-size: 20px !important;
        position: absolute !important;
        bottom: 10px !important;
        right: 10px !important;
    }
    
    .cmp-header {
        padding: 12px 15px !important;
        min-height: 44px !important;
    }
    
    .cmp-header-buttons button {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
    }
    
    #cmp-playlist-list {
        max-height: 120px !important;
    }
    
    /* Ensure touch targets are at least 44px */
    .cmp-playlist-item {
        min-height: 48px !important;
        padding: 14px 12px !important;
    }
}

/* Very small screens */
@media (max-width: 320px) {
    .cmp-content {
        padding: 12px !important;
    }
    
    .cmp-controls {
        gap: 8px !important;
    }
    
    .cmp-controls button {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        font-size: 16px !important;
    }
    
    #cmp-play {
        width: 56px !important;
        height: 56px !important;
        min-width: 56px !important;
        min-height: 56px !important;
        font-size: 22px !important;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    #cmp-wrapper {
        bottom: 10px !important;
        right: 10px !important;
        left: auto !important;
    }
    
    .cmp-popup {
        max-height: 80vh !important;
        width: 350px !important;
        max-width: 50vw !important;
        border-radius: 12px !important;
    }
    
    .cmp-current {
        flex-direction: row !important;
        text-align: left !important;
    }
    
    #cmp-title,
    #cmp-artist {
        text-align: left !important;
    }
}

/* Prevent conflicts with theme styles */
.cmp-popup * {
    box-sizing: border-box !important;
}

.cmp-popup input,
.cmp-popup button {
    font-family: inherit !important;
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .cmp-show-btn,
    .cmp-controls button,
    .cmp-header-buttons button {
        -webkit-font-smoothing: antialiased !important;
        -moz-osx-font-smoothing: grayscale !important;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .cmp-popup,
    .cmp-show-btn,
    .cmp-controls button,
    .cmp-header-buttons button,
    .cmp-playlist-item {
        transition: none !important;
    }
}

/* Focus states for accessibility */
.cmp-show-btn:focus,
.cmp-controls button:focus,
.cmp-header-buttons button:focus,
.cmp-playlist-item:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5) !important;
    outline-offset: 2px !important;
}

#cmp-volume:focus,
#cmp-progress-slider:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5) !important;
    outline-offset: 1px !important;
}