/* --- ================================ --- */
/* --- 2. 寶可夢編號篩選器 (App 2) 樣式 --- */
/* --- ================================ --- */
#id-selector-app {
    text-align: center;
}
#id-selector-app header, #id-selector-app footer {
    margin-bottom: 20px;
}
#id-selector-app h1 {
    color: #e4000f;
}

/* ▼▼▼【重構】控制項區塊新樣式 ▼▼▼ */
#id-selector-app .controls-container {
    display: flex;
    flex-direction: column; /* 手機上預設垂直堆疊 */
    gap: 18px;
    margin-top: 20px;
    margin-bottom: 20px;
    align-items: stretch; 
}

#id-selector-app .control-fieldset {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px 20px;
    background-color: #fdfdfd;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    justify-content: center; /* 內部元件置中 */
}

#id-selector-app legend {
    font-size: 1em;
    font-weight: bold;
    color: #3B4CCA;
    padding: 0 10px;
    margin-left: 10px; 
}

#id-selector-app .filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #f0f2f5;
    padding: 8px 12px;
    border-radius: 8px;
}

#id-selector-app .filter-group label {
    white-space: nowrap; 
    font-size: 14px;
    user-select: none;
    cursor: pointer;
}

#id-selector-app .control-fieldset button {
    background-color: #3B4CCA;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 15px;
    transition: background-color 0.3s, transform 0.2s;
    flex-shrink: 0; 
}

#id-selector-app .control-fieldset button:hover {
    background-color: #000F94;
    transform: translateY(-2px);
}

/* 特定按鈕微調 */
#id-selector-app #show-all {
    background-color: #4CAF50;
}
#id-selector-app #show-all:hover {
    background-color: #45a049;
}

#id-selector-app #clear-all {
    background-color: #d9534f;
}
#id-selector-app #clear-all:hover {
    background-color: #c9302c;
}

#id-selector-app #select-all-shown {
     background-color: #f0ad4e;
     color: #fff;
}
#id-selector-app #select-all-shown:hover {
     background-color: #ec971f;
}

#id-selector-app .action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* --- 電腦版樣式 (寬度 > 768px) --- */
@media (min-width: 768px) {
    #id-selector-app .controls-container {
        flex-direction: row; /* 在大螢幕上改為水平排列 */
        justify-content: center;
        align-items: flex-start;
    }

    #id-selector-app .control-fieldset {
        flex-grow: 1; /* 讓兩個區塊平均分配空間 */
        max-width: 550px; /* 給個最大寬度避免過度拉伸 */
    }
}
/* ▲▲▲【重構】控制項區塊新樣式 ▲▲▲ */


#id-selector-app .pokemon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
#id-selector-app .pokemon-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 8px 4px;
    border: 3px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    opacity: 0.8;
    background-color: #f8f8f8;
}
#id-selector-app .pokemon-name {
    font-size: 13px;
    color: #000; /* 【修改】顏色加深為純黑 */
    font-weight: 600; /* 【修改】字體加粗 (semi-bold) */
    margin-top: 5px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}
#id-selector-app .pokemon-grid img {
    width: 96px;
    height: 96px;
    user-select: none; /* 【修改】防止圖片被選取反白 */
    -webkit-user-select: none; /* 兼容舊版 Safari/Chrome */
}
@media (hover: hover) {
    #id-selector-app .pokemon-card:hover {
        transform: scale(1.1);
        opacity: 1;
        border-color: #a0a0a0;
    }
}
#id-selector-app .pokemon-card.selected {
    opacity: 1;
    transform: scale(1.05);
    border-color: #FFDE00;
    background-color: #e3f2fd;
    box-shadow: 0 0 10px #FFDE00;
}
#id-selector-app .pokemon-card.selected .pokemon-name {
    font-weight: bold;
    color: #000;
}
#id-selector-app #output-container {
    margin-top: 20px;
    padding: 15px;
    background-color: white;
    border-radius: 8px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
#id-selector-app #selected-ids {
    display: block;
    background-color: #eee;
    padding: 10px;
    border-radius: 5px;
    min-height: 20px;
    word-wrap: break-word;
}#id-selector-app .controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}
#id-selector-app .control-group {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #e9e9e9;
    padding: 8px 15px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
