/* === БАЗОВЫЕ СТИЛИ === */
.wtl-db-root * { box-sizing: border-box; }
.wtl-db-root { font-family: inherit; color: #ccc; }
.wtl-db-layout { display: flex; gap: 20px; align-items: flex-start; }
.wtl-db-main { flex-grow: 1; width: 100%; max-height: 80vh; overflow-y: auto; overflow-x: hidden; padding-right: 10px; }
.wtl-db-main::-webkit-scrollbar { width: 6px; }
.wtl-db-main::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); border-radius: 10px; }
.wtl-db-main::-webkit-scrollbar-thumb { background: #393C40; border-radius: 10px; }
.wtl-db-main::-webkit-scrollbar-thumb:hover { background: #FF9800; }

/* === САЙДБАР === */
.wtl-db-sidebar { width: 260px; position: sticky; top: 20px; flex-shrink: 0; display: flex; flex-direction: column; gap: 10px; }
.wtl-db-search-input { width: 100%; padding: 12px; background: #2c2c2c; border: 1px solid #393C40; color: #fff; border-radius: 6px; outline: none; font-family: inherit; font-size: 16px; }
.wtl-db-search-input:focus { border-color: #FF9800; }
.wtl-db-filter-list { display: flex; flex-direction: column; gap: 5px; }
.wtl-db-tab { text-align: left; padding: 10px 15px; background: #2c2c2c; border: 1px solid transparent; color: #bbb; cursor: pointer; border-radius: 6px; transition: 0.2s; outline: none; font-family: inherit; font-size: 15px; -webkit-tap-highlight-color: transparent; }
.wtl-db-tab:hover { background: #393C40; color: #fff; }
.wtl-db-tab.active { background: #FF9800; color: #000; font-weight: bold; border-color: #FF9800; }
.wtl-db-compare-bar { background: #FF9800; color: #000; padding: 12px; border-radius: 6px; font-weight: bold; text-align: center; cursor: pointer; display: none; margin-top: 10px; transition: 0.2s; outline: none; -webkit-tap-highlight-color: transparent; }
.wtl-db-compare-bar:hover { background: #ffb74d; }

/* === ПЕРЕКЛЮЧАТЕЛЬ ГРУППИРОВКИ === */
.wtl-db-toggle-wrap { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 5px 0; user-select: none; }
.wtl-db-toggle-label { font-size: 0.85em; color: #555; transition: color 0.2s; }
.wtl-db-toggle-label.active-label { color: #fff; font-weight: bold; }
.wtl-db-switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.wtl-db-switch input { opacity: 0; width: 0; height: 0; }
.wtl-db-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #393C40; transition: .3s; border-radius: 22px; -webkit-tap-highlight-color: transparent; }
.wtl-db-slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background-color: #ccc; transition: .3s; border-radius: 50%; }
.wtl-db-switch input:checked + .wtl-db-slider { background-color: #888; }
.wtl-db-switch input:checked + .wtl-db-slider:before { transform: translateX(18px); }
.wtl-hidden { display: none !important; }

.wtl-db-reset-bar { background: transparent; color: #888; border: 1px solid #393C40; padding: 10px 12px; border-radius: 6px; font-weight: normal; text-align: center; cursor: pointer; display: none; margin-top: 10px; transition: 0.2s; outline: none; font-family: inherit; font-size: 14px; -webkit-tap-highlight-color: transparent; }
.wtl-db-reset-bar:hover { color: #fff; border-color: #555; background: rgba(255,255,255,0.05); }

/* === СЕТКА КАРТОЧЕК === */
.wtl-db-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 15px; }
.wtl-db-card { background: #2c2c2c; border: 1px solid #393C40; border-radius: 10px; padding: 15px; text-align: center; cursor: pointer; transition: 0.2s; position: relative; -webkit-tap-highlight-color: transparent; }
.wtl-db-card:hover { border-color: #555; }
.wtl-db-card.selected { border: 2px solid #FF9800; box-shadow: 0 0 12px rgba(255, 152, 0, 0.2); }
.wtl-db-thumb-wrap { display: flex; justify-content: center; margin-bottom: 10px; }
.wtl-db-thumb-wrap img { height: 80px; width: 100%; object-fit: contain; }
.wtl-db-card-name { font-weight: 600; color: #fff; font-size: 0.95em; line-height: 1.2; margin-bottom: 5px; }
.wtl-db-card-meta { font-size: 0.75em; color: #888; display: flex; flex-direction: column; gap: 2px; }
.wtl-db-lvl-badge { color: #FF9800; font-weight: bold; }
.wtl-db-chk { position: absolute; top: 10px; right: 10px; transform: scale(1.3); cursor: pointer; accent-color: #FF9800; display: none; -webkit-tap-highlight-color: transparent; }
@media (min-width: 992px) { .wtl-db-card:hover .wtl-db-chk { display: block; } }

/* === МОДАЛЬНОЕ ОКНО (ПРОФИЛЬ ОРУЖИЯ) === */
.wtl-db-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 10000; justify-content: center; align-items: center; padding: 20px; }
.wtl-db-modal.active { display: flex; }

/* Фиксированная шапка + скроллируемое тело */
.wtl-db-modal-content { background: #222; border-radius: 12px; max-width: 600px; width: 100%; position: relative; border: 1px solid #393C40; max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; }
.wtl-db-modal-close { position: absolute; top: 15px; right: 15px; font-size: 30px; color: #888; cursor: pointer; background: none; border: none; outline: none; transition: 0.2s; -webkit-tap-highlight-color: transparent; z-index: 10; background: rgba(0,0,0,0.5); border-radius: 50%; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; line-height: 1; }
.wtl-db-modal-close:hover { color: #FF9800; background: rgba(0,0,0,0.8); }

#wtl-db-detail-body, #wtl-db-compare-body { padding: 25px; overflow-y: auto; overflow-x: hidden; }
#wtl-db-detail-body::-webkit-scrollbar, #wtl-db-compare-body::-webkit-scrollbar { width: 6px; }
#wtl-db-detail-body::-webkit-scrollbar-track, #wtl-db-compare-body::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); border-radius: 10px; }
#wtl-db-detail-body::-webkit-scrollbar-thumb, #wtl-db-compare-body::-webkit-scrollbar-thumb { background: #393C40; border-radius: 10px; }
#wtl-db-detail-body::-webkit-scrollbar-thumb:hover, #wtl-db-compare-body::-webkit-scrollbar-thumb:hover { background: #FF9800; }

.wtl-db-detail-header { text-align: center; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid #393C40; }
.wtl-db-detail-header img { height: 120px; object-fit: contain; margin-bottom: 10px; }
.wtl-db-detail-title { margin: 0; font-size: 1.4em; color: #fff; }
.wtl-db-detail-sub { color: #888; font-size: 0.9em; margin-top: 5px; }
.wtl-db-detail-sub span { color: #FF9800; font-weight: bold; }
.wtl-db-section { margin-top: 20px; }
.wtl-db-section-title { color: #FF9800; font-size: 0.85em; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; border-bottom: 1px solid #333; padding-bottom: 5px; }

.wtl-db-stat-row { display: flex; justify-content: space-between; align-items: flex-start; padding: 6px 0; font-size: 0.9em; border-bottom: 1px solid #2c2c2c; gap: 15px; }
.wtl-db-stat-name { color: #888; flex: 0 0 50%; }
.wtl-db-stat-val { color: #fff; font-weight: 600; text-align: right; flex: 1 1 50%; display: flex; flex-direction: column; gap: 2px; }
.wtl-db-stat-val span.pve-pvp-line { display: block; }

.wtl-db-req-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.wtl-db-req-item { text-align: center; background: #2c2c2c; padding: 8px; border-radius: 6px; }
.wtl-db-req-label { font-size: 0.75em; color: #888; display: block; margin-bottom: 4px; }
.wtl-db-req-val { font-size: 1.1em; color: #fff; font-weight: bold; }
.wtl-db-notes-list { margin: 10px 0 0 0; padding: 10px; background: rgba(255, 152, 0, 0.05); border: 1px solid rgba(255, 152, 0, 0.2); border-radius: 6px; list-style: none; font-size: 0.85em; color: #ccc; display: flex; flex-direction: column; gap: 6px; }
.wtl-db-notes-list li::before { content: "➔"; color: #FF9800; margin-right: 5px; }

/* === МОДИФИКАЦИИ ВНУТРИ КАРТОЧКИ === */
.wtl-db-mods-container { margin-top: 20px; }
.wtl-db-mod-item { background: rgba(0,0,0,0.2); border: 1px solid #393C40; border-radius: 6px; margin-bottom: 10px; overflow: hidden; }
.wtl-db-mod-head { padding: 10px 15px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; -webkit-tap-highlight-color: transparent; gap: 10px; }
.wtl-db-mod-name { font-weight: 600; color: #fff; }
.wtl-db-mod-badge { font-size: 0.7em; padding: 2px 6px; border-radius: 4px; background: #000; border: 1px solid #393C40; color: #FF9800; white-space: nowrap; }
.wtl-db-mod-body { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; padding: 0 15px; }
.wtl-db-mod-item.is-open .wtl-db-mod-body { max-height: 2000px; padding: 10px 15px; }

/* === МОДАЛКА СРАВНЕНИЯ === */
.wtl-db-compare-body { display: flex; gap: 15px; }
.wtl-db-comp-col { flex: 1; padding: 0; background: transparent; border-radius: 8px; min-width: 0; }
.wtl-db-comp-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #FF9800; padding-bottom: 10px; margin-bottom: 15px; gap: 10px; flex-wrap: wrap; background: #2c2c2c; padding: 10px; border-radius: 6px; }
.wtl-db-comp-title { margin: 0; font-size: 1.1em; color: #fff; }
.wtl-db-comp-lvl { font-size: 0.8em; padding: 2px 8px; border-radius: 4px; background: #000; border: 1px solid #FF9800; color: #FF9800; white-space: nowrap; }
.wtl-db-best-val { color: #2ecc71; font-weight: bold; }

/* === АДАПТИВ === */
@media (max-width: 992px) {
    .wtl-db-layout { flex-direction: column; }
    .wtl-db-sidebar { width: 100%; position: relative; top: 0; }
    .wtl-db-filter-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .wtl-db-main { max-height: none; padding-right: 0; }
    .wtl-db-compare-body { flex-direction: column; }
    .wtl-db-modal { padding: 10px; align-items: flex-start; }
    .wtl-db-modal-content { max-height: 100vh; border-radius: 0; }
}

/* === СТРЕЛОЧКА ДЛЯ РАСКРЫТИЯ МОДИФИКАЦИЙ === */
.wtl-db-mod-badge {
    margin-left: auto; 
}

.wtl-db-mod-head::after {
    content: "❯";
    font-size: 1em;
    font-weight: 600;
    color: #fff;
    display: inline-block;
    transition: transform 0.3s ease, color 0.3s ease;
    flex-shrink: 0;
    margin-left: 10px;
}

.wtl-db-mod-item.is-open .wtl-db-mod-head::after {
    transform: rotate(90deg);
    color: #FF9800;
}

.wtl-db-mod-head {
    cursor: pointer;
}