/* 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-row {
    margin-bottom: 16px;
}

.player-row:last-child {
    margin-bottom: 0;
}

/* =============== 播放速度控制 =============== */
.speed-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.speed-row .speed-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    transition: color 0.3s ease;
    flex-shrink: 0;
    margin-right: 16px;
}

.speed-row .speed-options {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap; /* 确保按钮始终在一行 */
}

.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;
    flex-shrink: 0; /* 防止按钮被压缩 */
}

.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);
}

/* =============== 进度条和时间显示 =============== */
.progress-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.progress-row .progress-section {
    flex: 8;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-row .time-display {
    flex: 2;
    display: flex;
    justify-content: center;
    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: 8px 12px;
    border-radius: 6px;
    min-width: 90px;
}

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

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

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

.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%);
    }
}

/* =============== 播放按钮 =============== */
.play-row {
    display: flex;
    justify-content: center;
}

.play-btn {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(39, 174, 96, 0.3);
    min-width: 120px;
    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-text {
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

/* 隐藏播放器状态显示 */
.player-status {
    display: none;
}

/* =============== 响应式设计 =============== */

/* 平板断点 - 768px */
@media (max-width: 768px) {
    .player-section {
        padding: 16px;
    }
    
    /* 速度控制垂直布局 - 标签和按钮分开两行 */
    .speed-row {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .speed-row .speed-label {
        text-align: center;
        margin-right: 0;
    }
    
    .speed-row .speed-options {
        justify-content: center;
        gap: 6px;
        flex-wrap: nowrap; /* 保持一行 */
        overflow-x: auto; /* 如果空间不够允许滚动 */
    }
    
    .speed-radio {
        padding: 8px 10px;
        font-size: 13px;
        min-width: 48px;
    }
    
    /* 进度条垂直布局 */
    .progress-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .progress-row .progress-section {
        flex: none;
        width: 100%;
    }
    
    .progress-row .time-display {
        flex: none;
        width: 100%;
        justify-content: center;
    }
    
    /* 播放按钮全宽 */
    .play-btn {
        width: 100%;
        padding: 16px 24px;
        font-size: 16px;
    }
}

/* 小屏幕断点 - 480px */
@media (max-width: 480px) {
    .player-section {
        padding: 16px;
        margin: 20px 0;
    }
    
    .player-row {
        margin-bottom: 14px;
    }
    
    /* 速度按钮继续保持一行 */
    .speed-row .speed-options {
        gap: 4px;
        flex-wrap: nowrap;
        justify-content: center;
        max-width: 320px;
        margin: 0 auto;
    }
    
    .speed-radio {
        padding: 6px 8px;
        font-size: 11px;
        min-width: 40px;
    }
    
    .progress-bar {
        height: 10px;
    }
    
    .progress-bar:hover {
        height: 12px;
    }
    
    .progress-row .time-display {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .play-btn {
        padding: 14px 20px;
        font-size: 15px;
    }
}

/* 超小屏幕 - 360px */
@media (max-width: 360px) {
    .speed-row .speed-options {
        gap: 3px;
    }
    
    .speed-radio {
        padding: 5px 6px;
        font-size: 10px;
        min-width: 35px;
    }
    
    .play-btn {
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* 横屏模式优化 */
@media (max-height: 600px) and (orientation: landscape) {
    .player-section {
        padding: 12px 16px;
        margin: 12px 0;
    }
    
    .player-row {
        margin-bottom: 10px;
    }
}

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

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

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .speed-radio {
        min-height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .play-btn {
        min-height: 48px;
    }
    
    .progress-bar {
        min-height: 12px;
    }
}