/* ============================
   Dodo AI Music Player - Frontend CSS
   フローティングプレイヤー & ショートコード
   ============================ */

/* ---- リセット & 基本 ---- */
.dodo-aim-player,
.dodo-aim-player * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Noto Sans JP", sans-serif;
}

/* ---- プレイヤー配置 ---- */
.dodo-aim-player {
    position: fixed;
    z-index: 99999;
    transition: all 0.3s ease;
}

.dodo-aim-bottom-right { bottom: 20px; right: 20px; }
.dodo-aim-bottom-left  { bottom: 20px; left: 20px; }
.dodo-aim-top-right    { top: 20px; right: 20px; }
.dodo-aim-top-left     { top: 20px; left: 20px; }

/* ---- ポップアップ ---- */
.dodo-aim-popup {
    position: absolute;
    bottom: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    animation: dodoAimFadeIn 0.3s ease;
}

.dodo-aim-bottom-left .dodo-aim-popup,
.dodo-aim-top-left .dodo-aim-popup {
    right: auto;
    left: 0;
}

.dodo-aim-top-right .dodo-aim-popup,
.dodo-aim-top-left .dodo-aim-popup {
    bottom: auto;
    top: calc(100% + 10px);
}

.dodo-aim-popup-content {
    padding: 16px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.dodo-aim-popup-icon {
    font-size: 24px;
    display: block;
    margin-bottom: 6px;
}

.dodo-aim-popup-text {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.dodo-aim-popup-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.dodo-aim-btn-yes,
.dodo-aim-btn-no {
    border: none;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dodo-aim-btn-yes:hover { transform: scale(1.05); }
.dodo-aim-btn-no:hover  { opacity: 0.8; }

/* ---- ミニトグル ---- */
.dodo-aim-mini-toggle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.dodo-aim-mini-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}

.dodo-aim-mini-icon {
    font-size: 22px;
    z-index: 2;
    position: relative;
}

.dodo-aim-mini-visualizer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    z-index: 1;
    opacity: 0.5;
}

/* ---- 展開プレイヤー ---- */
.dodo-aim-expanded {
    width: 300px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
    animation: dodoAimSlideUp 0.3s ease;
}

/* ヘッダー */
.dodo-aim-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 8px;
}

.dodo-aim-track-info {
    flex: 1;
    min-width: 0;
}

.dodo-aim-track-title {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dodo-aim-track-number {
    font-size: 11px;
    opacity: 0.6;
    margin-top: 2px;
}

.dodo-aim-collapse-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.6;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.dodo-aim-collapse-btn:hover {
    opacity: 1;
}

/* ビジュアライザー */
.dodo-aim-visualizer-wrap {
    padding: 0 16px;
    margin-bottom: 8px;
}

.dodo-aim-visualizer {
    width: 100%;
    height: 60px;
    border-radius: 8px;
    display: block;
}

/* プログレスバー */
.dodo-aim-progress-wrap {
    padding: 0 16px;
    margin-bottom: 4px;
}

.dodo-aim-progress {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    transition: height 0.2s ease;
}

.dodo-aim-progress:hover {
    height: 10px;
}

.dodo-aim-progress-bar {
    height: 100%;
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
    position: relative;
}

.dodo-aim-progress-handle {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    left: 0%;
    opacity: 0;
    transition: opacity 0.2s ease;
    cursor: grab;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.dodo-aim-progress:hover .dodo-aim-progress-handle {
    opacity: 1;
}

.dodo-aim-time {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    opacity: 0.5;
    margin-top: 4px;
    padding: 0 2px;
}

/* コントロール */
.dodo-aim-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 16px;
}

.dodo-aim-ctrl-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    opacity: 0.7;
    line-height: 1;
}

.dodo-aim-ctrl-btn:hover {
    opacity: 1;
}

.dodo-aim-ctrl-btn.active {
    opacity: 1;
}

.dodo-aim-play-btn {
    font-size: 24px !important;
    opacity: 1 !important;
    padding: 8px 12px;
}

/* 音量 */
.dodo-aim-volume-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 16px 14px;
}

.dodo-aim-volume-wrap .dodo-aim-ctrl-btn {
    font-size: 16px;
    padding: 4px;
}

.dodo-aim-volume-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.dodo-aim-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* ===== テーマ: ダーク ===== */
.dodo-aim-theme-dark .dodo-aim-popup-content {
    background: #1a1a2e;
    color: #eee;
}

.dodo-aim-theme-dark .dodo-aim-btn-yes {
    background: #6c63ff;
    color: #fff;
}

.dodo-aim-theme-dark .dodo-aim-btn-no {
    background: #333;
    color: #aaa;
}

.dodo-aim-theme-dark .dodo-aim-mini-toggle {
    background: #1a1a2e;
}

