/* ==========================================================================
   EdCatalyst — Tool Page Styles (Universal Encoder & Decoder)
   Matches index.html's design language. Full navbar/footer kept.
   (Layers on top of ../../styles/main.css for shared variables.)
   ========================================================================== */

body {
  font-family: 'Poppins', sans-serif;
  background: var(--ec-bg);
  /* BUGFIX: encode.js sets inline style="background:var(--light)" on
     successful runs (#statusBadge). --light only existed in this page's
     old removed <style> block and isn't part of the shared main.css
     variables, so without this it would resolve to nothing (transparent).
     Defining it here keeps that existing JS behavior working correctly. */
  --light: #fffaf2;
}

/* ---------------- 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;
}

/* ---------------- Mode radio row ---------------- */
.enc-mode-row {
  margin-top: 0.4rem;
}

.enc-mode-row .custom-control-label {
  color: var(--ec-ink-soft);
  font-weight: 600;
  font-size: 0.92rem;
}

.enc-mode-row .custom-control-input:checked ~ .custom-control-label::before {
  background-color: var(--ec-terracotta);
  border-color: var(--ec-terracotta);
}

/* ---------------- Status badge ---------------- */
.enc-status-badge {
  background: #fffaf2;
  color: var(--ec-terracotta-dark);
  border: 1.5px solid #f0c896;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.25s ease;
}

.enc-status-badge.status-error {
  background: #fff0f0;
  border-color: #f5b1b1;
  color: #9d2222;
}

/* ---------------- Outline danger glow button ---------------- */
.btn-outline-danger-glow {
  background: transparent;
  border: 2px solid #f5b1b1;
  color: #c22323;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 14px;
  padding: 0.7rem 1.4rem;
  transition: all 0.25s ease;
}

.btn-outline-danger-glow:hover {
  background: #c22323;
  color: #fff;
  border-color: transparent;
  transform: translateY(-2px);
}

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