/*
 * crit-calc.css
 * Critical Damage Calculator — loaded only on the crit-calc page via {% block stylesheets %}
 */

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

/* ── Layout ───────────────────────────────────────────────────────── */
.cc-layout {
  display: grid;
  grid-template-columns: 1fr 272px;
}

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

.cc-panel {
  padding: 0 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  overflow: hidden;
}

/* ── Section ──────────────────────────────────────────────────────── */
.cc-section {
  margin-bottom: 32px;
}

.cc-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #383838;
}

.cc-section-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #c8a84b;
  margin: 0;
  padding: 0;
}

.cc-section-result {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}

.cc-result-label {
  color: #a0a0a0;
  font-weight: 600;
}

.cc-result-value {
  font-size: 22px;
  font-weight: 700;
  color: #c8a84b;
  font-variant-numeric: tabular-nums;
}

.cc-result-overcrit {
  font-size: 14px;
  font-weight: 600;
  color: #f0a030;
}

/* ── Card grid ────────────────────────────────────────────────────── */
.cc-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.cc-col {
  display: flex;
  flex-direction: column;
}

.cc-single-col {
  grid-template-columns: 1fr;
}

.cc-col-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #383838;
}

.cc-col-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #c8a84b;
}

.cc-col-title.cc-green { color: #5cb85c; }

.cc-col-total {
  margin-left: auto;
  font-size: 13px;
  color: #606060;
}

/* ── Card base ────────────────────────────────────────────────────── */
.cc-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;
}
.cc-card:hover { background: #2e2e2e; border-color: #4a4a4a; }
.cc-card.cc-active {
  background: rgba(200,168,75,0.08);
  border-color: rgba(200,168,75,0.35);
}

.cc-card-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

/* ── Active bar ───────────────────────────────────────────────────── */
.cc-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;
}
.cc-active .cc-active-bar { opacity: 1; }

/* ── Checkbox ─────────────────────────────────────────────────────── */
.cc-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;
}
.cc-check::after { display: none; }
.cc-check.cc-checked,
.cc-card.cc-active .cc-check {
  border-color: #c8a84b;
  background: #7a6428;
}
.cc-check.cc-checked::after,
.cc-card.cc-active .cc-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 ─────────────────────────────────────────────────────── */
.cc-icon {
  display: block;
  width: 24px; height: 24px;
  flex-shrink: 0;
  border-radius: 3px;
  object-fit: cover;
  transition: filter 0.15s, border-color 0.15s;
}
.cc-link:hover .cc-icon {
  filter: drop-shadow(0 0 5px rgba(234, 179, 8, 0.7));
}
.cc-icon--sq {
  border: 1px solid #4a4a4a;
  border-radius: 3px;
}
.cc-link:hover .cc-icon--sq { border-color: #c8a84b; }
.cc-icon--round {
  border: 1px solid #4a4a4a;
  border-radius: 50%;
}
.cc-link:hover .cc-icon--round { border-color: #c8a84b; }

/* ── Type buttons ─────────────────────────────────────────────────── */
.cc-type-btns { display: flex; gap: 4px; }
.cc-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;
}
.cc-type-btn.cc-active {
  background: #7a6428;
  border-color: #c8a84b;
  color: #e8e8e8;
}

/* ── Name / link ──────────────────────────────────────────────────── */
.cc-name { flex: 1; min-width: 0; display: flex; align-items: center; }
.cc-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;
}
.cc-card.cc-active .cc-link { color: #e8e8e8; }
.cc-link:hover { color: #c8a84b !important; }
.cc-nolink {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 16px; font-weight: 600; line-height: 1; color: #a0a0a0;
}
.cc-card.cc-active .cc-nolink { color: #e8e8e8; }

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

/* ── Slider card ──────────────────────────────────────────────────── */
.cc-slider-card { padding-bottom: 18px; cursor: default; }
.cc-step-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  padding: 0 6.5px;
}
.cc-step-labels span { font-size: 10px; color: #606060; }
.cc-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 3px;
  background: #2e2e2e;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  display: block;
}
.cc-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);
}
.cc-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);
}

/* ── Expand opts ──────────────────────────────────────────────────── */
.cc-expand-opts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px 4px 24px;
  margin-top: 4px;
}

