/* type-chart-page.css
   Moved from inline <style> in pokemon-type-chart.html
*/

/* 相剋符號顏色與樣式 (與專案整體風格協調) */
.effect-super { color: #dc3545; font-weight: 700; } /* ● 2x */
.effect-less  { color: #0d6efd; font-weight: 700; } /* ▲ 0.5x */
.effect-immune{ color: #6c757d; font-weight: 700; } /* × 0x */
.chart-caption { font-size: .9rem; color: #6c757d; }

.type-header { min-width: 36px;  vertical-align: top;}
/* 第一張表 header 屬性標籤直式顯示 */
.type-header .type-badge {
    writing-mode: vertical-rl;
    /* text-orientation: upright;    */
    /* text-orientation: mixed; */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 2px 9px 0px;
}

.sticky-col { position: sticky; left: 0; background: #fff; z-index: 2; border-right: 1px solid #dee2e6 !important; width: 96px; min-width: 71px; }
.thead-sticky th { position: sticky; top: 0; z-index: 3; background: #f8f9fa; }

/* 左側縱向標籤：攻擊方招式的屬性 */
.type-chart-layout { display: flex; gap: 8px; align-items: stretch; }
.side-label {
    writing-mode: vertical-rl;
    font-weight: 600;
    color: #495057;
    min-width: 36px;
}

/* 防守屬性考量樣式 */
.defense-consideration-header {
    background: #f0f8ff;
    padding: 1.5rem;
    border-radius: 4px;
}

/* 防守表格容器：跟著網頁 scrollbar 滾動 */
.defense-table-wrapper {
    margin-top: 1rem;
    overflow: visible;
}

/* 自訂屬性選擇器（badge 風格） */
.type-picker {
    width: 100%;
}

.type-picker .picker-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 38px;
    width: 100%;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.type-picker .type-picker-menu {
    width: 100%;
    max-height: 260px;
    overflow-y: auto;
    padding: 6px;
}

.type-picker .dropdown-item {
    padding: 4px 6px;
}

.type-picker .dropdown-item .type-badge {
    display: inline-block;
    min-width: 56px;
    text-align: center;
}

/* 無屬性 badge 外觀 */
.type-badge.type-none {
    background: #e9ecef;
    color: #495057;
}

.defense-table-horizontal {
    margin-top: 1rem;
}

.defense-table-horizontal td {
    padding: 0.75rem !important;
    vertical-align: middle;
}

/* 隱藏表格 scrollbar */
.defense-table-horizontal {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.defense-table-horizontal::-webkit-scrollbar {
    display: none;
}

/* 第一欄：防守屬性 Badge（合併兩行） */
.defense-badge-cell {
    background-color: #f8f9fa !important;
    min-width: 66px;
    width: 66px;
    vertical-align: middle !important;
}

/* 第二欄：標籤欄（防守、倍率） */
.defense-label-cell {
    background-color: #e9ecef !important;
    font-weight: 600;
    min-width: 60px;
    width: 60px;
}

/* 攻擊屬性欄 */
.defense-type-cell {
    min-width: 36px; vertical-align: top;
}

.defense-type-cell .type-badge {
    writing-mode: vertical-rl;
    /* text-orientation: upright;    */
    padding: 6px 2px 9px 0px;
}

/* 倍率顏色樣式 */
.multiplier-2x {
    color: #dc3545;
    font-weight: 700;
    font-size: 1.1rem;
}

.multiplier-1x {
    color: #28a745;
    font-weight: 700;
    font-size: 1.1rem;
}

#defense-result-container {
    margin-top: 1.5rem;
}

/* ===== 寶可夢屬性篩選區塊樣式 ===== */

.pokemon-filter-header {
    background: #f0f8ff;
    padding: 1.5rem;
    border-radius: 4px;
}

.pokemon-filter-header h2 {
    color: #0d6efd;
}

.pokemon-filter-header .text-muted {
    margin: 0;
}

/* 屬性篩選按鈕容器 */
.type-filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 1rem;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.type-filter-container .type-badge {
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    white-space: nowrap;
    opacity: 1;
}

/* 屬性按鈕 active 狀態 - 維持原本顏色 */
.type-filter-container .type-badge.active {
    opacity: 1;
    border-color: rgba(0, 0, 0, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 覆蓋 Bootstrap .btn.active 樣式，保持屬性按鈕原本的顏色 */
/* 針對每個屬性 class 強制覆蓋 Bootstrap 的 active 樣式 */
.type-filter-container .btn.type-badge.type-一般.active,
.type-filter-container .btn.type-badge.type-一般.active:hover,
.type-filter-container .btn.type-badge.type-一般.active:focus { background-color: #A8A878 !important; color: #fff !important; }

.type-filter-container .btn.type-badge.type-火.active,
.type-filter-container .btn.type-badge.type-火.active:hover,
.type-filter-container .btn.type-badge.type-火.active:focus { background-color: #F08030 !important; color: #fff !important; }

.type-filter-container .btn.type-badge.type-水.active,
.type-filter-container .btn.type-badge.type-水.active:hover,
.type-filter-container .btn.type-badge.type-水.active:focus { background-color: #6890F0 !important; color: #fff !important; }

.type-filter-container .btn.type-badge.type-電.active,
.type-filter-container .btn.type-badge.type-電.active:hover,
.type-filter-container .btn.type-badge.type-電.active:focus { background-color: #F8D030 !important; color: #333 !important; }

.type-filter-container .btn.type-badge.type-草.active,
.type-filter-container .btn.type-badge.type-草.active:hover,
.type-filter-container .btn.type-badge.type-草.active:focus { background-color: #78C850 !important; color: #fff !important; }

.type-filter-container .btn.type-badge.type-冰.active,
.type-filter-container .btn.type-badge.type-冰.active:hover,
.type-filter-container .btn.type-badge.type-冰.active:focus { background-color: #98D8D8 !important; color: #fff !important; }

.type-filter-container .btn.type-badge.type-格鬥.active,
.type-filter-container .btn.type-badge.type-格鬥.active:hover,
.type-filter-container .btn.type-badge.type-格鬥.active:focus { background-color: #C03028 !important; color: #fff !important; }

.type-filter-container .btn.type-badge.type-毒.active,
.type-filter-container .btn.type-badge.type-毒.active:hover,
.type-filter-container .btn.type-badge.type-毒.active:focus { background-color: #A040A0 !important; color: #fff !important; }

.type-filter-container .btn.type-badge.type-地面.active,
.type-filter-container .btn.type-badge.type-地面.active:hover,
.type-filter-container .btn.type-badge.type-地面.active:focus { background-color: #E0C068 !important; color: #333 !important; }

.type-filter-container .btn.type-badge.type-飛行.active,
.type-filter-container .btn.type-badge.type-飛行.active:hover,
.type-filter-container .btn.type-badge.type-飛行.active:focus { background-color: #A890F0 !important; color: #fff !important; }

.type-filter-container .btn.type-badge.type-超能力.active,
.type-filter-container .btn.type-badge.type-超能力.active:hover,
.type-filter-container .btn.type-badge.type-超能力.active:focus { background-color: #F85888 !important; color: #fff !important; }

.type-filter-container .btn.type-badge.type-蟲.active,
.type-filter-container .btn.type-badge.type-蟲.active:hover,
.type-filter-container .btn.type-badge.type-蟲.active:focus { background-color: #A8B820 !important; color: #fff !important; }

.type-filter-container .btn.type-badge.type-岩石.active,
.type-filter-container .btn.type-badge.type-岩石.active:hover,
.type-filter-container .btn.type-badge.type-岩石.active:focus { background-color: #B8A038 !important; color: #fff !important; }

.type-filter-container .btn.type-badge.type-幽靈.active,
.type-filter-container .btn.type-badge.type-幽靈.active:hover,
.type-filter-container .btn.type-badge.type-幽靈.active:focus { background-color: #705898 !important; color: #fff !important; }

.type-filter-container .btn.type-badge.type-龍.active,
.type-filter-container .btn.type-badge.type-龍.active:hover,
.type-filter-container .btn.type-badge.type-龍.active:focus { background-color: #7038F8 !important; color: #fff !important; }

.type-filter-container .btn.type-badge.type-惡.active,
.type-filter-container .btn.type-badge.type-惡.active:hover,
.type-filter-container .btn.type-badge.type-惡.active:focus { background-color: #705848 !important; color: #fff !important; }

.type-filter-container .btn.type-badge.type-鋼.active,
.type-filter-container .btn.type-badge.type-鋼.active:hover,
.type-filter-container .btn.type-badge.type-鋼.active:focus { background-color: #B8B8D0 !important; color: #333 !important; }

.type-filter-container .btn.type-badge.type-妖精.active,
.type-filter-container .btn.type-badge.type-妖精.active:hover,
.type-filter-container .btn.type-badge.type-妖精.active:focus { background-color: #EE99AC !important; color: #fff !important; }

/* 統一處理 active 狀態的邊框 */
.type-filter-container .btn.type-badge.active {
    border-color: rgba(0, 0, 0, 0.3) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

/* 屬性按鈕未選取狀態 - 淡化 */
.type-filter-container.has-selection .type-badge:not(.active) {
    opacity: 0.3;
}

.type-filter-container .type-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    border: 3px solid #0d6efd !important; /* 紅色粗邊框 */
}

/* 已選取的按鈕 hover 時也顯示紅色邊框 */
.type-filter-container .type-badge.active:hover {
    border: 3px solid #0d6efd  !important;
}

/* 名稱查詢區塊 */
.pokemon-name-search {
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}

.pokemon-name-search label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    display: block;
}

.pokemon-name-search input {
    width: 100%;
    max-width: 400px;
    padding: 0.5rem 1rem;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.pokemon-name-search input:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.pokemon-name-search input::placeholder {
    color: #adb5bd;
}

/* 寶可夢表格區塊 */
.pokemon-table-section {
    margin-top: 1.5rem;
}

.pokemon-table-wrapper {
    overflow-x: auto;
}

.pokemon-data-table {
    margin-top: 1rem;
}

.pokemon-data-table thead {
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 2;
}

.pokemon-data-table thead th {
    border-top: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    padding: 1rem 0.75rem;
    width: 33.333%;
    word-break: break-word;
    text-align: center;
}

.pokemon-data-table tbody tr {
    transition: background-color 0.15s ease;
}

.pokemon-data-table tbody tr:hover {
    background-color: #f8f9fa;
}

.pokemon-data-table tbody td {
    padding: 0.75rem;
    vertical-align: middle;
    text-align: center;
}

/* 明確設定每個欄位寬度 */
.pokemon-data-table tbody td:nth-child(1) {
    width: 25%; /* 圖片欄 */
}

.pokemon-data-table tbody td:nth-child(2) {
    width: 35%; /* 名稱欄 */
}

.pokemon-data-table tbody td:nth-child(3) {
    width: 40%; /* 屬性欄 */
}

/* 寶可夢圖片 */
.pokemon-data-table .pokemon-image {
    display: block;
    margin: 0 auto;
    object-fit: contain;
    max-width: 64px;
    height: auto;
}

/* 寶可夢名稱列 */
.pokemon-data-table .pokemon-name {
    color: #0d6efd;
    font-size: 0.95rem;
    font-weight: 600;
    word-break: break-word;
    text-align: center;
    display: table-cell;
    vertical-align: middle;
}

/* 寶可夢屬性列 */
.pokemon-data-table .pokemon-types {
    display: table-cell;
    vertical-align: middle;
    text-align: center;
}

.pokemon-data-table .pokemon-types > span {
    display: inline-block;
    margin: 0 3px 3px 0;
}

.pokemon-data-table .pokemon-types .type-badge {
    font-size: 0.85rem;
    padding: 0.35rem 0.75rem;
    border-radius: 12px;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 無資料提示 */
.pokemon-data-table tbody td[colspan] {
    text-align: center;
    padding: 2rem 0.75rem;
    font-size: 1.1rem;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .type-filter-container {
        gap: 6px;
    }

    .type-filter-container .type-badge {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }

    .pokemon-data-table {
        font-size: 0.9rem;
    }

    .pokemon-data-table tbody td {
        padding: 0.5rem 0.4rem;
    }

    .pokemon-image {
        max-width: 48px !important;
    }
}

