/*
 * pen-calc.css
 * Penetration Calculator — loaded only on the pen-calc page via {% block stylesheets %}
 */

/* ── Reset helpers ─────────────────────────────────────────────────── */
#pen-calc *, #pen-calc *::before, #pen-calc *::after { box-sizing: border-box; }

/* ── Layout ────────────────────────────────────────────────────────── */
.pc-layout {
  display: grid;
  grid-template-columns: 1fr 272px;
  min-height: calc(100vh - 90px);
}

.pc-main {
  padding: 20px 24px;
  border-right: 1px solid #383838;
}

.pc-panel {
  padding: 20px 16px;
  position: sticky;
  top: 0;
  height: calc(100vh - 90px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Buff columns grid ─────────────────────────────────────────────── */
.pc-buff-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.pc-buff-col { display: flex; flex-direction: column; }

/* ── Section header ────────────────────────────────────────────────── */
.pc-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #383838;
}
.pc-section-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #c8a84b;
}
.pc-section-title.pc-green { color: #5cb85c; }
.pc-section-total { margin-left: auto; font-size: 13px; color: #606060; }
.pc-gold-bold  { color: #c8a84b; font-weight: 700; }
.pc-green-bold { color: #5cb85c; font-weight: 700; }
.pc-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  color: #606060;
  text-transform: uppercase;
  margin-bottom: 6px;
}

/* ── Card base ─────────────────────────────────────────────────────── */
.pc-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  background: #252525;
  border: 1px solid #383838;
  border-radius: 3px;
  padding: 8px 12px;
  margin-bottom: 3px;
  min-height: 42px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.pc-card:hover { background: #2e2e2e; border-color: #4a4a4a; }
.pc-card.pc-active {
  background: rgba(200,168,75,0.08);
  border-color: rgba(200,168,75,0.35);
}
.pc-card-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

/* ── Active bar ────────────────────────────────────────────────────── */
.pc-active-bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: #c8a84b;
  border-radius: 3px 0 0 3px;
  opacity: 0;
  transition: opacity 0.15s;
}
.pc-active .pc-active-bar { opacity: 1; }
.pc-active-bar-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  bottom: auto; width: auto;
  border-radius: 3px 3px 0 0;
}

/* ── Checkbox ──────────────────────────────────────────────────────── */
.pc-check {
  width: 20px; height: 20px;
  flex-shrink: 0;
  border-radius: 3px;
  border: 1.5px solid #4a4a4a;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  transition: border-color 0.15s, background 0.15s;
}
.pc-check::after { display: none; }
.pc-check.pc-checked {
  border-color: #c8a84b;
  background: #7a6428;
}
.pc-check.pc-checked::after {
  display: block;
  content: "";
  width: 12px; height: 9px;
  background: url("data:image/svg+xml,%3Csvg width='12' height='9' viewBox='0 0 12 9' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 4.5L4.5 8L11 1' stroke='%23c8a84b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center;
}
.pc-toggle.pc-active .pc-check {
  border-color: #c8a84b;
  background: #7a6428;
}
.pc-toggle.pc-active .pc-check::after {
  display: block;
  content: "";
  width: 12px; height: 9px;
  background: url("data:image/svg+xml,%3Csvg width='12' height='9' viewBox='0 0 12 9' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 4.5L4.5 8L11 1' stroke='%23c8a84b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center;
}

/* ── Card icon ─────────────────────────────────────────────────────── */
.pc-icon {
  display: block;
  width: 28px; height: 28px;
  flex-shrink: 0;
  border-radius: 3px;
  object-fit: cover;
  transition: filter 0.15s, border-color 0.15s;
}
.pc-link:hover .pc-icon {
  filter: drop-shadow(0 0 5px rgba(234, 179, 8, 0.7));
}

/* Square game icon (ability, gear, enchantment, etc.) — slight rounding */
.pc-icon--sq {
  border: 1px solid #4a4a4a;
  border-radius: 3px;
}
.pc-link:hover .pc-icon--sq {
  border-color: #c8a84b;
}

/* Circular icon (buff/debuff, champion star, mundus stone) */
.pc-icon--round {
  border: 1px solid #4a4a4a;
  border-radius: 50%;
}
.pc-link:hover .pc-icon--round {
  border-color: #c8a84b;
}

/* ── Name / link ───────────────────────────────────────────────────── */
.pc-name { flex: 1; min-width: 0; display: flex; align-items: center; }
.pc-link {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 16px; font-weight: 600; line-height: 1;
  color: #a0a0a0;
  text-decoration: none;
  transition: color 0.15s;
  white-space: nowrap;
}
.pc-card.pc-active .pc-link { color: #e8e8e8; }
.pc-link:hover { color: #c8a84b !important; }
.pc-nolink {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 16px; font-weight: 600; line-height: 1; color: #a0a0a0;
}
.pc-card.pc-active .pc-nolink { color: #e8e8e8; }

/* ── Value badge ───────────────────────────────────────────────────── */
.pc-val {
  font-size: 16px; font-weight: 700;
  color: #606060;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  transition: color 0.15s;
}
.pc-card.pc-active .pc-val { color: #c8a84b; }

/* ── Info button ───────────────────────────────────────────────────── */
.pc-info-btn {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 1px solid #4a4a4a;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 10px; font-weight: 700;
  color: #606060;
  flex-shrink: 0;
  font-family: 'Rajdhani', sans-serif;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  padding: 0;
  line-height: 1;
}
.pc-info-btn:hover {
  border-color: #c8a84b;
  color: #c8a84b;
  background: rgba(200, 168, 75, 0.12);
}

/* ── Type buttons ──────────────────────────────────────────────────── */
.pc-type-btns { display: flex; gap: 4px; }
.pc-type-btn {
  font-size: 12px; font-weight: 600;
  padding: 2px 8px;
  background: #2e2e2e;
  border: 1px solid #383838;
  border-radius: 2px;
  color: #a0a0a0;
  cursor: pointer;
  font-family: 'Rajdhani', sans-serif;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.pc-type-btn.pc-active {
  background: #7a6428;
  border-color: #c8a84b;
  color: #e8e8e8;
}

/* ── Toggle button (Infused, Torug) ────────────────────────────────── */
.pc-toggle-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600;
  padding: 2px 8px;
  background: #2e2e2e;
  border: 1px solid #383838;
  border-radius: 2px;
  color: #a0a0a0;
  cursor: pointer;
  font-family: 'Rajdhani', sans-serif;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.pc-toggle-btn.pc-active { background: #7a6428; border-color: #c8a84b; color: #e8e8e8; }
.pc-toggle-btn-icon {
  width: 16px; height: 16px;
  border-radius: 2px;
  object-fit: cover;
  flex-shrink: 0;
}

/* ── Crusher opts row ──────────────────────────────────────────────── */
.pc-crusher-opts {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 24px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.pc-divider-v { width: 1px; height: 16px; background: #383838; flex-shrink: 0; }

/* ── Lover opts (sub-slider) ───────────────────────────────────────── */
.pc-lover-opts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px 4px 24px;
  margin-top: 4px;
}

/* ── Slider card ───────────────────────────────────────────────────── */
.pc-slider-card { padding-bottom: 18px; cursor: default; }
.pc-step-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  padding: 0 6.5px;
}
.pc-step-labels span { font-size: 10px; color: #606060; }
.pc-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 3px;
  background: #2e2e2e;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  display: block;
}
.pc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px; height: 13px;
  background: #c8a84b;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #111;
  box-shadow: 0 0 4px rgba(200,168,75,0.5);
}
.pc-slider::-moz-range-thumb {
  width: 13px; height: 13px;
  background: #c8a84b;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #111;
  box-shadow: 0 0 4px rgba(200,168,75,0.5);
}

/* ── Stat input row ────────────────────────────────────────────────── */
.pc-stat-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 24px;
  margin-top: 8px;
}
.pc-input-label { font-size: 12px; color: #606060; flex-shrink: 0; }
.pc-num-input {
  flex: 1;
  background: #2e2e2e;
  border: 1px solid #383838;
  border-radius: 3px;
  padding: 3px 8px;
  color: #e8e8e8;
  font-size: 13px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  outline: none;
  -moz-appearance: textfield;
  transition: border-color 0.15s;
}
.pc-num-input::-webkit-inner-spin-button,
.pc-num-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.pc-num-input:focus { border-color: #c8a84b; }

/* ── Enemy selector ────────────────────────────────────────────────── */
.pc-enemy-col { display: flex; flex-direction: column; gap: 5px; }
.pc-enemy-row { display: flex; flex-direction: row; gap: 5px; }
.pc-enemy-row .pc-enemy-card { flex: 1; min-width: 0; overflow: hidden; padding: 7px 8px; }
.pc-enemy-row .pc-enemy-inner { min-width: 0; flex-wrap: wrap; gap: 4px; }
.pc-enemy-row .pc-enemy-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.pc-enemy-row .pc-enemy-armor { font-size: 11px; margin-left: 0; }
.pc-enemy-card {
  display: flex;
  align-items: center;
  position: relative;
  padding: 9px 12px;
  border-radius: 3px;
  cursor: pointer;
  background: #252525;
  border: 1px solid #383838;
  transition: background 0.15s, border-color 0.15s;
}
.pc-enemy-card.pc-active { background: rgba(200,168,75,0.08); border-color: rgba(200,168,75,0.35); }
.pc-enemy-inner { display: flex; align-items: center; gap: 8px; width: 100%; }
.pc-enemy-name { font-size: 14px; font-weight: 700; color: #a0a0a0; flex: 1; }
.pc-enemy-card.pc-active .pc-enemy-name { color: #e8e8e8; }
.pc-enemy-armor { font-size: 13px; color: #c8a84b; font-weight: 600; font-variant-numeric: tabular-nums; margin-left: auto; }

/* ── Ring ──────────────────────────────────────────────────────────── */
.pc-ring-svg { width: 100%; max-width: 220px; height: auto; display: block; margin: 0 auto; }

/* ── Stats block ───────────────────────────────────────────────────── */
.pc-stats { border: 1px solid #383838; border-radius: 3px; overflow: hidden; }
.pc-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 12px;
  border-bottom: 1px solid #383838;
}
.pc-stat-row:last-child { border-bottom: none; }
.pc-stat-row-alt { background: #252525; }
.pc-stat-label { font-size: 13px; color: #a0a0a0; }
.pc-stat-val { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ── Ring card (mobile) ────────────────────────────────────────────── */
.pc-ring-card {
  background: #252525;
  border: 1px solid #383838;
  border-radius: 3px;
  padding: 16px;
  margin-bottom: 16px;
}

/* ── Mobile sticky bar ─────────────────────────────────────────────── */
.pc-sticky-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #252525;
  border: 1px solid #383838;
  border-radius: 0 0 4px 4px;
  padding: 8px 16px;
}
.pc-sticky-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
}
.pc-sticky-label { font-size: 11px; font-weight: 600; letter-spacing: 1.5px; color: #606060; text-transform: uppercase; }
.pc-sticky-val   { margin-left: auto; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pc-sticky-pct   { font-size: 16px; font-weight: 700; min-width: 40px; text-align: right; }
.pc-sticky-track { height: 3px; background: #2e2e2e; border-radius: 2px; overflow: hidden; }
.pc-sticky-fill  { height: 100%; border-radius: 2px; transition: width 0.35s cubic-bezier(0.4,0,0.2,1), background 0.35s; }

/* ── Updated banner ────────────────────────────────────────────────── */
.pc-updated-banner {
  font-size: 13px;
  color: #5cb85c;
  border: 1px solid rgba(92,184,92,0.3);
  border-radius: 3px;
  padding: 8px 12px;
  margin-bottom: 16px;
  background: rgba(92,184,92,0.05);
}

/* ── Info popup portal ─────────────────────────────────────────────── */
.pc-popup-portal {
  position: fixed;
  z-index: 99999;
  width: 260px;
  background: #1a1a1a;
  border: 1px solid #c8a84b;
  border-radius: 4px;
  padding: 10px 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.8);
  pointer-events: auto;
}
.pc-popup-title { font-size: 13px; font-weight: 700; color: #c8a84b; margin-bottom: 5px; }
.pc-popup-body  { font-size: 13px; color: #a0a0a0; line-height: 1.5; }
.pc-popup-body a { text-decoration: none; }
.pc-popup-body a:hover { text-decoration: none; }

/* ── Credit line ───────────────────────────────────────────────────── */
.pc-credit {
  text-align: center;
  font-size: 13px;
  color: #606060;
  padding: 20px 16px;
  border-top: 1px solid #2a2520;
  margin-top: 8px;
}
.pc-credit a { color: #c8a84b; text-decoration: none; }
.pc-credit a:hover { color: #e8e8e8; }

/* ── Scrollbar ─────────────────────────────────────────────────────── */
#pen-calc ::-webkit-scrollbar       { width: 4px; }
#pen-calc ::-webkit-scrollbar-track { background: #1c1917; }
#pen-calc ::-webkit-scrollbar-thumb { background: #383838; border-radius: 2px; }

/* ── Utility ───────────────────────────────────────────────────────── */
.pc-hidden { display: none !important; }

/* ── Responsive ────────────────────────────────────────────────────── */
.pc-mobile-only  { display: none; }
.pc-desktop-only { display: flex; }

/* ── Custom input card ────────────────────────────────────────────── */
.pc-custom-card { cursor: default; margin-top: 8px; }
.pc-custom-card .pc-name { font-size: 16px; font-weight: 600; color: #888; }
.pc-custom-input {
  max-width: 72px;
  background: #2e2e2e;
  border: 1px solid #383838;
  border-radius: 5px;
  color: #e0e0e0;
  font-size: 13px;
  padding: 4px 6px;
  text-align: center;
  -moz-appearance: textfield;
}
.pc-custom-input::-webkit-inner-spin-button,
.pc-custom-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.pc-custom-input:focus { border-color: #c8a84b; outline: none; }

@media (max-width: 1023px) {
  .pc-layout            { grid-template-columns: 1fr; }
  .pc-main              { border-right: none; padding: 16px; }
  .pc-buff-grid         { grid-template-columns: 1fr; }
  .pc-panel             { display: none; }
  .pc-mobile-only       { display: block; }
  .pc-desktop-only      { display: none; }
  .pc-ring-card         { margin-top: 12px; }
  .pc-enemy-row         { margin-bottom: 0; }
}