/* ── Always-on card ───────────────────────────────────────────────── */
.cc-always-on {
  background: rgba(92,184,92,0.06);
  border-color: rgba(92,184,92,0.25);
  cursor: default;
}
.cc-always-on .cc-val { color: #5cb85c; }
.cc-always-on .cc-nolink { color: #e8e8e8; }
.cc-always-on-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #5cb85c;
  text-transform: uppercase;
}

/* ── Input label ──────────────────────────────────────────────────── */
.cc-input-label { font-size: 12px; color: #606060; flex-shrink: 0; }

/* ── Utility section ──────────────────────────────────────────────── */
.cc-utils-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.cc-util-box {
  background: #252525;
  border: 1px solid #383838;
  border-radius: 3px;
  padding: 12px;
  min-width: 0;
  overflow: hidden;
}

.cc-util-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #c8a84b;
  margin-bottom: 12px;
}

.cc-util-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.cc-util-label {
  font-size: 11px;
  color: #a0a0a0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cc-util-input {
  max-width: 70px;
  min-width: 50px;
  flex: 1;
  background: #2e2e2e;
  border: 1px solid #383838;
  border-radius: 3px;
  padding: 4px 6px;
  color: #e8e8e8;
  font-size: 13px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  outline: none;
  -moz-appearance: textfield;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.cc-util-input::-webkit-inner-spin-button,
.cc-util-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.cc-util-input:focus { border-color: #c8a84b; }

.cc-util-unit {
  font-size: 13px;
  color: #606060;
  flex-shrink: 0;
}

.cc-util-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(200,168,75,0.06);
  border: 1px solid rgba(200,168,75,0.2);
  border-radius: 3px;
  margin-top: 8px;
}

.cc-util-result-label {
  font-size: 13px;
  color: #a0a0a0;
}

.cc-util-result-value {
  font-size: 18px;
  font-weight: 700;
  color: #c8a84b;
  font-variant-numeric: tabular-nums;
}

.cc-transfer-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #a0a0a0;
  background: #2e2e2e;
  border: 1px solid #383838;
  border-radius: 3px;
  cursor: pointer;
  font-family: 'Rajdhani', sans-serif;
  transition: all 0.15s;
  margin-bottom: 8px;
}
.cc-transfer-btn:hover {
  color: #c8a84b;
  border-color: #c8a84b;
  background: rgba(200,168,75,0.08);
}

/* ── Ring ──────────────────────────────────────────────────────────── */
.cc-ring-box {
  background: #252525;
  border: 1px solid #383838;
  border-radius: 3px;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.cc-ring-stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.cc-ring-stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.cc-ring-stat-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #606060;
}

.cc-ring-stat-val {
  font-size: 28px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-family: 'Rajdhani', sans-serif;
  line-height: 1;
}

.cc-ring-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  color: #606060;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.cc-ring-svg {
  width: 100%;
  max-width: 200px;
  height: auto;
  display: block;
}

.cc-ring-inline {
  margin-bottom: 8px;
}

.cc-ring-inline > div:first-child {
  flex-shrink: 0;
  width: 220px;
}

.cc-ring-inline .cc-ring-svg {
  max-width: 220px;
}

.cc-ring-inline.cc-ring-full {
  width: 100%;
}

.cc-ring-half {
  width: calc(50% - 10px);
}

/* ── Info button (reuse pen-calc pattern) ──────────────────────────── */
.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);
}

.cc-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;
}
.cc-popup-title { font-size: 13px; font-weight: 700; color: #c8a84b; margin-bottom: 5px; }
.cc-popup-body  { font-size: 13px; color: #a0a0a0; line-height: 1.5; }
.cc-popup-body a { text-decoration: none; }
.cc-popup-body a:hover { text-decoration: none; }

/* ── Hidden ────────────────────────────────────────────────────────── */
.cc-hidden { display: none !important; }

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

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

@media (max-width: 1023px) {
  .cc-layout            { grid-template-columns: 1fr; }
  .cc-main              { border-right: none; padding: 0; }
  .cc-card-grid         { grid-template-columns: 1fr; }
  .cc-mobile-only       { display: block; }
  .cc-desktop-only      { display: none !important; }
}
