/* 04-legacy-parts.css — 旧ページの入力小窓・プレイリスト・モバイル調整
 *
 * style.css を分けたもの。元は1本の7,600行だった。
 * ⚠️ 読み込む順番を変えないこと。番号の順に重ねることで、
 *    分ける前とまったく同じ見た目になる。あとの番号が勝つ。
 * ⚠️ 新しい指定をここの先頭に足さないこと。
 *    打ち消し合っている指定があるので、置き場所で結果が変わる。
 */
/* ==============================
   Custom Prompt Modal
   ============================== */
.custom-prompt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.custom-prompt-box {
    width: 90%;
    max-width: 360px;
    padding: 24px;
}

.custom-prompt-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 0.95rem;
    outline: none;
    box-sizing: border-box;
}

.custom-prompt-input:focus {
    border-color: var(--main-accent);
}

/* ==============================
   Playlist Styles
   ============================== */

.playlist-popover {
    background: var(--card-bg, rgba(26, 28, 35, 0.95));
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    min-width: 180px;
    max-width: 250px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: popoverFadeIn 0.15s ease;
}

@keyframes popoverFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

[data-theme="light"] .playlist-popover {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.playlist-popover-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--main-accent);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.playlist-popover-empty {
    font-size: 0.8rem;
    opacity: 0.5;
    margin-bottom: 8px;
}

.playlist-popover-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 0.8rem;
    cursor: pointer;
}

.playlist-popover-item:hover {
    color: var(--main-accent);
}

.playlist-popover-item input[type="checkbox"] {
    accent-color: var(--main-accent);
    cursor: pointer;
}

.playlist-popover-actions {
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
    padding-top: 8px;
}

.playlist-popover-new {
    background: none;
    border: none;
    color: var(--main-accent);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    padding: 2px 0;
}

.playlist-popover-new:hover {
    text-decoration: underline;
}

/* --- Playlist List Page --- */
.playlist-list-container {
    margin-top: 10px;
}

.playlist-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.playlist-list-card {
    padding: 20px;
}

.playlist-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.playlist-card-name {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}

.playlist-card-count {
    font-size: 0.85rem;
    color: var(--main-accent);
    font-weight: 700;
}

.playlist-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #e2e8f0 !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

[data-theme="light"] .secondary-btn {
    background: rgba(0, 0, 0, 0.05) !important;
    color: #475569 !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

/* ==============================
   モバイル最適化 追加スタイル
   ============================== */
@media (max-width: 768px) {
    /* 検索クリアボタンのタップエリア拡大 */
    #search-clear-btn {
        right: 8px;
        width: 36px;
        height: 36px;
        font-size: 1.8rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* プレイリストポップオーバーをモバイルで広く */
    .playlist-popover {
        min-width: 220px;
        max-width: 280px;
    }

    .playlist-popover-item {
        padding: 8px 0;
        min-height: 40px;
    }

    /* cyber-button のタップエリア確保 */
    .cyber-button.small {
        padding: 10px 16px;
        min-height: 40px;
        font-size: 0.85rem;
    }

    /* モーダル内のボタンも大きく */
    .cyber-modal-overlay .cyber-button.small,
    .custom-prompt-overlay .cyber-button.small {
        padding: 12px 18px;
        min-height: 44px;
    }

    /* テーマ切り替えボタンのタップエリア */
    .theme-toggle {
        min-height: 36px;
        padding: 4px 12px;
    }

    /* フッター余白（FABバー分） */
    .page-footer {
        padding-bottom: 70px;
    }
}

/* --- NEW Badge --- */
.new-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 6px;
    vertical-align: middle;
    letter-spacing: 0.5px;
    line-height: 1.4;
    animation: newBadgePulse 2s ease-in-out infinite;
}

@keyframes newBadgePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

[data-theme="light"] .new-badge {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}
