/**
 * search-player.css
 * SearchPlayer.php用スタイル
 *
 * 含まれるコンポーネント:
 * - SearchPlayer固有スタイル（ページタイトル、セクション等）
 * - カテゴリ別検索スタイル（地域チップ、リンクカード等）
 * - CSS日本地図（japan_responsive_map）
 * - 検索フォームドロップダウン（SearchForm）
 *
 * 移行元:
 * - app/templates/SearchPlayer.tpl（インラインスタイル）
 * - app/templates/include/SearchTop.inc.tpl（インラインスタイル）
 * - app/templates/include/SearchForm.inc.tpl（インラインスタイル）
 *
 * 作成日: 2026-02-02
 */

/* ===================================================================
   SearchPlayer固有スタイル
   =================================================================== */

/* ページタイトル（デザインガイドライン準拠） */
.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary-800, #243b53);
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--color-primary-800, #243b53);
}

/* セクション共通スタイル（デザインガイドライン準拠） */
.search-section {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* .section-title → variables.css に統一済み */

/* 学校別検索フォーム */
.search-form-section {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.search-form-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-primary-800, #243b53);
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-primary-800, #243b53);
}

/* 検索結果セクション */
.search-result-section {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.search-result-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-primary-800, #243b53);
    margin: 0 0 16px 0;
}

/* カテゴリ別検索メニュー */
.search-categories {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.search-categories h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-primary-800, #243b53);
    margin: 0 0 24px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--color-primary-800, #243b53);
}

/* 選手登録ボタン（デザインガイドライン準拠 - btn-success） */
.register-link {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
    transition: all 0.2s;
}

.register-link:hover {
    background: linear-gradient(135deg, #047857, #059669);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(5, 150, 105, 0.4);
}

/* ===================================================================
   SearchTop カテゴリ別検索スタイル
   =================================================================== */

/* セクション共通 */
.search-category-section {
    margin-bottom: 28px;
    margin-top: 22px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.search-category-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.search-category-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-primary-800, #243b53);
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-category-title::before {
    content: "◆";
    color: var(--color-primary-700, #334e68);
}

/* 地域リンク（横並び） */
.region-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.region-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 16px;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.region-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.region-chip .color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

/* 地域別カラー */
.region-chip.hokkaido { background: #8888ff20; color: #4444cc; }
.region-chip.hokkaido .color-dot { background: #8888ff; }
.region-chip.tohoku { background: #99ddff20; color: #3399cc; }
.region-chip.tohoku .color-dot { background: #99ddff; }
.region-chip.kanto { background: #ff99ff20; color: #cc44cc; }
.region-chip.kanto .color-dot { background: #ff99ff; }
.region-chip.hokushinetsu { background: #ccf57720; color: #669933; }
.region-chip.hokushinetsu .color-dot { background: #ccf577; }
.region-chip.tokai { background: #ff888820; color: #cc4444; }
.region-chip.tokai .color-dot { background: #ff8888; }
.region-chip.kinki { background: #ffcc8820; color: #cc7733; }
.region-chip.kinki .color-dot { background: #ffcc88; }
.region-chip.chugoku { background: #80f58020; color: #339933; }
.region-chip.chugoku .color-dot { background: #80f580; }
.region-chip.shikoku { background: #ddbb9920; color: #996633; }
.region-chip.shikoku .color-dot { background: #ddbb99; }
.region-chip.kyushu { background: #f5e57720; color: #999933; }
.region-chip.kyushu .color-dot { background: #f5e577; }
.region-chip.other { background: #88888820; color: #666666; }
.region-chip.other .color-dot { background: #888888; }

/* ===================================================================
   CSS日本地図（japan_responsive_map）
   =================================================================== */

#japan-map {
    display: block;
    width: 777px;
    height: 482px;
    background-color: transparent;
    margin-left: auto;
    margin-right: auto;
    position: relative;
}

#japan-map p.area-title {
    display: none;
}

#japan-map div div.area {
    position: relative;
}

#japan-map div div.area div {
    border: 1px #ffffff solid;
    text-align: center;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    position: absolute;
    box-sizing: border-box;
    transition: 0.2s;
}

#japan-map div div.area div:hover {
    opacity: 0.7;
    transform: scale(1.02);
}

#japan-map a {
    text-decoration: none;
}

/* 北海道・東北（位置のみ） */
#hokkaido-touhoku {
    width: 136px;
    height: 265px;
    position: absolute;
    left: 638px;
}
#hokkaido { width: 133px; height: 70px; }
#aomori { width: 93px; height: 43px; left: 21px; top: 96px; }
#akita { width: 67px; height: 42px; left: 3px; top: 139px; }
#iwate { width: 67px; height: 42px; left: 70px; top: 139px; }
#yamagata { width: 67px; height: 42px; top: 181px; left: 3px; }
#miyagi { width: 67px; height: 42px; top: 181px; left: 70px; }
#fukushima { width: 67px; height: 42px; top: 223px; left: 70px; }

/* 関東（位置のみ） */
#kantou {
    width: 158px;
    height: 174px;
    position: absolute;
    top: 265px;
    left: 623px;
    z-index: 2;
}
#ibaraki { width: 52px; height: 85px; top: 0px; left: 100px; }
#tochigi { width: 50px; height: 42px; top: 0px; left: 50px; }
#gunma { width: 50px; height: 42px; top: 0px; left: 0px; }
#saitama { width: 100px; height: 43px; top: 42px; left: 0px; }
#chiba { width: 52px; height: 84px; top: 85px; left: 100px; }
#tokyo { width: 100px; height: 42px; top: 85px; left: 0px; }
#kanagawa { width: 100px; height: 42px; top: 127px; left: -20px; }

/* 中部（位置のみ） */
#tyubu {
    width: 270px;
    height: 211px;
    position: absolute;
    left: 438px;
    top: 223px;
}
#nigata { width: 85px; height: 42px; left: 185px; }
#toyama { width: 67px; height: 42px; left: 118px; }
#ishikawa { width: 50px; height: 57px; left: 68px; }
#fukui { width: 68px; height: 42px; left: 0px; z-index: 2; }
#nagano { width: 67px; height: 76px; left: 118px; top: 42px; }
#yamanashi { width: 67px; height: 50px; left: 118px; top: 119px; }
#gifu { width: 50px; height: 55px; left: 68px; top: 57px; }
#aichi { width: 50px; height: 57px; top: 112px; left: 68px; }
#shizuoka { width: 97px; height: 42px; left: 68px; top: 169px; }

/* 近畿（位置のみ） */
#kinki {
    width: 186px;
    height: 211px;
    position: absolute;
    left: 320px;
    top: 223px;
}
#kyoto { width: 67px; height: 84px; left: 51px; }
#shiga { width: 68px; height: 42px; top: 42px; left: 118px; }
#osaka { width: 67px; height: 85px; top: 84px; left: 51px; }
#nara { width: 34px; height: 85px; top: 84px; left: 118px; }
#mie { width: 34px; height: 85px; top: 84px; left: 152px; }
#wakayama { width: 113px; height: 42px; top: 169px; left: 61px; }
#hyougo { width: 51px; height: 98px; left: 0px; }

/* 中国（位置のみ） */
#tyugoku {
    width: 151px;
    height: 98px;
    position: absolute;
    left: 169px;
    top: 223px;
}
#tottori { width: 50px; height: 49px; left: 101px; }
#okayama { width: 50px; height: 49px; top: 49px; left: 101px; }
#shimane { width: 51px; height: 49px; left: 50px; }
#hiroshima { width: 51px; height: 49px; top: 49px; left: 50px; }
#yamaguchi { width: 50px; height: 98px; left: 0px; }

/* 四国（位置のみ） */
#shikoku {
    width: 184px;
    height: 84px;
    position: absolute;
    left: 169px;
    top: 350px;
}
#kagawa { width: 92px; height: 42px; right: 0px; }
#ehime { width: 92px; height: 42px; left: 0px; }
#tokushima { width: 92px; height: 42px; right: 0px; top: 42px; }
#kouchi { width: 92px; height: 42px; left: 0px; top: 42px; }

/* 九州・沖縄（位置のみ） */
#kyusyu {
    width: 152px;
    height: 247px;
    position: absolute;
    left: 0px;
    top: 235px;
}
#fukuoka { width: 50px; height: 50px; left: 101px; top: 0px; }
#saga { width: 50px; height: 50px; left: 51px; top: 0px; }
#nagasaki { width: 50px; height: 50px; left: 1px; top: 0px; }
#oita { width: 50px; height: 50px; left: 101px; top: 50px; }
#kumamoto { width: 50px; height: 100px; left: 51px; top: 50px; }
#miyazaki { width: 50px; height: 50px; left: 101px; top: 100px; }
#kagoshima { width: 68px; height: 49px; left: 83px; top: 150px; }
#okinawa { width: 50px; height: 50px; left: 1px; top: 197px; }

/* ===================================================================
   地域別カラー設定（チップと統一）
   =================================================================== */

/* 北海道: #8888ff（青） */
#hokkaido { background-color: #8888ff !important; color: #ffffff !important; }

/* 東北: #99ddff（水色） */
#aomori, #akita, #iwate, #yamagata, #miyagi, #fukushima {
    background-color: #99ddff !important; color: #333333 !important;
}

/* 関東: #ff99ff（ピンク）- 山梨を含む（WEB版地区分け） */
#ibaraki, #tochigi, #gunma, #saitama, #chiba, #tokyo, #kanagawa, #yamanashi {
    background-color: #ff99ff !important; color: #333333 !important;
}

/* 北信越: #ccf577（黄緑） */
#nigata, #toyama, #ishikawa, #fukui, #nagano {
    background-color: #ccf577 !important; color: #333333 !important;
}

/* 東海: #ff8888（赤） - 岐阜、静岡、愛知、三重（WEB版地区分け） */
#gifu, #shizuoka, #aichi, #mie {
    background-color: #ff8888 !important; color: #ffffff !important;
}

/* 近畿: #ffcc88（オレンジ） - 滋賀、京都、大阪、兵庫、奈良、和歌山（三重を除く、WEB版地区分け） */
#shiga, #kyoto, #osaka, #hyougo, #nara, #wakayama {
    background-color: #ffcc88 !important; color: #333333 !important;
}

/* 中国: #80f580（緑） */
#tottori, #okayama, #shimane, #hiroshima, #yamaguchi {
    background-color: #80f580 !important; color: #333333 !important;
}

/* 四国: #ddbb99（茶） */
#kagawa, #ehime, #tokushima, #kouchi {
    background-color: #ddbb99 !important; color: #333333 !important;
}

/* 九州: #f5e577（黄） */
#fukuoka, #saga, #nagasaki, #oita, #kumamoto, #miyazaki, #kagoshima, #okinawa {
    background-color: #f5e577 !important; color: #333333 !important;
}

/* ===================================================================
   カードグリッド・リンクカード
   =================================================================== */

.link-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.link-card {
    display: block;
    padding: 12px 8px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #374151;
    text-decoration: none;
    font-size: 0.9rem;
    text-align: center;
    transition: all 0.2s;
    border: 1px solid #e5e7eb;
}

.link-card:hover {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.2);
}

/* ===================================================================
   大学リーグ用（6カラムレイアウト）
   =================================================================== */

.university-league-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}

.university-region-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.university-region-column .university-region-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #6b7280;
    margin: 0 0 8px 0;
    padding-bottom: 6px;
    border-bottom: 1px dashed #e5e7eb;
}

