/* 滾動條css */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    -webkit-border-radius: 10px;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    -webkit-border-radius: 4px;
    border-radius: 4px;
    background: rgb(219, 219, 219);
}

.search-suggestions .suggestion-section {
    padding: 0.3em 1em 0.1em 1em;
    font-size: 0.95em;
    color: #aaa;
    background: #232323;
    border-bottom: 1px solid #333;
    font-weight: bold;
}
/* 搜尋建議下拉選單樣式 */
.search-suggestions {
    position: absolute;
    background: #232323;
    color: #fff;
    border: 1px solid #444;
    border-radius: 0 0 6px 6px;
    max-height: 220px;
    overflow-y: auto;
    width: 300px;
    z-index: 1000;
    left: 0;
    top: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.search-suggestions .suggestion-item {
    padding: 0.5em 1em;
    cursor: pointer;
    white-space: nowrap;
}
.search-suggestions .suggestion-item:hover,
.search-suggestions .suggestion-item.active {
    background: #42aaff;
    color: #222;
}
body {
    font-family: sans-serif;
    background: #1e1e1e;
    color: #ddd;
    margin: 0;
}
.disclaimer {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100vw;
    z-index: 999;
    background-color: #2b2b2b;
    color: #aaa;
    padding: 1em;
    font-size: 0.9em;
    text-align: center;
    border-top: 1px solid #444;
    transition: transform 0.3s ease-out;
}
.disclaimer.hidden {
    transform: translateY(100%);
}
.disclaimer a {
    color: #ccc;
    text-decoration: underline;
}
.top-bar {
    position: sticky;
    top: 0;
    background-color: #1e1e1e;
    z-index: 100;
    /* padding: 1em 2em 0 2em; */
    padding: 1em 2em;
    border-bottom: 1px solid #333;
}
.controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
}
.search-controls {
    display: flex;
    align-items: center;
    gap: 1em;
    width: 100%;
    font-size: 0.9em;
}
.search-controls input[type="text"] {
    font-size: inherit;
}
.search-controls input[type="number"] {
    font-size: inherit;
}
.search-controls button {
    font-size: inherit;
}
.region-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    width: 100%;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}
.region-controls.show {
    max-height: 300px;
}
#region-checkboxes {
    display: grid;
    grid-template-columns: repeat(10, minmax(80px, 1fr));
    gap: 0.5em;
    width: 100%;
}
#region-checkboxes label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.toggle-regions-btn {
    padding: 0.3em 0.8em;
    border-radius: 5px;
    border: 1px solid #666;
    background: #333;
    color: #ddd;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.2s;
}
.toggle-regions-btn:hover {
    background: #444;
}
input[type="text"] {
    padding: 0.5em;
    border-radius: 5px;
    border: 1px solid #666;
    background: #333;
    color: #fff;
}
label {
    font-size: 0.9em;
}
#drop-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
    padding: 1em 2em;
    padding-bottom: 1em;
}
.monster-card {
    background-color: #2a2a2a;
    border: 1px solid #555;
    border-radius: 8px;
    padding: 1em;
    width: 287px;
    white-space: normal;
    box-sizing: border-box;
    text-align: center;
}
.monster-image {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-bottom: 0.5em;
}
.monster-name {
    font-weight: bold;
    color: #ffcc00;
    margin-bottom: 0.5em;
}
.monster-attr {
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 0.4em;
    justify-content: center;
    margin: 0.5em auto 1em auto;
    padding: 0 1em;
}
.attr-box {
    background-color: #111;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 0.3em 0.6em;
    font-size: 0.85em;
    color: #ccc;
    white-space: nowrap;
    text-align: center;
}
.attr-box.fullwidth {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5em 0.6em;
}
.item {
    display: flex;
    align-items: center;
    gap: 0.5em;
    margin-bottom: 0.3em;
    text-align: left;
    padding-left: 1em;
}
.hide-text {
    display: inline-block;
    margin: 2px;
}
.hide-text .item-icon {
    margin: 0;
}
.only-image-mode {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
}
.hide-text span {
    display: none;
}
.hide-text:hover span {
    display: inline-block;
    position: absolute;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 0.2em 0.4em;
    border-radius: 4px;
    margin-left: 5px;
    z-index: 10;
    white-space: nowrap;
}
mark {
    background-color: yellow;
    color: black;
}
.item-icon.highlighted {
    box-shadow: 0 0 6px 3px gold;
    border-radius: 4px;
}

