/* WoW Forever Gear Planner. Site kabuğu (başlık, alt bilgi, yazı tipleri)
   /assets/site.css'te; buradaki kurallar .planner altında kalır. */
.planner {
  /* Koyu araç paneli: item kalite renkleri koyu zeminde okunaklı kalır. */
  --text: #ece9e2;
  --bg-2: #171a22;
  --panel: #1c2029;
  --panel-2: #242935;
  --line: #2d3340;
  --muted: #8f95a3;
  --gold: #ff8a5c;
  --gold-dim: #a8482a;
  --up: #2fd394;
  --down: #ff6b6b;
  --warn: #ffb020;
  --q-poor: #9d9d9d;
  --q-common: #ffffff;
  --q-uncommon: #1eff00;
  --q-rare: #0070dd;
  --q-rare-text: #3d97ff;
  --q-epic: #b45cff;
  --q-legendary: #ff8000;
  --radius: 12px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: #12141a;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .08), 0 24px 48px rgba(22, 24, 29, .18);
}
.planner h2, .planner h3 { color: var(--text); }
.planner a { color: var(--gold); }
.planner code, .prose code { font-size: 12px; background: #1f2533; padding: 1px 5px; border-radius: 4px; }
.planner .muted { color: var(--muted); }
.planner .warn { color: var(--warn); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.char-form { display: flex; gap: 8px; max-width: 640px; margin: 8px 0 18px; }
.char-form input { flex: 1; min-width: 0; }
.planner input[type=text], .planner select {
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 11px; font: inherit; font-size: 14px;
}
.planner input[type=text]:focus, .planner select:focus { outline: 2px solid var(--gold-dim); outline-offset: 0; }
:where(.planner) button {
  font: inherit; cursor: pointer; border-radius: 8px; padding: 8px 14px;
  border: 1px solid var(--gold-dim); background: linear-gradient(135deg, #ff8a3d, #ff4f64); color: #fff; border-color: transparent; font-weight: 600;
}
:where(.planner) button:hover { border-color: var(--gold); }
:where(.planner) button.ghost { background: transparent; border-color: var(--line); color: var(--muted); }
:where(.planner) button.ghost:hover { color: var(--text); border-color: var(--muted); }
.db-info { color: var(--muted); font-size: 12px; margin-top: 16px; }

/* Durum -------------------------------------------------------------------- */
.status { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid var(--line); background: var(--panel); }
.status-error { border-color: var(--down); color: #ffb4ae; }
.status-warn { border-color: var(--gold-dim); color: #f1d9a0; }
.spinner {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--muted); border-top-color: var(--gold); animation: spin .8s linear infinite;
  vertical-align: -1px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Karakter başlığı -------------------------------------------------------- */
.char-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.char-head h2 { margin: 0; font: 700 26px var(--font-display); color: var(--gold); }
.char-head #refresh { margin-left: auto; }
.avatar { width: 56px; height: 56px; border-radius: 10px; border: 1px solid var(--gold-dim); object-fit: cover; background: var(--panel); }
.meta { color: var(--text); }
.sync { color: var(--muted); font-size: 12px; margin-top: 2px; }
.cls-rogue { color: #fff569; } .cls-warrior { color: #c79c6e; } .cls-paladin { color: #f58cba; }
.cls-hunter { color: #abd473; } .cls-priest { color: #fff; } .cls-shaman { color: #0070de; }
.cls-mage { color: #69ccf0; } .cls-warlock { color: #9482c9; } .cls-druid { color: #ff7d0a; }

/* Kontroller -------------------------------------------------------------- */
.controls {
  display: grid; grid-template-columns: minmax(180px, 220px) minmax(220px, 300px) 1fr; gap: 16px 28px; align-items: end;
  padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.ctl { display: flex; flex-direction: column; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); border: 0; padding: 0; margin: 0; min-width: 0; }
.ctl legend { padding: 0; margin-bottom: 8px; }
.ctl select { width: 100%; text-transform: none; letter-spacing: 0; font-weight: 500; }
.ctl-level output { color: var(--text); font-weight: 700; text-transform: none; letter-spacing: 0; }
.ctl-level input { accent-color: var(--gold); width: 100%; }
.ctl-toggle { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 13px; text-transform: none; letter-spacing: 0; font-weight: 500; justify-self: end; }
.ctl-toggle input { accent-color: var(--gold); width: 16px; height: 16px; }
.ctl-sources { grid-column: 1 / -1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 8px; cursor: pointer;
  font-size: 13px; font-weight: 500; text-transform: none; letter-spacing: 0;
  color: var(--muted); border: 1px solid var(--line); background: transparent; transition: background .15s, color .15s;
}
.chip span::before { content: ""; width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--line); flex: none; }
.chip input:checked + span { color: var(--text); background: var(--panel-2); border-color: var(--panel-2); }
.chip input:checked + span::before { background: var(--gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%2312141a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat; border-color: var(--gold); }
.chip span:hover { color: var(--text); }
.chip input:focus-visible + span { outline: 2px solid var(--gold); }

/* Sekmeler ---------------------------------------------------------------- */
.tabs { display: flex; gap: 4px; margin: 20px 0 16px; border-bottom: 1px solid var(--line); }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--muted); padding: 10px 14px; font-weight: 600; }
.tabs button[aria-selected=true] { color: var(--text); border-bottom-color: var(--gold); }
.lede { color: var(--muted); max-width: 900px; margin-top: 0; }

/* Paperdoll: slotlar karakterin iki yanında, silahlar altta, ayrıntı en altta */
.gear-layout { display: flex; flex-direction: column; gap: 18px; }
.paperdoll {
  display: grid; gap: 8px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 1.15fr) minmax(0, 1fr);
  grid-template-areas: "left model right" "bottom bottom bottom";
}
.pd-left { grid-area: left; } .pd-right { grid-area: right; } .pd-bottom { grid-area: bottom; }
.pd-col { display: flex; flex-direction: column; gap: 8px; }
.pd-model {
  grid-area: model; position: relative; overflow: hidden; border-radius: 16px; min-height: 560px;
  background: #0b0d12 center / cover no-repeat; box-shadow: inset 0 0 0 1px var(--line);
}
.pd-model::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 55%, rgba(0,0,0,0) 40%, rgba(0,0,0,.55) 100%); }
.pd-model img { position: absolute; left: 50%; top: 50%; width: auto; height: 100%; max-width: none; transform: translate(-50%, -50%); transform-origin: center; pointer-events: none; transition: transform .3s; }
.pd-bottom { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pd-slot {
  display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; text-align: left; padding: 7px 10px 7px 7px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; color: var(--text); position: relative; cursor: pointer;
}
.pd-slot:hover { border-color: #3a4152; background: var(--panel); }
.pd-slot.active { border-color: var(--gold); background: var(--panel); }
.pd-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pd-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.pd-name { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-up {
  flex: none; font-size: 11.5px; font-weight: 700; color: var(--up); background: rgba(47, 211, 148, .12);
  padding: 3px 7px; border-radius: 999px; white-space: nowrap;
}
.pd-slot .icon-md { width: 44px; height: 44px; }

/* İkonlar ----------------------------------------------------------------- */
.icon { display: inline-block; flex: none; border-radius: 6px; border: 2px solid var(--line); background: #000; object-fit: cover; vertical-align: middle; }
.icon-sm { width: 22px; height: 22px; border-width: 1px; border-radius: 4px; }
.icon-md { width: 38px; height: 38px; }
.icon-lg { width: 52px; height: 52px; }
.icon-empty { background: repeating-linear-gradient(45deg, #151a24 0 6px, #11151d 6px 12px); }
.icon-missing {
  background: radial-gradient(circle at 50% 40%, #2a3242 0 30%, #11151d 31%);
  position: relative;
}
.icon-missing::after {
  content: "?"; position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--muted); font-weight: 600; font-size: 60%;
}
img.icon.q-poor { border-color: var(--q-poor); }
img.icon.q-common { border-color: #bbb; }
img.icon.q-uncommon { border-color: var(--q-uncommon); }
img.icon.q-rare { border-color: var(--q-rare); }
img.icon.q-epic { border-color: var(--q-epic); }
img.icon.q-legendary { border-color: var(--q-legendary); }

.q-poor { color: var(--q-poor); }
.q-common { color: var(--q-common); }
.q-uncommon { color: var(--q-uncommon); }
.q-rare { color: var(--q-rare-text); }
.q-epic { color: var(--q-epic); }
.q-legendary { color: var(--q-legendary); }

/* Slot detayı ------------------------------------------------------------- */
.slot-detail { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.sd-head { display: flex; align-items: baseline; gap: 12px; }
.sd-head h2 { margin: 0; font: 700 20px var(--font-display); color: var(--gold); }
.sd-current { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.sd-cur-label, .sd-sub { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.sd-cur-name { font-weight: 600; }
.path { padding: 10px 0; border-bottom: 1px solid var(--line); }
.path-list { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.path-step { display: inline-flex; align-items: center; gap: 5px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; padding: 3px 7px; font-size: 12px; }
.path-step b { color: var(--muted); font-weight: 600; }
.path-arrow { color: var(--muted); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; padding: 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 7px 8px; border-bottom: 1px solid #222937; vertical-align: middle; }
tbody tr:hover td { background: #1c2230; }
.recs .c-item { min-width: 200px; }
.recs .c-item .item-name { display: flex; align-items: center; gap: 8px; }
.recs .c-item .note { font-size: 11px; color: var(--muted); padding-left: 30px; }
.recs .c-stats { color: var(--muted); font-size: 12px; min-width: 160px; }
.recs .c-src { color: var(--muted); font-size: 12px; min-width: 140px; }
.recs .c-score, .recs .c-lvl { font-variant-numeric: tabular-nums; white-space: nowrap; }
.recs tr.is-equipped td { background: rgba(214, 178, 94, .06); }
.empty { color: var(--muted); text-align: center; padding: 20px; }
.diff { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.diff-up { color: var(--up); }
.diff-down { color: var(--down); }
.diff-eq { color: var(--muted); }

/* BiS ve ağırlıklar ------------------------------------------------------- */
.bis { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.bis th:first-child, .bis tbody th { width: 110px; }
.bis tbody th { color: var(--text); text-transform: none; font-size: 13px; letter-spacing: 0; }
.bis-cell { display: flex; align-items: center; gap: 6px; }
.weights-grid { display: grid; grid-template-columns: minmax(260px, 380px) 1fr; gap: 24px; align-items: start; }
.weights { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.weights td:last-child { font-variant-numeric: tabular-nums; text-align: right; }
.weights-notes h3 { font: 700 15px var(--font-display); color: var(--gold); margin: 0 0 6px; }
.weights-notes p { color: var(--muted); margin-top: 0; }
.tag { font-size: 10px; border: 1px solid var(--gold-dim); color: var(--gold); border-radius: 4px; padding: 0 4px; }

/* Tooltip ----------------------------------------------------------------- */
.tooltip {
  position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; max-width: 320px;
  background: rgba(8, 10, 22, .96); border: 1px solid #4a5068; border-radius: 6px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .6); padding: 8px 10px; font-size: 13px; line-height: 1.4; color: #fff;
}
.tt-name { font-weight: 600; font-size: 14px; }
.tt-row { display: flex; justify-content: space-between; gap: 16px; }
.tt-green { color: var(--q-uncommon); }
.tt-dim { color: #ffd100; }
.tt-flavor { color: #ffd100; margin-top: 4px; }
.tt-source { margin-top: 6px; padding-top: 6px; border-top: 1px solid #2c3247; color: var(--muted); font-size: 12px; }
.tt-extra { margin-top: 4px; color: var(--gold); font-size: 12px; }


/* Dar ekran --------------------------------------------------------------- */

@media (max-width: 900px) {
  .controls { grid-template-columns: 1fr 1fr; }
  .ctl-toggle { grid-column: 1 / -1; justify-self: start; }
  .paperdoll { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "model model" "left right" "bottom bottom"; }
  .pd-model { min-height: 420px; }
}
@media (max-width: 640px) {
  .planner { padding: 14px; border-radius: 18px; }
  .char-form { max-width: none; }
  .controls { grid-template-columns: 1fr; }
  .paperdoll { grid-template-columns: 1fr; grid-template-areas: "model" "left" "right" "bottom"; }
  .pd-model { min-height: 360px; }
  .pd-bottom { grid-template-columns: 1fr; }
  /* Trinket'ler mobilde yan yana */
  .pd-right { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .pd-right > .pd-slot { grid-column: 1 / -1; }
  .pd-right > [data-slot^="trinket"] { grid-column: auto; }
  .weights-grid { grid-template-columns: 1fr; }
  .char-head { flex-wrap: wrap; }
  .char-head h2 { font-size: 22px; }
}

/* Boş durum: karakter aranmadan önce */
.planner-empty {
  position: relative; isolation: isolate; overflow: hidden; margin: -24px -24px 0; padding: 48px 32px 30px;
  border-radius: 24px 24px 0 0; background: #0b0d12;
}
.planner-empty::before { content: ""; position: absolute; inset: 0; z-index: -2; background: var(--art) center 35% / cover no-repeat; opacity: .55; }
.planner-empty::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(18, 20, 26, .2), #12141a 92%); }
.planner-empty h2 { margin: 0 0 8px; font: 800 clamp(28px, 3.4vw, 40px)/1.1 var(--font-display); color: #fff; }
.planner-empty p { margin: 0; color: #c9cdd8; font-size: 16px; max-width: 560px; }
.planner-empty[hidden] { display: none; }
.planner-empty:not([hidden]) + .char-form { max-width: 720px; margin-top: 18px; }
.planner-empty:not([hidden]) + .char-form input, .planner-empty:not([hidden]) + .char-form select, .planner-empty:not([hidden]) + .char-form button { padding: 14px 16px; font-size: 16px; }
.planner-steps { list-style: none; margin: 22px 0 6px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.planner-steps li { display: flex; gap: 12px; padding: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.planner-steps b { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 138, 92, .16); color: var(--gold); font-size: 14px; }
.planner-steps strong { display: block; color: var(--text); font-size: 14.5px; }
.planner-steps span { color: var(--muted); font-size: 13px; }
.planner-empty[hidden] ~ .planner-steps { display: none; }
.recent { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 8px; }
.recent > span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; margin-right: 4px; }
.recent[hidden] { display: none; }
.recent-list { display: flex; flex-wrap: wrap; gap: 8px; }
:where(.planner) button.recent-chip { display: inline-flex; align-items: baseline; gap: 8px; background: var(--panel); border: 1px solid var(--line); color: var(--text); padding: 7px 12px; font-weight: 600; font-size: 13.5px; }
:where(.planner) button.recent-chip:hover { border-color: var(--gold); }
.recent-chip small { color: var(--muted); font-weight: 500; font-size: 12px; }
.planner-empty[hidden] ~ .recent { display: none; }
@media (max-width: 720px) {
  .planner-empty { margin: -14px -14px 0; padding: 32px 18px 22px; }
  .planner-steps { grid-template-columns: 1fr; }
}

/* Battle.net ile giriş */
.bnet-row { display: flex; align-items: center; gap: 12px; margin: 4px 0 10px; color: var(--muted); font-size: 13px; }
.bnet-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px; background: #148eff; color: #fff !important; font-weight: 600; text-decoration: none; font-size: 14px; }
.bnet-btn:hover { background: #0a7ae0; }
.planner-empty[hidden] ~ .bnet-row, .planner-empty[hidden] ~ #bnet-chars { display: none; }
