/* premium_audio.css - Common Premium Audio Player Styles */

.audio-theater-container {
    position: relative;
    width: 100%;
    margin: 0; 
    border-radius: 8px;
    background: #000;
    padding: 0;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.audio-frame {
    position: relative;
    width: 100%;
    padding-top: 100%; /* Default square ratio */
    border-radius: 12px;
    overflow: hidden;
}

.audio-frame video {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover;
}

/* Stealth UI Overlay */
.audio-ui-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: background 0.4s;
}

.audio-theater-container:hover .audio-ui-overlay {
    background: rgba(0, 0, 0, 0.1);
}

.audio-play-trigger-stealth {
    width: 50px; height: 50px;
    border-radius: 50%;
    background: rgba(30, 30, 30, 0.5); /* Perfect middle ground */
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s ease;
    opacity: 0.75; /* Balanced opacity */
}

.audio-theater-container:hover .audio-play-trigger-stealth {
    opacity: 1;
    background: rgba(40, 40, 40, 0.6);
    transform: scale(1.05);
}

.audio-theater-container.is-playing .audio-ui-overlay {
    opacity: 0;
    pointer-events: none;
}

/* Modern Controls Bar Layout */
.audio-controls-bar {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    min-height: 44px;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.2) 80%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 5px 0 0 0;
    z-index: 10;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(100%);
}

.audio-controls-bar .time-row {
    padding: 0 12px;
    margin-bottom: -2px; /* Pull buttons closer */
}

.audio-controls-bar .controls-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    margin-bottom: 2px;
}

/* Visibility Logic */
.audio-theater-container:hover .audio-controls-bar,
.audio-theater-container.cinema-active .audio-controls-bar,
.audio-theater-container.is-playing .audio-controls-bar {
    transform: translateY(0);
}

.ctrl-btn {
    background: none; border: none; color: white;
    font-size: 0.95rem;
    cursor: pointer; opacity: 0.8;
    transition: all 0.2s;
    padding: 4px;
    display: flex; align-items: center; justify-content: center;
}

.ctrl-btn:hover { opacity: 1; transform: scale(1.1); }

.audio-time {
    color: white;
    font-size: 0.75rem;
    font-family: 'Outfit', sans-serif;
    white-space: nowrap;
    opacity: 0.9;
    margin-left: 4px;
}

.ctrl-right { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
}

.volume-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.volume-slider-pop {
    position: absolute;
    bottom: 50px; /* Above the icon */
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 8px;
    border-radius: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.volume-wrap.active-slider .volume-slider-pop {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 60px; /* Width in vertical mode is actually height because of rotate */
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    transform: rotate(-90deg); /* Make it vertical */
    margin: 30px 0; /* Compensation for rotation */
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

@media (max-width: 768px) {
    .volume-slider-pop {
        bottom: 60px;
        padding: 20px 10px;
    }
    .volume-slider { width: 80px; }
}

/* Full Width Progress Bar */
.audio-progress-area {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    position: relative;
    transition: height 0.2s;
}

.audio-progress-area:hover {
    height: 6px;
}

.audio-progress-line {
    height: 100%;
    background: #fff;
    width: 0%;
    position: relative;
}

.audio-progress-line::after {
    content: "";
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    transition: transform 0.2s;
}

.audio-progress-area:hover .audio-progress-line::after {
    transform: translateY(-50%) scale(1);
}

/* ============================================================
   Cinema Mode (Theater Mode) - 共通クラス
   【重要】: このクラスは音楽プレイヤーとまとめ動画の両方で使用。
   ここへの変更は両プレイヤーに影響するため、慎重に。
   ============================================================ */
.cinema-active {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 85vh !important;
    max-width: 90vw !important;
    height: auto !important;
    z-index: 10001 !important;
    padding: 0 !important;
    border-radius: 12px !important;
    background: #000 !important;
    box-shadow: 0 30px 100px rgba(0,0,0,0.8) !important;
    overflow: hidden;
}

.cinema-active .audio-frame {
    padding-top: 100% !important;
}

.cinema-mode {
    overflow: hidden !important;
}

/* ============================================================
   サイドバー音楽プレイヤー専用のシアターモード追加スタイル
   【安全】: .audio-theater-container を絞り込んでいるため
             まとめ動画（.video-theater-container）には影響しない。
   ============================================================ */
.audio-theater-container.cinema-active {
    /* transition:all によるアニメーションのズレを防ぐ（JSでも設定済み） */
    transition: none !important;
}

.cinema-backdrop {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10000;
    animation: fadeInBackdrop 0.4s forwards;
}

@keyframes fadeInBackdrop { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 768px) {
    /* 共通: スマホ時の幅調整 */
    .cinema-active { width: 95vw !important; }

    /* ============================================================
       以下はすべて音楽プレイヤー専用クラスのため、
       まとめ動画プレイヤーへの影響はゼロ
       ============================================================ */

    /* コントロールバーを広くしてタップしやすく */
    .audio-controls-bar {
        min-height: 64px; /* More height */
        padding-top: 10px;
    }

    .audio-controls-bar .controls-row {
        gap: 16px; /* More space between buttons */
        padding: 0 20px;
        margin-bottom: 6px;
    }

    /* ボタンのタップ範囲を強力に拡大 */
    .ctrl-btn {
        padding: 12px;
        font-size: 1.4rem; /* Significantly larger */
    }

    /* 時間表示を読みやすく */
    .audio-time {
        font-size: 0.95rem;
        margin-left: 2px;
    }

    /* プログレスバーを太くして操作しやすく */
    .audio-progress-area {
        height: 8px; /* Thicker bar */
    }

    .audio-progress-line::after {
        transform: translateY(-50%) scale(1.2); /* Larger seek handle */
        width: 18px;
        height: 18px;
    }

    /* 中央の再生ボタンをさらに大きく */
    .audio-play-trigger-stealth {
        width: 80px;
        height: 80px;
        font-size: 1.8rem;
    }
}

