/* ==========================================================================
   EdCatalyst — Tool Page Styles (Crypto Playground)
   Matches index.html's design language: gradients, card shadows, glow
   buttons, terracotta/gold/peacock palette. Full navbar/footer kept.
   (Layers on top of ../../styles/main.css for shared variables.)
   ========================================================================== */

body {
  font-family: 'Poppins', sans-serif;
  background: var(--ec-bg);
}

/* ---------------- Hero (same as index.html hero) ---------------- */
.tool-hero {
  position: relative;
  overflow: hidden;
}

.tool-hero-title {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.15;
  margin: 1rem 0 1rem;
}

.tool-hero-sub {
  font-size: 1.08rem;
  color: var(--ec-ink-soft);
  max-width: 600px;
  margin: 0 auto;
}

/* ---------------- About card (feature-card variant) ---------------- */
.tool-info-card {
  max-width: 760px;
  margin: 0 auto;
  cursor: default;
}

.tool-info-card:hover {
  transform: none;
}

.tool-info-card p,
.tool-info-card:hover p {
  color: var(--ec-ink-soft) !important;
  font-size: 0.97rem;
  line-height: 1.7;
}

.tool-info-card h5,
.tool-info-card:hover h5 {
  color: var(--ec-ink) !important;
  font-weight: 700;
}

.tool-info-card:hover::before {
  opacity: 0;
}

/* ---------------- Main tool card ---------------- */
.tool-card {
  background: var(--ec-card-bg);
  border-radius: 20px;
  padding: 2.2rem;
  box-shadow: var(--ec-shadow-soft);
  border: 1px solid rgba(168, 60, 12, 0.06);
  max-width: 980px;
  margin: 0 auto;
}

.tool-card-title {
  color: var(--ec-terracotta);
  font-weight: 800;
  font-size: 1.4rem;
  margin-bottom: 1.6rem;
}

.tool-card-title i {
  margin-right: 8px;
}

/* ---------------- Form elements ---------------- */
.tool-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--ec-ink-soft);
  margin-bottom: 0.4rem;
  display: block;
}

.tool-input {
  border: 2px solid #f0e2d3;
  border-radius: 10px;
  font-size: 0.92rem;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.tool-input:focus {
  border-color: var(--ec-terracotta);
  box-shadow: 0 0 0 4px rgba(168, 60, 12, 0.1);
  outline: none;
}

.tool-input.mono {
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
}

/* ---------------- Buttons (reuse btn-glow, add a cyan variant) ---------------- */
.btn-glow-cyan {
  background: var(--ec-gradient-3);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 0.85rem 1.8rem;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 12px 28px rgba(31, 111, 168, 0.3);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.btn-glow-cyan:hover {
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(31, 111, 168, 0.4);
}

/* ---------------- Divider / result ---------------- */
.tool-divider {
  border-top: 1px solid rgba(168, 60, 12, 0.1);
  margin: 1.8rem 0;
}

.tool-result-title {
  color: var(--ec-terracotta);
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.8rem;
}

.tool-result-title i {
  margin-right: 6px;
}

.result-box {
  background: #fffaf2;
  border: 2px solid #f0e2d3;
  border-radius: 12px;
  padding: 1rem 1.2rem;
  font-family: 'Courier New', monospace;
  word-break: break-all;
  white-space: pre-wrap;
  color: var(--ec-ink);
  font-size: 0.9rem;
  min-height: 60px;
}

/* ---------------- Warning alert ---------------- */
.tool-alert-warning {
  background: rgba(216, 144, 12, 0.1);
  border: 1px solid rgba(216, 144, 12, 0.3);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  color: var(--ec-ink);
  font-size: 0.9rem;
}

.tool-alert-warning .mono {
  font-family: 'Courier New', monospace;
  background: rgba(216, 144, 12, 0.15);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

/* ---------------- Crypto Playground tabs ---------------- */
.crypto-tabs {
  border-bottom: 2px solid #f0e2d3;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.crypto-tabs .nav-link {
  border: none;
  border-radius: 12px 12px 0 0;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ec-ink-soft);
  padding: 0.7rem 1.2rem;
  transition: all 0.25s ease;
}

.crypto-tabs .nav-link:hover {
  color: var(--ec-terracotta);
  background: rgba(168, 60, 12, 0.05);
  border-color: transparent;
}

.crypto-tabs .nav-link.active {
  color: #fff;
  background: var(--ec-gradient-1);
  border-color: transparent;
}

/* ---------------- Tab section headings ---------------- */
.tool-tab-heading {
  color: var(--ec-terracotta);
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.8rem;
}

.tool-tip {
  color: var(--ec-ink-soft);
  font-size: 0.82rem;
}

/* ---------------- Dynamic param box (cl_params / RSA kv) ---------------- */
.tool-param-box {
  background: #fffaf2;
  border: 1.5px dashed #f0e2d3;
  border-radius: 10px;
  padding: 0.8rem 1rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--ec-ink-soft);
}

.kv {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 6px 12px;
  word-break: break-all;
}

.kv div:nth-child(odd) {
  font-weight: 700;
  color: var(--ec-terracotta);
}

/* ---------------- Analysis table & chips ---------------- */
.tool-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 12px;
  overflow: hidden;
}

.tool-table th {
  background: var(--ec-gradient-1);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.6rem 0.8rem;
  text-align: left;
  border: none;
}

.tool-table td {
  background: #fff;
  font-size: 0.88rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid #f0e2d3;
  color: var(--ec-ink);
}

.tool-table tbody tr:nth-child(even) td {
  background: #fffaf2;
}

.chip {
  display: inline-block;
  padding: 2px 9px;
  background: rgba(168, 60, 12, 0.08);
  color: var(--ec-terracotta);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  margin: 2px;
}

/* Frequency histogram bars (inline-styled height/color stays in JS-rendered HTML;
   this just gives the bars a brand-consistent color via override) */
#an_hist > div > div {
  background: var(--ec-terracotta) !important;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 768px) {
  .tool-hero-title {
    font-size: 1.9rem;
  }
  .tool-card,
  .tool-info-card {
    padding: 1.5rem 1.3rem;
  }
}
