/* ============================================================================
   integer-base.css — Tool-spezifische Styles für INTEGER BASE CONVERTER
   Geladen auf: tools/integer-base.php  (NACH main-vhc.css)
   Alle Selektoren auf .ib-* / IDs gescopet — keine globalen Element-Selektoren.
   ============================================================================ */

/* ── Seitenbereich (Zentrierung) ─────────────────── */

body.tool-page main {
  flex: 1;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 36px 20px 52px;
}

/* ── Tool-Header ─────────────────────────────────── */

.ib-header {
  text-align: center;
  margin-bottom: 2.2rem;
}

.ib-icon {
  width: 96px;
  height: 96px;
  display: block;
  margin: 0 auto 1rem;
  filter: drop-shadow(0 0 24px rgba(0, 245, 255, 0.35));
}

.ib-title {
  font-family: 'Orbitron', 'Segoe UI', system-ui, sans-serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--neon1);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-shadow: 0 0 24px rgba(0, 229, 255, 0.45);
  margin: 0 0 0.5rem 0;
}

.ib-subtitle {
  font-size: 0.78rem;
  font-weight: 500;
  color: #84a2c6;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin: 0;
}

/* ── Wrapper / Grid ──────────────────────────────── */

.tool-wrap {
  width: 100%;
  max-width: 900px;
}

.ib-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
}

/* ── Karte ───────────────────────────────────────── */

.ib-card {
  --ib-acc: #00f5ff;
  position: relative;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(0, 245, 255, 0.05), transparent 55%),
    linear-gradient(180deg, #0d1626, #0a1120);
  border: 1px solid var(--border);
  border-left: 3px solid var(--ib-acc);
  border-radius: 6px;
  padding: 1.1rem 1.2rem 1.25rem;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
}

.ib-card:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35),
              0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  transform: translateY(-2px);
}