.toggle-all-btn {
    margin-right: 1em;
    padding: 0.2em 0.5em;
    border-radius: 4px;
    border: 1px solid #666;
    background: #333;
    color: #ddd;
    cursor: pointer;
    font-size: 0.9em;
}

.share-btn {
    padding: 0.2em 0.5em;
    border-radius: 5px;
    border: 1px solid #42aaff;
    background: #222;
    color: #42aaff;
    cursor: pointer;
}

.toggle-default-btn {
    margin-right: 1em;
    padding: 0.2em 0.5em;
    border-radius: 4px;
    border: 1px solid #666;
    background: #333;
    color: #ddd;
    cursor: pointer;
    font-size: 0.9em;
}

input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #666;
    border-radius: 4px;
    background: #333;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-top: 0;
    margin-right: 1px;
    transition: border-color 0.2s, background 0.2s;
}
input[type="checkbox"]:checked {
    background: #42aaff;
    border-color: #42aaff;
}
input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 1px;
    width: 4px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
input[type="number"] {
    width: 60px;
    padding: 0.5em;
    border-radius: 5px;
    border: 1px solid #666;
    background: #333;
    color: #fff;
    font-size: 1em;
    box-sizing: border-box;
}

/* 屬性剋制樣式 */
.resistance-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 4px;
    margin: 1px;
    font-size: 0.9em;
    font-weight: bold;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* 屬性顏色 */
.resistance-tag.resistance-fire {
    background-color: #cc3700;
}
.resistance-tag.resistance-poison {
    background-color: #6a3da8;
}
.resistance-tag.resistance-ice {
    background-color: #4f95b8;
}
.resistance-tag.resistance-lightning {
    background-color: #ffa500;
}
.resistance-tag.resistance-holy {
    background-color: #ffd700;
    color: #333;
}
.resistance-tag.resistance-heal {
    background-color: #2ecc71;
}

.resistance-tag.resistance-all2 {
    background: linear-gradient(45deg, #333 0%, #666 100%);
    padding: 4px 8px;
}

/* 懸停效果 */
.resistance-tag:hover {
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

/* 選項容器樣式 */
.toggle-resistance-btn {
    padding: 0.3em 0.8em;
    border-radius: 5px;
    border: 1px solid #666;
    background: #333;
    color: #ddd;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.2s;
}

.toggle-resistance-btn:hover {
    background: #444;
}

.resistance-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    width: 100%;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

.resistance-controls.show {
    max-height: 200px;
}

/* 選項容器樣式 */
#resistance-checkboxes {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5em;
    width: 100%;
    padding: 4px;
}

#resistance-checkboxes button {
    background-color: #333;
    border: 1px solid #666;
    padding: 0.3em 0.8em;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    width: 100%;
    color: white;
    position: relative;
}

/* 火按鈕 */
#resistance-checkboxes button[value^="F"] {
    background-color: #cc3700;
    border-color: #cc3700;
    grid-column: 1;
}

/* 毒按鈕 */
#resistance-checkboxes button[value^="S"] {
    background-color: #6a3da8;
    border-color: #6a3da8;
    grid-column: 2;
}

/* 冰按鈕 */
#resistance-checkboxes button[value^="I"] {
    background-color: #4f95b8;
    border-color: #4f95b8;
    grid-column: 3;
}

/* 雷按鈕 */
#resistance-checkboxes button[value^="L"] {
    background-color: #ffa500;
    border-color: #ffa500;
    grid-column: 4;
}

/* 聖按鈕 */
#resistance-checkboxes button[value^="H3"] {
    background-color: #ffd700;
    border-color: #ffd700;
    grid-column: 5;
    color: #333;
}

/* 可治癒按鈕 */
#resistance-checkboxes button[value="HS"] {
    background-color: #2ecc71;
    border-color: #2ecc71;
    grid-column: 6;
}

#resistance-checkboxes button:hover {
    filter: brightness(1.2);
}

#resistance-checkboxes button.selected {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
}
