/**
 * Enhanced WowPlatter Audio Player Styles
 * 
 * Features:
 * - Modern, responsive design
 * - Queue system with visual feedback
 * - Track listing panels
 * - Smooth animations and transitions
 * - Mobile-friendly layout
 *
 * @since 1.0.0
 */

/* Main Audio Player Container */
.wowplatter-audio-player {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 100px;
    /* Leave space for chatbot */
    background: white;
    color: #333;
    z-index: 9998;
    border: 2px solid #000;
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: auto;
    max-width: calc(100vw - 140px);
}

/* Hidden utility class */
.hidden {
    display: none !important;
}

/* In-queue button state */
.add-to-queue-btn.in-queue {
    background: #4caf50 !important;
    color: white !important;
    cursor: default !important;
}

/* Track item disabled state */
.track-item.track-disabled {
    opacity: 0.6;
    background: rgba(128, 128, 128, 0.1);
}

.track-item.track-disabled .track-item-title {
    color: #999;
}

.disabled-indicator {
    margin-left: 8px;
    font-size: 12px;
    opacity: 0.8;
}

/* Main Player Bar */
.player-main-bar {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    height: auto;
    min-height: 60px;
    box-sizing: border-box;
    gap: 20px;
    background: inherit;
}

/* Desktop controls wrapper - visible on desktop */
.desktop-controls-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: auto;
    /* push controls to the far right */
    flex: 0 0 auto;
    /* do not consume extra width */
}

/* Mobile controls wrapper - hidden on desktop */
.mobile-controls-row {
    display: none;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

/* Current Track Section */
.player-current-track {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.track-thumbnail {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    overflow: hidden;
    background: #f5f5f5;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.track-thumbnail:hover {
    transform: scale(1.05);
}

.track-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.track-icon {
    font-size: 18px;
    opacity: 0.6;
    color: #666;
}

.track-info {
    flex: 1;
    min-width: 0;
}

/* Ensure title and timeline stack vertically inside the player */
.wowplatter-audio-player .track-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.track-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
    line-height: 1.2;
}

.track-artist {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.9;
}

/* Player Controls */
.player-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-btn {
    background: white;
    border: 1px solid #333;
    color: #333;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    position: relative;
    font-size: 14px;
    font-weight: 600;
}

/* Control Button Text Labels */
.control-btn.prev-btn::after {
    content: 'L';
}

.control-btn.next-btn::after {
    content: 'R';
}

.control-btn.tracks-btn {
    justify-content: flex-start;
    padding-left: 6px;
}

.control-btn.queue-btn {
    justify-content: flex-start;
    padding-left: 6px;
}

.control-btn.tracks-btn::after {
    content: 'T';
}

.control-btn.queue-btn::after {
    content: 'Q';
}

.control-btn.expand-btn::after {
    content: '↑';
}

.control-btn.collapse-btn::after {
    content: '↓';
}

.close-btn::after {
    content: 'X';
    font-weight: bold;
}

/* Consolidated button styles */
.add-to-queue-btn,
.remove-from-queue-btn,
.release-link-btn {
    background: white;
    border: 1px solid #333;
    color: #333;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
    text-decoration: none;
}

.add-to-queue-btn:hover {
    background: #333;
    border-color: #333;
    color: white;
    transform: scale(1.1);
}

.remove-from-queue-btn:hover {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
    transform: scale(1.1);
}

.release-link-btn:hover {
    background: #333;
    border-color: #333;
    color: white;
    transform: scale(1.1);
    text-decoration: none;
}

/* .clear-btn styles consolidated above */

.control-btn:hover {
    background: #f0f0f0;
    border-color: #000;
    transform: scale(1.05);
}

.control-btn:active {
    transform: scale(0.95);
}

.control-btn:disabled,
.control-btn.disabled {
    background: #f5f5f5 !important;
    color: #999 !important;
    border-color: #ddd !important;
    cursor: not-allowed !important;
    opacity: 0.5;
    transform: none !important;
}

.control-btn:disabled:hover,
.control-btn.disabled:hover {
    background: #f5f5f5 !important;
    border-color: #ddd !important;
    transform: none !important;
}

.play-btn {
    background: #333;
    color: white;
    width: 36px;
    height: 36px;
    border: 2px solid #333;
    font-size: 14px;
}

.play-btn.playing::after {
    content: '⏸';
}

.play-btn.paused::after {
    content: '▶';
}

.play-btn:hover {
    background: #000;
    border-color: #000;
    transform: scale(1.1);
}

/* Progress Section */
.player-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    max-width: 300px;
}

