@charset "UTF-8";

/* ==========================================================================
   全体コンテナ・基本リセット
   ========================================================================== */
#pokemon-search-app {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
    box-sizing: border-box;
    line-height: 1.5;
}

#pokemon-search-app *,
#pokemon-search-app *::before,
#pokemon-search-app *::after {
    box-sizing: border-box !important;
    margin: 0;
    padding: 0;
}

/* ==========================================================================
   検索フォーム（レイアウト再構築）
   ========================================================================== */
#pokemon-search-app .pokemon-search-form {
    display: flex !important;
    flex-direction: column !important; /* 縦並びベースに変更 */
    gap: 12px !important;
    margin-bottom: 28px !important;
    padding: 20px !important;
    background: #ffffff !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05) !important;
}

/* --- 上段：メインキーワード入力欄 --- */
#pokemon-search-app .pokemon-search-form input[type="text"] {
    width: 100% !important;
    height: 48px !important; /* 高さを出してみやすく */
    padding: 10px 16px 10px 42px !important; /* 左側にアイコン用の余白 */
    border: 2px solid #cbd5e1 !important;
    border-radius: 8px !important;
    font-size: 16px !important; /* スマホで勝手にズームされない16px */
    color: #0f172a !important;
    background-color: #f8fafc !important;
    /* 検索アイコン（🔍）を背景画像として挿入 */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2094a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3ccircle cx='11' cy='11' r='8'%3e%3c/circle%3e%3cline x1='21' y1='21' x2='16.65' y2='16.65'%3e%3c/line%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: left 12px center !important;
    background-size: 20px !important;
    transition: all 0.2s ease !important;
    outline: none !important;
}

/* 入力欄フォーカス時（目立たせる） */
#pokemon-search-app .pokemon-search-form input[type="text"]:focus {
    border-color: #2563eb !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15) !important;
}

#pokemon-search-app .pokemon-search-form input[type="text"]::placeholder {
    color: #64748b !important;
}

/* --- 下段：フィルター（ドロップダウン）エリア --- */
/* セレクトボックスを横並びにするラッパー的挙動 */
#pokemon-search-app .pokemon-search-form select {
    height: 40px !important;
    padding: 8px 32px 8px 12px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    color: #475569 !important;
    background-color: #f1f5f9 !important;
    cursor: pointer !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%20475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 14px !important;
    transition: border-color 0.2s ease !important;
    outline: none !important;
}

#pokemon-search-app .pokemon-search-form select:focus {
    border-color: #2563eb !important;
    background-color: #ffffff !important;
}

/* PC等広い画面ではセレクトボックスを2つ並べる */
@media (min-width: 641px) {
    #pokemon-search-app .pokemon-search-form {
        /* CSS Gridで「上が入力欄(全幅)」「下がドロップダウン2つ」のレイアウトを作る */
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
    }
    
    #pokemon-search-app .pokemon-search-form input[type="text"] {
        grid-column: 1 / -1 !important; /* 上段いっぱいに広げる */
    }
}

/* ==========================================================================
   カードグリッドレイアウト
   ========================================================================== */
#pokemon-search-app .pokemon-card-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 20px !important;
    min-height: 240px !important;
}

/* ==========================================================================
   個別カード
   ========================================================================== */
#pokemon-search-app .pokemon-card {
    background: #fcfcfd !important;
    border-radius: 8px !important;
    border: 1px solid #d1d5db !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: none !important;
}

/* サムネイルエリア */
#pokemon-search-app .card-thumbnail-wrapper {
    position: relative !important;
    padding-top: 56.25% !important; /* 16:9 Ratio */
    background: #e2e8f0 !important;
    border-bottom: 1px solid #e5e7eb !important;
}

#pokemon-search-app .card-thumbnail {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    margin: 0 !important;
}

/* カードコンテンツ */
#pokemon-search-app .card-content {
    padding: 16px !important;
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1 !important;
}

/* タグ表示 */
#pokemon-search-app .card-tags {
    display: flex !important;
    gap: 6px !important;
    align-items: center !important;
    font-size: 12px !important;
    font-weight: bold !important;
    color: #475569 !important;
    margin-bottom: 8px !important;
}

/* タイトル */
#pokemon-search-app .card-title {
    font-size: 15px !important;
    font-weight: bold !important;
    margin: 0 0 14px 0 !important;
    line-height: 1.4 !important;
    flex-grow: 1 !important;
    border: none !important;
    background: transparent !important;
}

#pokemon-search-app .card-title a {
    color: #1e293b !important;
    text-decoration: none !important;
    border: none !important;
}

#pokemon-search-app .card-title a:hover {
    text-decoration: underline !important;
    color: #1d4ed8 !important;
}

/* アクションボタンエリア */
#pokemon-search-app .card-actions {
    display: flex !important;
    gap: 8px !important;
    margin-top: auto !important;
    padding-top: 12px !important;
    border-top: 1px solid #e5e7eb !important;
}

#pokemon-search-app .btn {
    flex: 1 !important;
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 8px 0 !important;
    font-size: 13px !important;
    font-weight: bold !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    text-align: center !important;
    box-shadow: none !important;
}

/* 記事ボタン */
#pokemon-search-app .btn-article {
    background-color: #ffffff !important;
    color: #1d4ed8 !important;
    border: 1px solid #1d4ed8 !important;
}

/* YouTube動画ボタン */
#pokemon-search-app .btn-video {
    background-color: #ff0000 !important;
    color: #ffffff !important;
    border: 1px solid #cc0000 !important;
}

#pokemon-search-app .btn-video::before {
    content: "▶" !important;
    font-size: 11px !important;
    margin-right: 5px !important;
    display: inline-block !important;
}

/* ==========================================================================
   ローディング＆メッセージ
   ========================================================================== */
#pokemon-search-app .search-loading, 
#pokemon-search-app .search-no-results, 
#pokemon-search-app .search-error {
    grid-column: 1 / -1 !important;
    text-align: center !important;
    padding: 40px 20px !important;
    color: #475569 !important;
    font-size: 14px !important;
    font-weight: bold !important;
    background: #f8fafc !important;
    border-radius: 8px !important;
    border: 1px solid #cbd5e1 !important;
}

/* ==========================================================================
   ページネーションUI
   ========================================================================== */
#pokemon-search-app .pokemon-pagination {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 6px !important;
    margin-top: 32px !important;
    flex-wrap: wrap !important;
}

#pokemon-search-app .pokemon-pagination .page-btn {
    background-color: #ffffff !important;
    border: 1px solid #94a3b8 !important;
    color: #334155 !important;
    padding: 6px 14px !important;
    font-size: 13px !important;
    font-weight: bold !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    outline: none !important;
}

#pokemon-search-app .pokemon-pagination .page-btn.active {
    background-color: #1e293b !important;
    color: #ffffff !important;
    border-color: #1e293b !important;
    cursor: default !important;
}

/* ==========================================================================
   スマホ表示調整
   ========================================================================== */
@media (max-width: 640px) {
    #pokemon-search-app .pokemon-search-form {
        padding: 12px !important;
        gap: 10px !important;
    }
    #pokemon-search-app .pokemon-card-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
}