/**
 * AI記事 音声プレーヤー CSS
 * ブログと同じUIを提供
 */

/* ===== メインプレーヤー ===== */
.audio-player-section {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0 24px 0;
}

.audio-player-controls {
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
}

.audio-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.audio-btn {
    background: #4a90d9;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.audio-btn:hover {
    background: #3a7bc8;
}

.play-btn {
    width: 50px;
    font-size: 16px;
}

/* ===== プログレスバー ===== */
.audio-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 200px;
}

.progress-slider {
    flex: 1;
    height: 8px;
    cursor: pointer;
    min-width: 150px;
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    border-radius: 4px;
}

.progress-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #4a90d9;
    border-radius: 50%;
    cursor: pointer;
}

.progress-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #4a90d9;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* ===== 速度ボタン ===== */
.audio-speed {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.speed-btn {
    background: #e0e0e0;
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.speed-btn:hover {
    background: #d0d0d0;
}

.speed-btn.active {
    background: #4a90d9;
    color: white;
}

/* ===== ミニプレーヤー（スクロール時表示） ===== */
.audio-mini-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: linear-gradient(135deg, #4a90d9 0%, #357abd 100%);
    border-radius: 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    padding: 8px 12px;
    z-index: 9998;
    display: none;
    align-items: center;
    gap: 10px;
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.audio-mini-player.visible {
    display: flex;
    transform: translateY(0);
    opacity: 1;
}

.audio-mini-player.hiding {
    display: flex;
    transform: translateY(100px);
    opacity: 0;
}

.mini-play-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.mini-play-btn:hover {
    background: rgba(255,255,255,0.35);
}

.mini-progress-bar {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
    cursor: pointer;
}

.mini-progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
}

.mini-progress-bar::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.mini-close-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
    flex-shrink: 0;
}

.mini-close-btn:hover {
    color: white;
}

/* ===== モバイル対応 ===== */
@media (max-width: 600px) {
    .audio-player-section {
        padding: 10px;
        max-width: 100%;
        overflow: hidden;
        box-sizing: border-box;
    }
    
    .audio-player-controls {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    /* 1行目：再生ボタン + プログレスバー */
    .audio-buttons {
        order: 1;
        flex: 0 0 auto;
    }
    
    .audio-progress {
        order: 2;
        flex: 1;
        display: flex;
        align-items: center;
        gap: 4px;
        min-width: 0;
    }
    
    .progress-slider {
        flex: 1;
        min-width: 0;
    }
    
    #currentTime, #duration {
        font-size: 11px;
        min-width: 28px;
    }
    
    /* 2行目：倍速ボタン */
    .audio-speed {
        order: 3;
        flex: 0 0 100%;
        display: flex;
        justify-content: center;
        gap: 4px;
        margin-top: 4px;
    }
    
    .play-btn {
        width: 28px;
        height: 28px;
        font-size: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
    }
    
    .speed-btn {
        padding: 4px 6px;
        font-size: 11px;
    }
}

/* ===== 印刷時は非表示 ===== */
@media print {
    .audio-player-section,
    .audio-mini-player {
        display: none !important;
    }
}