/* New progress placement under title */
.track-progress,
.track-progress-desktop {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-top: 6px;
}

/* Default: show unified progress under title across screens */
.track-progress {
    display: flex;
}

.track-progress-desktop {
    display: none;
}

.time-display {
    font-size: 12px;
    color: #666;
    min-width: 35px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    transition: height 0.2s ease;
    border: 1px solid #ccc;
}

.progress-bar:hover {
    height: 6px;
}

.progress-fill {
    height: 100%;
    background: #333;
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s ease;
    position: relative;
    pointer-events: none;
}

.progress-fill::after {
    content: '';
    position: absolute;
    right: -2px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #333;
    border: 2px solid white;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

.progress-bar:hover .progress-fill::after {
    opacity: 1;
}

/* Right Controls */
.player-right-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.track-count,
.queue-count {
    background: #333;
    color: white;
    font-size: 10px;
    font-weight: 600;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #333;
    margin-left: 4px;
    line-height: 1;
}

/* YouTube Toggle Button */
.youtube-toggle-btn {
    font-size: 12px;
    font-weight: 600;
    background: white;
    color: #333;
    border: 1px solid #333;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.youtube-toggle-btn.enabled {
    background: #28a745;
    color: white;
    border-color: #28a745;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.3);
}

.youtube-toggle-btn.disabled {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
    box-shadow: 0 0 8px rgba(220, 53, 69, 0.3);
}

/* Minimize Button */
.minimize-btn {
    font-size: 18px;
    font-weight: bold;
}

/* Minimized Player State */
.minimized-player {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.restore-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #333;
    color: white;
    border: none;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.restore-btn:hover {
    background: #000;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

/* Hide main player content when minimized, but keep the container for the restore button */
.wowplatter-audio-player.minimized .player-main-bar,
.wowplatter-audio-player.minimized .tracks-panel,
.wowplatter-audio-player.minimized .queue-panel {
    display: none;
}

.wowplatter-audio-player.minimized {
    width: auto;
    height: auto;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

/* Panel Styles */
.tracks-panel,
.queue-panel,
.settings-panel {
    position: absolute;
    bottom: 100%;
    right: 20px;
    width: 400px;
    max-height: 500px;
    background: white;
    border: 2px solid #000;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 2px solid #000;
    background: #f8f8f8;
}

.panel-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.queue-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.clear-btn {
    background: white;
    border: 1px solid #333;
    color: #333;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.clear-btn:hover {
    background: #f0f0f0;
    border-color: #000;
    color: #000;
}

.close-btn {
    background: white;
    border: 1px solid #333;
    color: #333;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    line-height: 1;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.close-btn:hover {
    color: #000;
    background: #f0f0f0;
    border-color: #000;
}

/* Unified Music Panel */
.music-panel {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 90%;
    height: 450px;
    background: white;
    border: 2px solid #000;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: slideUp 0.3s ease;
    display: flex;
    flex-direction: column;
}

.music-panel .panel-header {
    flex-shrink: 0;
}

.music-panel .panel-header .music-icon {
    margin-right: 8px;
    font-size: 18px;
}

.music-panel .panel-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 16px;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* When no release tracks, queue takes full width */
.music-panel.queue-only .panel-body {
    grid-template-columns: 1fr;
}

.music-panel.queue-only .available-tracks-column {
    display: none;
}

.available-tracks-column,
.queue-column {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.column-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.column-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    flex: 1;
}

.count-badge {
    font-size: 11px;
    background: #333;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.column-header .clear-btn {
    margin-left: auto;
    padding: 4px 10px;
    font-size: 11px;
}

/* Music button styling */
.music-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px !important;
    width: auto !important;
}

.music-btn .music-icon {
    font-size: 16px;
    line-height: 1;
}

.music-badge {
    background: #333;
    color: white;
    font-size: 10px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0 4px;
}

/* Green badge for available tracks on release/listen pages */
.music-badge.has-tracks {
    background: #4caf50;
}

/* Green button glow for available tracks */
.music-btn.has-tracks {
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}
/* Empty state styling */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state p {
    margin: 0;
    font-size: 14px;
}

.hint {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 4px;
}

/* Track item "in queue" state */
.track-item.in-queue {
    opacity: 0.6;
}

.track-item.in-queue .add-to-queue-btn {
    background: #28a745;
    border-color: #28a745;
    color: white;
    cursor: default;
    pointer-events: none;
}

.track-item.in-queue .add-to-queue-btn::before {
    content: '✓';
}

/* Track Lists */
.tracks-list,
.queue-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 8px 0;
}

.tracks-list::-webkit-scrollbar,
.queue-list::-webkit-scrollbar {
    width: 6px;
}

.tracks-list::-webkit-scrollbar-track,
.queue-list::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.tracks-list::-webkit-scrollbar-thumb,
.queue-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.tracks-list::-webkit-scrollbar-thumb:hover,
.queue-list::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Track Items */
.track-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.track-item:hover {
    background: #f8f8f8;
    transform: translateX(2px);
}

.track-item:last-child {
    border-bottom: none;
}

.track-item.current-track {
    background: rgba(51, 51, 51, 0.1);
    border-left: 3px solid #333;
}

/* Release link button - styles consolidated above */

/* Toast notifications */
.wowplatter-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    color: #333;
    border: 1px solid #333;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 400px;
    font-size: 14px;
    animation: slideInRight 0.3s ease-out;
}

.wowplatter-toast-success {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.wowplatter-toast-warning {
    background: #FF9800;
    color: white;
    border-color: #FF9800;
}

.wowplatter-toast-error {
    background: #f44336;
    color: white;
    border-color: #f44336;
}

.wowplatter-toast-action {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.wowplatter-toast-action:hover {
    background: rgba(255, 255, 255, 0.3);
}

.wowplatter-toast-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    margin-left: auto;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.wowplatter-toast-close:hover {
    opacity: 1;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.track-item.current-track::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #333;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.track-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.track-item-thumb {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    overflow: hidden;
    background: #f5f5f5;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.track-item:hover .track-item-thumb {
    transform: scale(1.1);
}

.track-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.track-type-icon {
    font-size: 14px;
    opacity: 0.6;
    color: #666;
}

.track-item-details {
    flex: 1;
    min-width: 0;
}

.track-item-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    margin-bottom: 4px;
    line-height: 1.3;
}

.track-item-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #666;
}

.track-type {
    text-transform: capitalize;
    font-weight: 500;
}

.track-duration {
    font-variant-numeric: tabular-nums;
}

/* Action Buttons - styles consolidated above */

/* Track Item Actions Container */
.track-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Reorder buttons container */
.reorder-buttons {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Individual reorder buttons */
.move-up-btn,
.move-down-btn {
    background: white;
    border: 1px solid #333;
    color: #333;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.2s ease;
    font-size: 12px;
    line-height: 1;
    font-weight: bold;
    width: 24px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.move-up-btn:hover {
    background: #4CAF50;
    border-color: #4CAF50;
    color: white;
    transform: scale(1.1);
}

.move-down-btn:hover {
    background: #2196F3;
    border-color: #2196F3;
    color: white;
    transform: scale(1.1);
}

/* Release Link Button - styles consolidated above */

/* Empty States */
.queue-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.queue-empty p {
    margin: 0 0 8px 0;
    font-size: 14px;
}

.queue-hint {
    font-size: 12px;
    opacity: 0.8;
    line-height: 1.4;
}

/* Enhanced Responsive Design */
@media (max-width: 1200px) {
    .wowplatter-audio-player {
        max-width: calc(100vw - 100px);
    }

    .player-main-bar {
        padding: 10px 16px;
        gap: 12px;
    }

    .tracks-panel,
    .queue-panel {
        width: 380px;
        right: 16px;
    }
}

@media (max-width: 1024px) {
    .wowplatter-audio-player {
        max-width: calc(100vw - 80px);
    }

    .player-main-bar {
        padding: 10px 14px;
        gap: 10px;
    }

    .tracks-panel,
    .queue-panel {
        width: 350px;
    }

    .player-progress {
        max-width: 250px;
    }
}

@media (max-width: 768px) {
    .wowplatter-audio-player {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-width: 100vw;
        width: 100%;
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
    }

    .player-main-bar {
        padding: 8px 12px;
        gap: 6px;
        flex-direction: column;
        height: auto;
        min-height: 80px;
    }

    /* Hide desktop controls on mobile */
    .desktop-controls-row {
        display: none;
    }

    /* Show mobile controls on mobile */
    .mobile-controls-row {
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    /* Mobile: Stack track info on top */
    .player-current-track {
        order: 1;
        width: 100%;
        margin-bottom: 4px;
    }

    /* Mobile: Controls row at bottom */
    .mobile-controls-row {
        display: flex;
        flex-direction: column;
        width: 100%;
        order: 2;
        gap: 8px;
    }

    .mobile-controls-row .player-controls {
        display: flex;
        justify-content: center;
        gap: 6px;
        order: 1;
    }

    /* Progress under title on mobile */
    .track-progress {
        display: flex;
    }

    .track-progress-desktop {
        display: none;
    }

    .mobile-controls-row .player-right-controls {
        display: flex;
        justify-content: center;
        gap: 4px;
        order: 3;
    }

    .tracks-panel,
    .queue-panel {
        width: calc(100vw - 24px);
        right: 12px;
        left: 12px;
        max-height: 60vh;
    }

    .control-btn {
        padding: 6px 8px;
        font-size: 11px;
        min-width: 32px;
        height: 32px;
    }

    .track-title {
        font-size: 13px;
    }

    .track-artist {
        font-size: 11px;
    }

    /* Mobile shows single title; hide artist and duplicates */
    #current-title {
        display: block;
    }

    #current-artist {
        display: none;
    }

    #current-title-desktop {
        display: none;
    }

    #current-artist-desktop {
        display: none;
    }
}