.ib-card[data-accent="cyan"]   { --ib-acc: #00f5ff; }
.ib-card[data-accent="green"]  { --ib-acc: #00ff88; }
.ib-card[data-accent="violet"] { --ib-acc: #9d6bff; }
.ib-card[data-accent="amber"]  { --ib-acc: #ffb454; }

/* ── Kartenkopf ──────────────────────────────────── */

.ib-card-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.ib-card-het {
  min-width: 0;
  padding-right: 2rem;   /* Platz für das Info-i oben rechts */
}

/* ── Info-i pro Kachel (Basis-Look aus .info-i in main-vhc.css) ── */

.ib-info {
  position: absolute;
  top: 0;
  right: 0;
  cursor: pointer;
  pointer-events: auto;
  padding: 0;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.ib-info:hover,
.ib-info.active {
  background: rgba(30, 144, 255, 0.25);
  box-shadow: 0 0 12px rgba(30, 144, 255, 0.6);
}

/* ── Schwebendes Info-Popover ────────────────────── */

.ib-tooltip {
  position: fixed;
  z-index: 9999;
  background: #0d1220;
  border: 1px solid rgba(30, 144, 255, 0.5);
  border-radius: 6px;
  padding: 10px 14px;
  max-width: 280px;
  font-family: 'Exo 2', 'Segoe UI', system-ui, sans-serif;
  font-size: 0.78rem;
  color: var(--text);
  line-height: 1.55;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(30, 144, 255, 0.1);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s, transform 0.15s;
}

.ib-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.ib-card-title {
  font-family: 'Orbitron', 'Segoe UI', system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text);
  margin: 0.15rem 0 0.3rem 0;
}

.ib-card-desc {
  font-size: 0.8rem;
  line-height: 1.5;
  color: #84a2c6;
  font-weight: 500;
  margin: 0;
}

/* ── Monospace für technische Werte ──────────────── */

.ib-mono {
  font-family: 'Consolas', 'Courier New', monospace;
  letter-spacing: 0.02em;
}

/* ── Eingabefelder ───────────────────────────────── */

.ib-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ib-field-lbl {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #84a2c6;
}

.ib-field-lbl em {
  font-style: normal;
  color: #84a2c6;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.ib-field-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.ib-in {
  flex: 1;
  min-width: 0;
  width: 100%;
  background: #0a101e;
  border: 1px solid #243859;
  color: var(--text);
  font-size: 1rem;
  font-family: 'Exo 2', 'Segoe UI', system-ui, sans-serif;
  padding: 0.55rem 0.75rem;
  border-radius: 3px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ib-in.ib-mono {
  font-family: 'Consolas', 'Courier New', monospace;
}

.ib-in:focus {
  border-color: var(--ib-acc);
  box-shadow: 0 0 0 2px rgba(0, 245, 255, 0.08);
}

.ib-in::placeholder {
  color: #4a6488;
}

.ib-in.ib-invalid {
  border-color: #ff5d73;
  box-shadow: 0 0 0 2px rgba(255, 93, 115, 0.1);
}

/* ── Schnellzugriff-Raster ───────────────────────── */

.ib-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

/* ── Freie Umrechnung ────────────────────────────── */

.ib-conv {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.ib-field--narrow {
  min-width: 0;
}

/* ── Two's-Complement-Kopf ───────────────────────── */

.ib-tc-top {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0.9rem;
  margin-bottom: 1rem;
  align-items: start;
}

.ib-width-btns {
  display: flex;
  gap: 0.4rem;
}

.ib-width {
  flex: 1;
  background: #0a101e;
  border: 1px solid #2e4a72;
  color: #84a2c6;
  font-weight: 500;
  font-size: 0.8rem;
  font-family: 'Consolas', 'Courier New', monospace;
  padding: 0.5rem 0.4rem;
  cursor: pointer;
  border-radius: 3px;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.ib-width:hover:not(.active) {
  border-color: #34507a;
  color: var(--neon1);
}

.ib-width.active {
  background: rgba(255, 180, 84, 0.08);
  border-color: var(--ib-acc);
  color: var(--ib-acc);
}

/* ── Buttons (Idle: muted, Hover: neon1) ─────────── */

.ib-btn,
.ib-copy {
  background: #0a101e;
  border: 1px solid #2e4a72;
  color: #84a2c6;
  font-weight: 500;
  font-size: 0.76rem;
  font-family: 'Exo 2', 'Segoe UI', system-ui, sans-serif;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  border-radius: 3px;
  white-space: nowrap;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.ib-btn:hover,
.ib-copy:hover {
  border-color: var(--neon1);
  color: var(--neon1);
}

.ib-copy {
  flex: 0 0 auto;
}

.ib-copy.ib-copied {
  border-color: var(--neon4, #00ff88);
  color: var(--neon4, #00ff88);
}

.ib-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.9rem;
}

/* ── Ergebnis-Panel ──────────────────────────────── */

.ib-out {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: #070c16;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.6rem 0.9rem;
}

.ib-out-lbl {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #84a2c6;
  flex: 0 0 auto;
}

.ib-result {
  flex: 1;
  min-width: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ib-acc);
  text-shadow: 0 0 18px -4px var(--ib-acc);
  word-break: break-all;
  text-align: right;
}

/* ── Bit-Gruppen ─────────────────────────────────── */

.ib-bits {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.ib-bit-block {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ib-bit-lbl {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #84a2c6;
}

.ib-bit-val,
.ib-tc-val {
  display: block;
  background: #070c16;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.6rem 0.85rem;
  font-size: 1rem;
  color: var(--text);
  word-break: break-all;
  line-height: 1.6;
}

/* ── Two's-Complement-Ausgabe ────────────────────── */

.ib-tc-out {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.ib-tc-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ib-tc-lbl {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #84a2c6;
}

/* ── Hinweis-/Fehlerzeile ────────────────────────── */

.ib-msg {
  font-size: 0.74rem;
  font-weight: 500;
  color: #84a2c6;
  font-family: 'Consolas', 'Courier New', monospace;
  margin: 0.7rem 0 0 0;
  min-height: 1rem;
  line-height: 1.5;
}

.ib-msg.ib-err {
  color: #ff8a99;
}

/* ── Responsive ──────────────────────────────────── */

@media (max-width: 680px) {
  .ib-title {
    font-size: 2rem;
  }
  .ib-fields {
    grid-template-columns: 1fr;
  }
  .ib-conv {
    grid-template-columns: 1fr;
  }
  .ib-tc-top {
    grid-template-columns: 1fr;
  }
  .ib-out {
    flex-wrap: wrap;
  }
  .ib-result {
    text-align: left;
  }
}