.university-region-column .link-card {
    padding: 10px 6px;
    font-size: 0.85rem;
}

/* 大学リーグ用（地域別グループ - 旧スタイル） */
.university-region-group {
    margin-bottom: 20px;
}

.university-region-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #6b7280;
    margin: 0 0 10px 0;
    padding-bottom: 6px;
    border-bottom: 1px dashed #e5e7eb;
}

/* ===================================================================
   プロ野球用（2列）
   =================================================================== */

.pro-league-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.pro-league-column h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-primary-800, #243b53);
    margin: 0 0 12px 0;
}

/* ===================================================================
   ドラフト年度用
   =================================================================== */

.draft-year-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
}

.draft-year-link {
    display: block;
    padding: 8px 4px;
    background: #f8f9fa;
    border-radius: 6px;
    color: #374151;
    text-decoration: none;
    font-size: 0.85rem;
    text-align: center;
    transition: all 0.2s;
}

.draft-year-link:hover {
    background: #2563eb;
    color: #fff;
}

/* ===================================================================
   レスポンシブ対応
   =================================================================== */

/* 日本地図レスポンシブ */
@media screen and (max-width: 768px) {
    #japan-map {
        display: flex;
        width: 100%;
        flex-wrap: wrap;
        justify-content: space-around;
        height: auto;
    }
    #japan-map p.area-title {
        display: inline-block;
        width: 100%;
        font-size: 14px;
        font-weight: bold;
        text-align: center;
        margin-top: 1em;
        margin-bottom: 0.5em;
        color: #374151;
    }
    /* 旧ID（PC版デスクトップ地図用）+ 新ID（WEB版地区分け）対応 */
    #hokkaido-touhoku, #kantou, #tyubu, #kinki, #tyugoku, #shikoku, #kyusyu,
    #map-hokkaido, #map-tohoku, #map-kanto, #map-hokushinetsu, #map-tokai, #map-kinki, #map-chugoku, #map-shikoku, #map-kyushu {
        display: block;
        position: static;
        margin: 0 0.5em;
        width: auto;
        height: auto;
    }
    #japan-map div div.area {
        display: flex;
        flex-wrap: wrap;
        position: static;
        gap: 4px;
        padding: 4px 0;
    }
    #japan-map div div.area div {
        position: static;
        width: auto !important;
        height: auto !important;
        padding: 8px 12px;
        font-size: 14px;
    }
}