#id-selector-app .control-group label {
    cursor: pointer;
    font-size: 14px;
    user-select: none;
}
#id-selector-app .controls > button {
    padding: 12px 15px;
}
#id-selector-app .search-container {
    position: sticky;
    /* 使用 JS 設定的 CSS 變數，60px 是備用值 */
    top: var(--nav-height, 60px); /* <-- 修改這裡 */
    z-index: 1000;
    background-color: #f0f2f5;
    padding: 15px 0;
    transition: top 0.1s ease-in-out; /* 【新增】讓 top 的變化有動畫效果 */
}
#id-selector-app #idSearchInput {
    box-sizing: border-box;  /* 確保 padding 不會撐大寬度 */
    width: 100%;             /* 填滿 .input-wrapper 的寬度 */
    max-width: 100%;         /* 覆蓋掉可能存在的 max-width */
    
    /* 調整 padding，為按鈕騰出空間 */
    padding: 12px 45px 12px 20px; /* 右側 padding 加大 */

    /* 其他原有樣式保持不變 */
    font-size: 18px;
    border-radius: 25px;
    border: 2px solid #ddd;
    transition: border-color 0.3s, box-shadow 0.3s;
}
#id-selector-app #idSearchInput:focus {
    outline: none;
    border-color: #3B4CCA;
    box-shadow: 0 0 8px rgba(59, 76, 202, 0.5);
}
#id-selector-app .output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
#id-selector-app .output-header h3 {
    margin: 0;
}
#id-selector-app #copy-button {
    background-color: #007BFF;
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s, transform 0.2s;
}
#id-selector-app #copy-button:hover {
    background-color: #0056b3;
    transform: scale(1.05);
}
#id-selector-app #copy-button.copied {
    background-color: #28a745;
    cursor: default;
}
body.nav-is-hidden #id-selector-app .search-container {
    top: 0; /* 當導覽列隱藏時，讓搜尋框黏在最頂部 */
}

/* --- 【新增】強制隱藏 search input 內建的清除按鈕 --- */
#id-selector-app #idSearchInput::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}


/* --- 【修正】叉叉按鈕的最終樣式 --- */
#id-selector-app .clear-search-btn {
    position: absolute;      /* 相對於 .input-wrapper 定位 */
    top: 50%;
    transform: translateY(-50%);
    right: 15px;             /* 定位在 .input-wrapper 的右側內邊緣 */
    
    /* 其他原有樣式保持不變 */
    z-index: 2;
    background: transparent;
    border: none;
    font-size: 24px;
    color: #888;
    cursor: pointer;
    padding: 0 5px;
    display: none;
}

#id-selector-app .clear-search-btn:hover {
    color: #333;
}


/* --- 【修正】讓 input 的文字不會被按鈕蓋住 --- */
#id-selector-app #idSearchInput {
    /* 原本 padding-right 為 20px，增加到 45px */
    padding-right: 35px; 
}
#id-selector-app .input-wrapper {
    position: relative;      /* 這行最關鍵！建立定位基準 */
    display: inline-block;   /* 讓容器寬度自適應內容，並能被 text-align: center 影響 */
    width: 90%;              /* 讓它和 input 有一樣的寬度行為 */
    max-width: 600px;        /* 和 input 的最大寬度保持一致 */
}

/* 在 id-selector.css 檔案中新增以下樣式 */

/* PvP 篩選群組的專屬樣式 */
#id-selector-app .pvp-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background-color: #f0f2f5;
    border-radius: 8px;
}

/* 讓標籤文字更易讀 */
#id-selector-app .pvp-filter-group label {
    font-size: 14px;
    color: #333;
    white-space: nowrap;
}

/* 統一 select 和 input 的樣式 */
#id-selector-app .pvp-filter-group select,
#id-selector-app .pvp-filter-group input[type="number"] {
    padding: 8px;
    font-size: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: white;
}

#id-selector-app .pvp-filter-group input[type="number"] {
    width: 60px; /* 給數字輸入框一個固定寬度 */
    text-align: center;
}

/* PvP 篩選按鈕樣式 */
#id-selector-app .pvp-filter-group button {
    background-color: #007bff; /* 使用不同的藍色以茲區別 */
    padding: 8px 15px;
}

#id-selector-app .pvp-filter-group button:hover {
    background-color: #0056b3;
}
/* --- ================================ --- */
/* --- 手機版響應式調整 (Mobile Responsive) --- */
/* --- ================================ --- */
@media (max-width: 768px) {
    #id-selector-app .pokemon-grid {
        /* 縮小每欄的最小寬度，讓更多寶可夢能排在一行 */
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 8px; /* 縮小間距 */
        padding: 10px; /* 縮小內邊距 */
    }

    #id-selector-app .pokemon-grid img {
        width: 64px; /* 縮小圖片寬度 */
        height: 64px; /* 縮小圖片高度 */
    }

    #id-selector-app .pokemon-name {
        font-size: 12px; /* 縮小名稱字體 */
        margin-top: 4px;
    }

    #id-selector-app .pokemon-card {
        padding: 4px 2px; /* 縮小卡片內距 */
        border-width: 2px; /* 讓邊框細一點 */
    }
}

/* --- 新增 Elite Move 的樣式 --- */
.elite-move {
  color: #D4AF37; /* 使用金色來突顯 */
  font-weight: bold; /* 讓字體加粗 */
  font-style: italic; /* 稍微傾斜，更有特殊感 */
}