@media (max-width: 480px) {
    .wowplatter-audio-player {
        font-size: 12px;
    }

    .player-main-bar {
        padding: 6px 8px;
        gap: 4px;
        flex-direction: column;
        min-height: 70px;
    }

    /* Hide desktop controls on mobile */
    .desktop-controls-row {
        display: none;
    }

    /* Show mobile controls on mobile */
    .mobile-controls-row {
        display: flex;
        flex-direction: column;
        gap: 6px;
        width: 100%;
        order: 2;
    }

    .mobile-controls-row .player-controls {
        display: flex;
        justify-content: center;
        gap: 4px;
        order: 1;
    }

    .mobile-controls-row .player-progress {
        display: flex;
        align-items: center;
        gap: 8px;
        order: 2;
        max-width: none;
        width: 100%;
        margin: 2px 0;
    }

    .mobile-controls-row .player-right-controls {
        display: flex;
        justify-content: center;
        gap: 3px;
        order: 3;
    }

    /* Ultra-compact track info */
    .player-current-track {
        order: 1;
        gap: 8px;
        margin-bottom: 2px;
    }

    .track-thumbnail {
        width: 28px;
        height: 28px;
    }

    .track-icon {
        font-size: 12px;
    }

    .track-title {
        font-size: 12px;
        line-height: 1.1;
    }

    .track-artist {
        font-size: 10px;
        line-height: 1.1;
    }

    .time-display {
        font-size: 9px;
        min-width: 35px;
    }

    .progress-bar {
        height: 3px;
    }

    .control-btn {
        padding: 3px 5px;
        font-size: 9px;
        min-width: 24px;
        height: 24px;
        width: 24px;
    }

    .play-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .tracks-panel,
    .queue-panel {
        width: calc(100vw - 16px);
        right: 8px;
        left: 8px;
        max-height: 50vh;
    }

    .track-item {
        padding: 6px 8px;
    }

    .track-item-thumb {
        width: 24px;
        height: 24px;
    }

    .track-type-icon {
        font-size: 10px;
    }

    .track-count,
    .queue-count {
        font-size: 8px;
        padding: 1px 3px;
        min-width: 12px;
        width: 12px;
        height: 12px;
    }
}