.dodo-aim-theme-dark .dodo-aim-expanded {
    background: #1a1a2e;
    color: #eee;
}

.dodo-aim-theme-dark .dodo-aim-collapse-btn {
    color: #eee;
}

.dodo-aim-theme-dark .dodo-aim-visualizer {
    background: rgba(255, 255, 255, 0.05);
}

.dodo-aim-theme-dark .dodo-aim-progress {
    background: #333;
}

.dodo-aim-theme-dark .dodo-aim-progress-bar {
    background: linear-gradient(90deg, #6c63ff, #a855f7);
}

.dodo-aim-theme-dark .dodo-aim-progress-handle {
    background: #fff;
}

.dodo-aim-theme-dark .dodo-aim-ctrl-btn {
    color: #eee;
}

.dodo-aim-theme-dark .dodo-aim-ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dodo-aim-theme-dark .dodo-aim-volume-slider {
    background: #333;
}

.dodo-aim-theme-dark .dodo-aim-volume-slider::-webkit-slider-thumb {
    background: #6c63ff;
}

/* ===== テーマ: ライト ===== */
.dodo-aim-theme-light .dodo-aim-popup-content {
    background: #fff;
    color: #333;
    border: 1px solid #e0e0e0;
}

.dodo-aim-theme-light .dodo-aim-btn-yes {
    background: #4f46e5;
    color: #fff;
}

.dodo-aim-theme-light .dodo-aim-btn-no {
    background: #f0f0f0;
    color: #666;
}

.dodo-aim-theme-light .dodo-aim-mini-toggle {
    background: #fff;
    border: 1px solid #e0e0e0;
}

.dodo-aim-theme-light .dodo-aim-expanded {
    background: #fff;
    color: #333;
    border: 1px solid #e0e0e0;
}

.dodo-aim-theme-light .dodo-aim-collapse-btn {
    color: #333;
}

.dodo-aim-theme-light .dodo-aim-visualizer {
    background: #f5f5f5;
}

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

.dodo-aim-theme-light .dodo-aim-progress-bar {
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
}

.dodo-aim-theme-light .dodo-aim-progress-handle {
    background: #4f46e5;
}

.dodo-aim-theme-light .dodo-aim-ctrl-btn {
    color: #333;
}

.dodo-aim-theme-light .dodo-aim-ctrl-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.dodo-aim-theme-light .dodo-aim-volume-slider {
    background: #e0e0e0;
}

.dodo-aim-theme-light .dodo-aim-volume-slider::-webkit-slider-thumb {
    background: #4f46e5;
}

/* ===== テーマ: ネオン ===== */
.dodo-aim-theme-neon .dodo-aim-popup-content {
    background: #0a0a0a;
    color: #0ff;
    border: 1px solid #0ff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
}

.dodo-aim-theme-neon .dodo-aim-btn-yes {
    background: #0ff;
    color: #000;
}

.dodo-aim-theme-neon .dodo-aim-btn-no {
    background: #222;
    color: #0ff;
    border: 1px solid #0ff;
}

.dodo-aim-theme-neon .dodo-aim-mini-toggle {
    background: #0a0a0a;
    border: 2px solid #0ff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.dodo-aim-theme-neon .dodo-aim-expanded {
    background: #0a0a0a;
    color: #0ff;
    border: 1px solid #0ff;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.15);
}

.dodo-aim-theme-neon .dodo-aim-collapse-btn { color: #0ff; }

.dodo-aim-theme-neon .dodo-aim-visualizer {
    background: rgba(0, 255, 255, 0.05);
}

.dodo-aim-theme-neon .dodo-aim-progress {
    background: #222;
}

.dodo-aim-theme-neon .dodo-aim-progress-bar {
    background: linear-gradient(90deg, #0ff, #f0f);
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.5);
}

.dodo-aim-theme-neon .dodo-aim-progress-handle {
    background: #0ff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

.dodo-aim-theme-neon .dodo-aim-ctrl-btn { color: #0ff; }
.dodo-aim-theme-neon .dodo-aim-ctrl-btn:hover { background: rgba(0, 255, 255, 0.1); }
.dodo-aim-theme-neon .dodo-aim-volume-slider { background: #222; }
.dodo-aim-theme-neon .dodo-aim-volume-slider::-webkit-slider-thumb {
    background: #0ff;
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.8);
}

/* ===== テーマ: グラス ===== */
.dodo-aim-theme-glass .dodo-aim-popup-content {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dodo-aim-theme-glass .dodo-aim-btn-yes {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    backdrop-filter: blur(10px);
}

.dodo-aim-theme-glass .dodo-aim-btn-no {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

.dodo-aim-theme-glass .dodo-aim-mini-toggle {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dodo-aim-theme-glass .dodo-aim-expanded {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dodo-aim-theme-glass .dodo-aim-collapse-btn { color: #fff; }
.dodo-aim-theme-glass .dodo-aim-visualizer { background: rgba(255, 255, 255, 0.05); }
.dodo-aim-theme-glass .dodo-aim-progress { background: rgba(255, 255, 255, 0.15); }
.dodo-aim-theme-glass .dodo-aim-progress-bar { background: rgba(255, 255, 255, 0.5); }
.dodo-aim-theme-glass .dodo-aim-progress-handle { background: #fff; }
.dodo-aim-theme-glass .dodo-aim-ctrl-btn { color: #fff; }
.dodo-aim-theme-glass .dodo-aim-ctrl-btn:hover { background: rgba(255, 255, 255, 0.1); }
.dodo-aim-theme-glass .dodo-aim-volume-slider { background: rgba(255, 255, 255, 0.15); }
.dodo-aim-theme-glass .dodo-aim-volume-slider::-webkit-slider-thumb { background: #fff; }


/* ===== インラインプレイヤー (ショートコード) ===== */
.dodo-aim-inline {
    border-radius: 10px;
    padding: 10px 14px;
    margin: 16px 0;
    display: inline-block;
    max-width: 400px;
    width: 100%;
}

.dodo-aim-inline-inner {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dodo-aim-inline-icon { font-size: 18px; }

.dodo-aim-inline-title {
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.dodo-aim-inline-play {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.2s;
}

.dodo-aim-inline-progress {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
    min-width: 60px;
}

.dodo-aim-inline-progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: width 0.1s linear;
}

.dodo-aim-inline-time {
    font-size: 11px;
    opacity: 0.6;
    flex-shrink: 0;
}

.dodo-aim-theme-dark .dodo-aim-inline { background: #1a1a2e; color: #eee; }
.dodo-aim-theme-dark .dodo-aim-inline-play { color: #eee; }
.dodo-aim-theme-dark .dodo-aim-inline-progress { background: #333; }
.dodo-aim-theme-dark .dodo-aim-inline-progress-bar { background: #6c63ff; }

.dodo-aim-theme-light .dodo-aim-inline { background: #f5f5f5; color: #333; border: 1px solid #e0e0e0; }
.dodo-aim-theme-light .dodo-aim-inline-play { color: #333; }
.dodo-aim-theme-light .dodo-aim-inline-progress { background: #ddd; }
.dodo-aim-theme-light .dodo-aim-inline-progress-bar { background: #4f46e5; }


/* ===== プレイリスト埋め込み ===== */
.dodo-aim-playlist-embed {
    border-radius: 12px;
    padding: 16px;
    margin: 16px 0;
    max-width: 500px;
}

.dodo-aim-playlist-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 15px;
    font-weight: 700;
}

.dodo-aim-playlist-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dodo-aim-playlist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.dodo-aim-playlist-num {
    font-size: 12px;
    opacity: 0.5;
    width: 20px;
    text-align: center;
}

.dodo-aim-playlist-name {
    flex: 1;
    font-size: 13px;
}

.dodo-aim-playlist-play-btn {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.dodo-aim-playlist-play-btn:hover { opacity: 1; }

.dodo-aim-theme-dark .dodo-aim-playlist-embed { background: #1a1a2e; color: #eee; }
.dodo-aim-theme-dark .dodo-aim-playlist-item:hover { background: rgba(255,255,255,0.05); }
.dodo-aim-theme-dark .dodo-aim-playlist-play-btn { color: #eee; }

.dodo-aim-theme-light .dodo-aim-playlist-embed { background: #f5f5f5; color: #333; border: 1px solid #e0e0e0; }
.dodo-aim-theme-light .dodo-aim-playlist-item:hover { background: rgba(0,0,0,0.03); }
.dodo-aim-theme-light .dodo-aim-playlist-play-btn { color: #333; }


/* ===== アニメーション ===== */
@keyframes dodoAimFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes dodoAimSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes dodoAimPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.05); }
}

.dodo-aim-playing .dodo-aim-mini-icon {
    animation: dodoAimPulse 1.5s ease-in-out infinite;
}


/* ===== レスポンシブ ===== */
@media (max-width: 480px) {
    .dodo-aim-expanded {
        width: calc(100vw - 40px);
        max-width: 300px;
    }

    .dodo-aim-bottom-right,
    .dodo-aim-bottom-left {
        bottom: 10px;
    }

    .dodo-aim-bottom-right { right: 10px; }
    .dodo-aim-bottom-left  { left: 10px; }
}

/* モバイル非表示設定 */
.dodo-aim-hide-mobile {
    display: none !important;
}
