/* Audio Player Component Styles - FULLY RESPONSIVE & MOBILE OPTIMIZED */

.player-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    background: linear-gradient(135deg, var(--darker-bg) 0%, var(--card-bg) 100%);
    border-top: 1px solid var(--border-color);
    padding: 12px 20px;
    box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.3);
    flex-wrap: wrap;
    transition: all 0.3s ease;
}

/* Song Info Section */
.player-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 180px;
    flex: 2;
}

.player-cover {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

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

.player-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-artist {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Controls Section */
.player-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.player-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    transition: all 0.2s ease;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.player-btn:hover {
    color: var(--primary-color);
    transform: scale(1.1);
    background: var(--hover-bg);
}

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

.play-pause {
    background: var(--primary-color);
    width: 48px;
    height: 48px;
}

.play-pause:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
    color: white;
}

.play-pause:active {
    transform: scale(0.95);
}

/* Progress Section */
.player-progress {
    flex: 3;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
}

.current-time,
.duration {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 40px;
    text-align: center;
    font-family: monospace;
}

.progress-bar {
    flex: 1;
    height: 5px;
    background: var(--border-color);
    border-radius: 5px;
    cursor: pointer;
    position: relative;
    transition: height 0.2s ease;
}

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    border-radius: 5px;
    width: 0%;
    transition: width 0.1s linear;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s ease;
}

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

/* Extra Actions */
.player-extra {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.download-player-btn {
    background: var(--success-color);
}

.download-player-btn:hover {
    background: #00a844;
    transform: scale(1.05);
    color: white;
}

/* Shuffle and Repeat Active States */
#shuffle-btn.active,
#repeat-btn.active,
#shuffle-btn[style*="color: #6c63ff"],
#repeat-btn[style*="color: #6c63ff"] {
    color: var(--primary-color) !important;
}

/* ========== TABLET (641px - 768px) ========== */
@media (max-width: 768px) {
    .player-container {
        padding: 10px 15px;
        gap: 10px;
    }
    
    .player-info {
        min-width: 150px;
        flex: 1;
    }
    
    .player-cover {
        width: 42px;
        height: 42px;
    }
    
    .player-title {
        font-size: 13px;
    }
    
    .player-artist {
        font-size: 11px;
    }
    
    .player-controls {
        gap: 6px;
    }
    
    .player-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .play-pause {
        width: 42px;
        height: 42px;
    }
    
    .player-progress {
        min-width: 180px;
        flex: 2;
    }
    
    .current-time,
    .duration {
        font-size: 11px;
        min-width: 35px;
    }
}

/* ========== MOBILE LANDSCAPE (481px - 640px) ========== */
@media (max-width: 640px) {
    .player-container {
        padding: 8px 12px;
        gap: 8px;
    }
    
    .player-info {
        min-width: 130px;
    }
    
    .player-cover {
        width: 36px;
        height: 36px;
    }
    
    .player-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .play-pause {
        width: 38px;
        height: 38px;
    }
    
    .player-progress {
        min-width: 150px;
    }
}

/* ========== MOBILE PORTRAIT (320px - 480px) ========== */
@media (max-width: 480px) {
    .player-container {
        flex-direction: column;
        padding: 10px;
        gap: 10px;
    }
    
    .player-info {
        width: 100%;
        min-width: unset;
        order: 1;
    }
    
    .player-controls {
        order: 2;
        width: 100%;
        justify-content: center;
        gap: 15px;
    }
    
    .player-progress {
        order: 3;
        width: 100%;
        min-width: unset;
    }
    
    .player-extra {
        order: 4;
        width: 100%;
        justify-content: center;
        gap: 15px;
    }
    
    .player-btn {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
    
    .play-pause {
        width: 52px;
        height: 52px;
    }
    
    .play-pause i {
        font-size: 20px;
    }
    
    .current-time,
    .duration {
        font-size: 12px;
        min-width: 38px;
    }
    
    .progress-bar {
        height: 6px;
    }
    
    .progress-bar:hover {
        height: 8px;
    }
}

/* ========== VERY SMALL DEVICES (under 360px) ========== */
@media (max-width: 360px) {
    .player-container {
        padding: 8px;
    }
    
    .player-info {
        gap: 8px;
    }
    
    .player-cover {
        width: 32px;
        height: 32px;
    }
    
    .player-title {
        font-size: 11px;
    }
    
    .player-artist {
        font-size: 10px;
    }
    
    .player-controls {
        gap: 8px;
    }
    
    .player-btn {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }
    
    .play-pause {
        width: 44px;
        height: 44px;
    }
    
    .current-time,
    .duration {
        font-size: 10px;
        min-width: 32px;
    }
}

/* ========== TOUCH OPTIMIZATIONS ========== */
@media (hover: none) and (pointer: coarse) {
    .player-btn {
        min-width: 48px;
        min-height: 48px;
    }
    
    .progress-bar {
        min-height: 8px;
    }
    
    .progress-fill::after {
        width: 16px;
        height: 16px;
        opacity: 1;
        background: white;
        border: 2px solid var(--primary-color);
    }
}

/* ========== REDUCED MOTION PREFERENCE ========== */
@media (prefers-reduced-motion: reduce) {
    .player-btn,
    .play-pause,
    .progress-fill {
        transition: none;
    }
    
    .player-btn:hover {
        transform: none;
    }
}

/* ========== DARK MODE ADJUSTMENTS ========== */
@media (prefers-color-scheme: dark) {
    .player-container {
        background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    }
}

/* ========== LIGHT MODE SUPPORT ========== */
.light-theme .player-container {
    background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
    border-top-color: #e0e0e0;
}

.light-theme .progress-bar {
    background: #e0e0e0;
}

/* ========== PLAYER ANIMATIONS ========== */
@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

.playing-animation {
    position: relative;
}

.playing-animation::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    animation: pulse-ring 1.5s ease-out infinite;
    pointer-events: none;
}

/* Volume control (if added later) */
.player-volume {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-slider {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    background: var(--border-color);
    border-radius: 2px;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

@media (max-width: 480px) {
    .player-volume {
        display: none;
    }
}