/* Standard iPhone screens (iPhone 12, 13, 14, etc.) */
@media (max-width: 414px) and (min-width: 376px) {
    .wowplatter-audio-player {
        font-size: 11px;
    }

    .player-main-bar {
        padding: 6px 8px;
        gap: 4px;
        flex-direction: column;
        min-height: 72px;
    }

    /* Hide desktop controls on mobile */
    .desktop-controls-row {
        display: none;
    }

    /* Show mobile controls on mobile */
    .mobile-controls-row {
        display: flex;
        flex-direction: column;
        gap: 4px;
        width: 100%;
        order: 2;
    }

    .mobile-controls-row .player-controls {
        display: flex;
        justify-content: center;
        gap: 10px;
        order: 1;
    }

    .mobile-controls-row .player-progress {
        display: flex;
        align-items: center;
        gap: 8px;
        order: 2;
        max-width: none;
        width: 100%;
        margin: 2px 0;
        padding: 0 6px;
    }

    .mobile-controls-row .player-right-controls {
        display: flex;
        justify-content: center;
        gap: 8px;
        order: 3;
    }

    /* Compact track info */
    .player-current-track {
        order: 1;
        gap: 8px;
        margin-bottom: 2px;
        padding: 0 6px;
    }

    .track-thumbnail {
        width: 30px;
        height: 30px;
    }

    .track-icon {
        font-size: 12px;
    }

    .track-title {
        font-size: 12px;
        line-height: 1.1;
    }

    .track-artist {
        font-size: 10px;
        line-height: 1.1;
    }

    .time-display {
        font-size: 10px;
        min-width: 34px;
    }

    .progress-bar {
        height: 4px;
        flex: 1;
    }

    .control-btn {
        padding: 6px 8px;
        font-size: 11px;
        min-width: 32px;
        height: 32px;
    }

    .play-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .track-count,
    .queue-count {
        font-size: 9px;
        min-width: 16px;
        width: 16px;
        height: 16px;
    }

    .tracks-panel,
    .queue-panel {
        width: calc(100vw - 20px);
        right: 10px;
        left: 10px;
        max-height: 60vh;
    }
}