@media screen and (max-width: 1024px) {
    .university-league-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .link-card-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .pro-league-grid {
        grid-template-columns: 1fr;
    }

    .draft-year-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .university-league-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .region-chip {
        padding: 3px 8px;
        font-size: .75rem;
    }

    .link-card {
        padding: 3px 8px;
        font-size: .75rem;
    }

    .university-region-column .link-card {
        padding: 3px 8px;
        font-size: .75rem;
    }

    .independent-league-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .major-league-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===================================================================
   SearchForm ドロップダウン検索スタイル
   移行元: app/templates/include/SearchForm.inc.tpl
   =================================================================== */

/* 検索フォームコンテナ */
.search-form-dropdowns {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

/* セレクトボックス共通スタイル */
.search-form-dropdowns select {
    padding: 10px 36px 10px 14px;
    font-size: 0.95rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    min-width: 140px;
    transition: all 0.2s;
}

.search-form-dropdowns select:hover:not(:disabled) {
    border-color: #2563eb;
}

.search-form-dropdowns select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-form-dropdowns select:disabled {
    background-color: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

/* ラベル表示（オプション） */
.search-form-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.search-form-label span {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 500;
}

/* 矢印アイコン */
.search-form-arrow {
    color: #9ca3af;
    font-size: 1.2rem;
}

/* SearchForm レスポンシブ */
@media screen and (max-width: 768px) {
    .search-form-dropdowns {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form-dropdowns select {
        width: 100%;
    }

    .search-form-arrow {
        display: none;
    }
}

/* ===================================================================
   モバイル版日本地図（WEB版地区分け）
   =================================================================== */

/* PC版ではモバイル地図を非表示 */
#japan-map-mobile {
    display: none;
}

/* モバイル版日本地図のレスポンシブ切り替え */
@media screen and (max-width: 768px) {
    /* PC版の地図を非表示 */
    #japan-map {
        display: none !important;
    }

    /* モバイル版の地図を表示 */
    #japan-map-mobile {
        display: block;
    }

    /* モバイル地図の地域ブロック */
    #japan-map-mobile .mobile-region {
        margin-bottom: 16px;
    }

    #japan-map-mobile .area-title {
        font-size: 14px;
        font-weight: bold;
        text-align: center;
        margin-bottom: 8px;
        color: #374151;
    }

    #japan-map-mobile .area {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        justify-content: center;
    }

    #japan-map-mobile .area a {
        text-decoration: none;
    }

    #japan-map-mobile .pref {
        padding: 3px 8px;
        font-size: 14px;
        border-radius: 6px;
        border: 1px solid #ffffff;
        text-align: center;
        transition: 0.2s;
    }

    #japan-map-mobile .pref:hover {
        opacity: 0.7;
        transform: scale(1.02);
    }

    #japan-map-mobile .pref p {
        margin: 0;
    }

    /* WEB版地区分けカラー（地区ごとに統一） */
    .hokkaido-color { background-color: #8888ff; color: #ffffff; }
    .tohoku-color { background-color: #99ddff; color: #333333; }
    .kanto-color { background-color: #ff99ff; color: #333333; }
    .hokushinetsu-color { background-color: #ccf577; color: #333333; }
    .tokai-color { background-color: #ff8888; color: #ffffff; }
    .kinki-color { background-color: #ffcc88; color: #333333; }
    .chugoku-color { background-color: #80f580; color: #333333; }
    .shikoku-color { background-color: #ddbb99; color: #333333; }
    .kyushu-color { background-color: #f5e577; color: #333333; }
}
