/* music/static/music/css/player.css */

/* 播放器区域样式 */
.player-section {
    margin: 24px 0;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .player-section {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

@media (prefers-color-scheme: dark) {
    .player-section {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    }
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

/* 播放按钮样式 */
.play-btn {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(39, 174, 96, 0.3);
    min-width: 100px;
    position: relative;
    overflow: hidden;
}

.play-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.play-btn:hover::before {
    left: 100%;
}

.play-btn:hover {
    background: linear-gradient(135deg, #229954 0%, #27ae60 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

.play-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
}

.play-btn.playing {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    box-shadow: 0 3px 12px rgba(231, 76, 60, 0.3);
}

.play-btn.playing:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.play-btn.loading {
    background: linear-gradient(135deg, #95a5a6 0%, #bdc3c7 100%);
    cursor: not-allowed;
    box-shadow: 0 2px 8px rgba(149, 165, 166, 0.3);
}

.play-btn.loading:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(149, 165, 166, 0.3);
}

.play-icon {
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.play-btn.playing .play-icon {
    transform: scale(0.9);
}

.play-text {
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

/* 倍速控制样式 */
.speed-control {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.speed-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    transition: color 0.3s ease;
    text-align: center;
}

.speed-options {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.speed-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.speed-option input[type="radio"] {
    display: none;
}

.speed-radio {
    padding: 6px 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--card-background);
    color: var(--text-color);
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 45px;
    text-align: center;
    user-select: none;
}

.speed-option:hover .speed-radio {
    border-color: var(--primary-color);
    background-color: rgba(78, 84, 200, 0.05);
}

.speed-option input[type="radio"]:checked + .speed-radio {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color) 0%, #5a63d8 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(78, 84, 200, 0.3);
}

.speed-control select {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--card-background);
    color: var(--text-color);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 70px;
}

.speed-control select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(78, 84, 200, 0.1);
}

.speed-control select:hover {
    border-color: var(--primary-color);
}

/* 进度条区域 */
.progress-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
}

.progress-bar {
    position: relative;
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.progress-bar:hover {
    height: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, #5a63d8 100%);
    border-radius: 4px;
    width: 0%;
    transition: width 0.15s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        rgba(255, 255, 255, 0.1) 25%, 
        transparent 25%, 
        transparent 50%, 
        rgba(255, 255, 255, 0.1) 50%, 
        rgba(255, 255, 255, 0.1) 75%, 
        transparent 75%, 
        transparent);
    background-size: 20px 20px;
    animation: progressShine 2s linear infinite;
}

@keyframes progressShine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* 时间显示 */
.time-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--light-text);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-weight: 500;
    transition: color 0.3s ease;
    background-color: rgba(0, 0, 0, 0.05);
    padding: 4px 8px;
    border-radius: 4px;
}

[data-theme="dark"] .time-display {
    background-color: rgba(255, 255, 255, 0.05);
}

@media (prefers-color-scheme: dark) {
    .time-display {
        background-color: rgba(255, 255, 255, 0.05);
    }
}

.time-display span {
    letter-spacing: 0.5px;
}

/* 播放器状态 */
.player-status {
    font-size: 12px;
    color: var(--light-text);
    text-align: center;
    margin-top: 8px;
    padding: 6px 12px;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    transition: all 0.3s ease;
    font-weight: 500;
}

[data-theme="dark"] .player-status {
    background-color: rgba(255, 255, 255, 0.05);
}

@media (prefers-color-scheme: dark) {
    .player-status {
        background-color: rgba(255, 255, 255, 0.05);
    }
}

.player-status.playing {
    color: #27ae60;
    background-color: rgba(39, 174, 96, 0.1);
}

.player-status.paused {
    color: #f39c12;
    background-color: rgba(243, 156, 18, 0.1);
}

.player-status.loading {
    color: #3498db;
    background-color: rgba(52, 152, 219, 0.1);
}

.player-status.error {
    color: #e74c3c;
    background-color: rgba(231, 76, 60, 0.1);
}

/* 加载动画 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading-text {
    animation: pulse 1.5s ease-in-out infinite;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .player-controls {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .progress-section {
        width: 100%;
        min-width: auto;
        order: 3;
    }
    
    .play-btn {
        width: 100%;
        justify-content: center;
        padding: 14px 18px;
        font-size: 16px;
        order: 1;
    }
    
    .speed-control {
        width: 100%;
        order: 2;
    }
    
    .speed-options {
        gap: 8px;
    }
    
    .speed-radio {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 50px;
    }
    
    .progress-bar {
        height: 10px;
    }
    
    .progress-bar:hover {
        height: 12px;
    }
    
    .time-display {
        font-size: 14px;
        padding: 6px 10px;
    }
    
    .player-status {
        font-size: 13px;
        margin-top: 10px;
    }
}

@media (max-width: 480px) {
    .player-section {
        padding: 16px;
        margin: 20px 0;
    }
    
    .play-btn {
        padding: 12px 16px;
        font-size: 15px;
    }
    
    .speed-control {
        gap: 10px;
    }
    
    .speed-label {
        font-size: 13px;
    }
    
    .speed-options {
        gap: 3px;
        flex-wrap: wrap;
        justify-content: center;
        max-width: 320px;
        margin: 0 auto;
    }
    
    .speed-radio {
        padding: 5px 6px;
        font-size: 10px;
        min-width: 35px;
        flex: 1;
        max-width: 48px;
    }
    
    .progress-bar {
        height: 12px;
    }
    
    .time-display {
        font-size: 12px;
        padding: 5px 8px;
    }
    
    .player-status {
        font-size: 12px;
        padding: 5px 10px;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .progress-bar {
        border: 2px solid var(--text-color);
    }
    
    .progress-fill {
        background: var(--text-color);
    }
    
    .progress-handle {
        border: 3px solid var(--text-color);
        background: var(--card-background);
    }
    
    .time-display {
        border: 1px solid var(--text-color);
        background-color: var(--card-background);
    }
    
    .player-status {
        border: 1px solid var(--text-color);
        background-color: var(--card-background);
    }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
    .play-btn,
    .progress-bar,
    .progress-fill,
    .progress-handle,
    .time-display,
    .player-status {
        transition: none;
    }
    
    .play-btn::before {
        display: none;
    }
    
    .progress-fill::after {
        animation: none;
    }
    
    .loading-text {
        animation: none;
    }
}