/* Smaller iPhone screens (iPhone SE, etc.) */
@media (max-width: 375px) and (min-width: 321px) {
    .wowplatter-audio-player {
        font-size: 11px;
    }

    .player-main-bar {
        padding: 6px 8px;
        gap: 4px;
        flex-direction: column;
        min-height: 75px;
    }

    /* Hide desktop controls on mobile */
    .desktop-controls-row {
        display: none;
    }

    /* Show mobile controls on mobile */
    .mobile-controls-row {
        display: flex;
        flex-direction: column;
        gap: 4px;
        width: 100%;
        order: 2;
    }

    .mobile-controls-row .player-controls {
        display: flex;
        justify-content: center;
        gap: 8px;
        order: 1;
    }

    .mobile-controls-row .player-progress {
        display: flex;
        align-items: center;
        gap: 6px;
        order: 2;
        max-width: none;
        width: 100%;
        margin: 2px 0;
        padding: 0 4px;
    }

    .mobile-controls-row .player-right-controls {
        display: flex;
        justify-content: center;
        gap: 6px;
        order: 3;
    }

    /* Compact track info */
    .player-current-track {
        order: 1;
        gap: 6px;
        margin-bottom: 2px;
        padding: 0 4px;
    }

    .track-thumbnail {
        width: 28px;
        height: 28px;
    }

    .track-icon {
        font-size: 12px;
    }

    .track-title {
        font-size: 12px;
        line-height: 1.1;
    }

    .track-artist {
        font-size: 10px;
        line-height: 1.1;
    }

    .time-display {
        font-size: 9px;
        min-width: 32px;
    }

    .progress-bar {
        height: 3px;
        flex: 1;
    }

    .control-btn {
        padding: 5px 7px;
        font-size: 10px;
        min-width: 30px;
        height: 30px;
    }

    .play-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .track-count,
    .queue-count {
        font-size: 8px;
        min-width: 14px;
        width: 14px;
        height: 14px;
    }

    .tracks-panel,
    .queue-panel {
        width: calc(100vw - 16px);
        right: 8px;
        left: 8px;
        max-height: 60vh;
    }
}

/* Ultra-small screens */
@media (max-width: 320px) {
    .wowplatter-audio-player {
        font-size: 10px;
    }

    .player-main-bar {
        padding: 4px 2px;
        gap: 3px;
        flex-direction: column;
        min-height: 65px;
    }

    /* Hide desktop controls on mobile */
    .desktop-controls-row {
        display: none;
    }

    /* Show mobile controls on mobile */
    .mobile-controls-row {
        display: flex;
        flex-direction: column;
        gap: 3px;
        width: 100%;
        order: 2;
    }

    .mobile-controls-row .player-controls {
        display: flex;
        justify-content: center;
        gap: 6px;
        order: 1;
    }

    .mobile-controls-row .player-progress {
        display: flex;
        align-items: center;
        gap: 4px;
        order: 2;
        max-width: none;
        width: 100%;
        margin: 1px 0;
        padding: 0 2px;
    }

    .mobile-controls-row .player-right-controls {
        display: flex;
        justify-content: center;
        gap: 4px;
        order: 3;
    }

    /* Ultra-compact track info */
    .player-current-track {
        order: 1;
        gap: 4px;
        margin-bottom: 1px;
        padding: 0 2px;
    }

    .track-thumbnail {
        width: 22px;
        height: 22px;
    }

    .track-icon {
        font-size: 9px;
    }

    .track-title {
        font-size: 10px;
        line-height: 1.0;
    }

    .track-artist {
        font-size: 8px;
        line-height: 1.0;
    }

    .time-display {
        font-size: 8px;
        min-width: 28px;
    }

    .progress-bar {
        height: 2px;
        flex: 1;
    }

    .control-btn {
        padding: 4px 5px;
        font-size: 9px;
        min-width: 26px;
        height: 26px;
    }

    .play-btn {
        width: 28px;
        height: 28px;
        font-size: 10px;
    }

    .track-count,
    .queue-count {
        font-size: 7px;
        min-width: 12px;
        width: 12px;
        height: 12px;
    }

    .tracks-panel,
    .queue-panel {
        width: calc(100vw - 12px);
        right: 6px;
        left: 6px;
        max-height: 55vh;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    .track-thumbnail img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Dark Mode Enhancements - Disabled for consistent white theme */
/* @media (prefers-color-scheme: dark) {
    .wowplatter-audio-player {
        background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    }
    
    .panel-header {
        background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    }
} */

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {

    .wowplatter-audio-player,
    .control-btn,
    .track-item,
    .progress-bar,
    .track-thumbnail {
        transition: none;
    }

    .tracks-panel,
    .queue-panel {
        animation: none;
    }

    .track-item.current-track::before {
        animation: none;
    }
}

/* Settings Panel Styles */
.settings-content {
    padding: 20px;
}

.setting-item {
    margin-bottom: 20px;
}

.setting-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
}

.setting-checkbox {
    width: 16px;
    height: 16px;
    border: 2px solid #333;
    border-radius: 3px;
    background: white;
    cursor: pointer;
}

.setting-checkbox:checked {
    background: #333;
    border-color: #333;
}

.setting-description {
    margin: 8px 0 0 24px;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

/* Focus States for Accessibility */
.control-btn:focus,
.add-to-queue-btn:focus,
.remove-from-queue-btn:focus,
.clear-btn:focus,
.close-btn:focus {
    outline: 2px solid #333;
    outline-offset: 2px;
}

.track-item:focus {
    outline: 2px solid #333;
    outline-offset: -2px;
}

/* Print Styles */
@media print {
    .wowplatter-audio-player {
        display: none;
    }
}

.current-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

/* Desktop keeps single title; hide artist and duplicates */
#current-title {
    display: block;
}

#current-artist {
    display: none;
}

#current-title-desktop {
    display: none;
}

#current-artist-desktop {
    display: none;
}