/* =========================================================
   STYLES-TOOLS.CSS
   Shared styling for Tools landing page + individual tool pages
   Matches the Home page typography and navigation style.
   ========================================================= */

/* ----------------------------------------------
   GLOBAL TYPOGRAPHY
---------------------------------------------- */
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Helvetica, Arial, sans-serif;
  color: #111827;
  background: #f3f4f6;
}

h1, h2, h3, h4 {
  font-family: "Times New Roman", "Georgia", serif;
  font-weight: 700;
}

/* ----------------------------------------------
   TOOLS LANDING HEADER
---------------------------------------------- */
.site-header {
  text-align: center;
  padding: 3rem 2rem;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #ffffff;
}

.site-header h1 {
  margin: 0 0 0.5rem;
  font-family: "Times New Roman", "Georgia", serif;
  font-size: 3.2rem;
  line-height: 1.2;
}

.tagline {
  opacity: 0.9;
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  line-height: 1.6;
}

/* ----------------------------------------------
   NAVIGATION PILLS
---------------------------------------------- */
.pill-nav,
.main-nav {
  display: inline-flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.pill-nav a,
.main-nav a {
  text-decoration: none;
  padding: 0.4rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  font-weight: 500;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  transition: 0.2s ease;
}

.pill-nav a:hover,
.pill-nav a.active,
.main-nav a:hover,
.main-nav a.active {
  background: #ffffff;
  color: #1d4ed8;
}

/* =====================================================
   TOOLS LANDING PAGE CONTENT
===================================================== */
.content-wrapper {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem 3rem;
}

.card {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.75rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
}

.card h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.card p {
  margin-top: 0;
  margin-bottom: 0;
  line-height: 1.7;
  font-size: 0.98rem;
  color: #374151;
}

/* Section title badge */
.section-title {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.25rem 0.8rem;
  border-radius: 10px;
  border-left: 5px solid #7c3aed;
  background: #f3e8ff;
  color: #5b21b6;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.2px;
}

/* Tool grid for landing page */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

/* Tool boxes for landing page */
.tool-box {
  background: #faf5ff;
  border: 1px solid #e9d5ff;
  border-radius: 14px;
  padding: 1rem 1.1rem;
  transition: 0.2s ease;
}

.tool-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.08);
}

.tool-box a {
  text-decoration: none;
  color: #1f2937;
}

.tool-box a:hover {
  color: #5b21b6;
}

.tool-box h3 {
  margin-top: 0;
  margin-bottom: 0.6rem;
}

.tool-box p {
  margin: 0;
  line-height: 1.7;
  font-size: 0.96rem;
  color: #4b5563;
}

.coming-soon {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  background: #f9fafb;
  border-left: 4px solid #7c3aed;
  border-radius: 12px;
  color: #4b5563;
  line-height: 1.7;
  font-size: 0.96rem;
}

/* =====================================================
   TOOL PAGE LAYOUT
   For individual calculator pages
===================================================== */
.tool-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

/* ----------------------------------------------
   HERO BANNER INSIDE TOOL PAGE
---------------------------------------------- */
.tool-hero {
  background: linear-gradient(135deg, #0f172a, #1e3a8a, #0f766e);
  color: #ffffff;
  border-radius: 24px;
  padding: 2.25rem 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22);
}

.tool-hero h1 {
  margin: 0 0 0.6rem 0;
  font-family: "Times New Roman", "Georgia", serif;
}

.tool-hero p {
  max-width: 780px;
  line-height: 1.7;
  margin-bottom: 0;
}

.tool-pill {
  display: inline-block;
  padding: 0.45rem 1rem;
  margin-bottom: 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #111827;
  font-weight: 600;
  font-size: 0.95rem;
}

/* ----------------------------------------------
   GRID LAYOUTS
---------------------------------------------- */
.tool-grid-equal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.tool-grid-split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.5rem;
}

.full-width {
  grid-column: 1 / -1;
}

/* ----------------------------------------------
   CARDS
---------------------------------------------- */
.tool-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 1.4rem;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  margin-bottom: 1.5rem;
}

.tool-card h2,
.tool-card h3 {
  margin-top: 0;
}

.tool-card p:last-child,
.tool-card ul:last-child,
.tool-card ol:last-child {
  margin-bottom: 0;
}

/* ----------------------------------------------
   FORM LAYOUT
---------------------------------------------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-group label {
  font-weight: 600;
  display: block;
  margin-bottom: 0.3rem;
  line-height: 1.35;
}

.form-group small {
  display: block;
  margin-top: 0.25rem;
  color: #64748b;
  line-height: 1.4;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  font: inherit;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* ----------------------------------------------
   TOGGLE / MODE BUTTONS
---------------------------------------------- */
.toggle-row {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.toggle-row button,
.mode-tab {
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1rem;
  background: #e2e8f0;
  color: #111827;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  transition: 0.2s ease;
}

.toggle-row button:hover,
.mode-tab:hover {
  background: #d8e1eb;
}

.toggle-row button.active,
.mode-tab.active {
  background: #0f766e;
  color: #ffffff;
}

/* Panels for switching modes */
.mode-panel {
  display: none;
}

.mode-panel.active {
  display: block;
}

/* ----------------------------------------------
   ACTION BUTTONS
---------------------------------------------- */
.tool-btn {
  width: 100%;
  border: none;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  font-weight: 600;
  background: linear-gradient(135deg, #0f766e, #2563eb);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  transition: 0.2s ease;
}

.tool-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.18);
}

.button-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.secondary-btn {
  background: #e2e8f0;
  color: #111827;
}

.secondary-btn:hover {
  box-shadow: none;
}

/* ----------------------------------------------
   RESULTS LAYOUT
---------------------------------------------- */
.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin-top: 1rem;
}

.result-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 0.85rem 0.9rem;
}

.result-box h4,
.result-box h5 {
  margin: 0 0 0.28rem 0;
  line-height: 1.28;
}

.result-box .value-small {
  font-size: 1.02rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.3;
}

.result-box .value-vector {
  font-family: "SFMono-Regular", Consolas, Monaco, monospace;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.2;
  word-break: break-word;
}

.result-value-sm {
  font-size: 1.02rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.3;
}

.result-value-xs {
  font-size: 0.95rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.28;
}

.vector-output-sm {
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.2;
  word-break: break-word;
}

.result-subtext {
  margin-top: 0.25rem;
  color: #475569;
  font-size: 0.94rem;
  line-height: 1.45;
}

.vector-output {
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 0.95rem;
  line-height: 1.55;
  word-break: break-word;
}

/* ----------------------------------------------
   INFO / NOTE BOXES
---------------------------------------------- */
.note-box {
  background: #f8fafc;
  border-left: 4px solid #0f766e;
  padding: 0.9rem;
  margin-top: 1rem;
  border-radius: 10px;
}

.warning-box {
  background: #fff7ed;
  border-left: 4px solid #f97316;
  padding: 0.9rem;
  border-radius: 10px;
  margin-top: 1rem;
}

.interpret-box {
  background: #f8fafc;
  border-left: 4px solid #0f766e;
  padding: 1rem;
  border-radius: 12px;
  margin-top: 1rem;
}

/* ----------------------------------------------
   ORBIT SKETCH / SVG AREA
---------------------------------------------- */
.orbit-sketch {
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 0 6px;
}

.orbit-sketch svg {
  width: 100%;
  max-width: 680px;
  height: auto;
}

/* ----------------------------------------------
   PLOT CONTAINER
---------------------------------------------- */
.plot-box {
  width: 100%;
  min-height: 420px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  margin-top: 1rem;
  overflow: hidden;
  background: #ffffff;
}

.plot-box.compact {
  min-height: 320px;
}

/* ----------------------------------------------
   TRANSFORMATION MATRIX TABLE
---------------------------------------------- */
.matrix-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
}

.matrix-table th,
.matrix-table td {
  border: 1px solid #e2e8f0;
  padding: 0.7rem;
  text-align: center;
  vertical-align: middle;
}

.matrix-table th {
  background: #f8fafc;
  font-weight: 600;
}

/* ----------------------------------------------
   MATH BLOCKS
---------------------------------------------- */
.math-block {
  background: #0f172a;
  color: #f8fafc;
  border-radius: 14px;
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
}

.math-block.center {
  text-align: center;
}

/* ----------------------------------------------
   SMALL HELPERS
---------------------------------------------- */
.muted {
  color: #64748b;
}

.centered {
  text-align: center;
}

.spacer-top {
  margin-top: 1rem;
}

.spacer-lg {
  margin-top: 1.5rem;
}

.back-link-row {
  margin-top: 40px;
  text-align: left;
}

.back-link {
  color: inherit;
  text-decoration: underline;
  font: inherit;
}

/* ----------------------------------------------
   FOOTER
---------------------------------------------- */
.site-footer,
footer {
  text-align: center;
  padding: 1.5rem 0;
  font-size: 0.9rem;
  color: #4b5563;
  line-height: 1.6;
}

/* ----------------------------------------------
   MOBILE LAYOUT
---------------------------------------------- */
@media (max-width: 900px) {
  .tool-grid,
  .tool-grid-equal,
  .tool-grid-split,
  .form-grid,
  .results-grid {
    grid-template-columns: 1fr;
  }

  .tool-page {
    padding: 1.5rem 1rem 3rem;
  }

  .tool-hero {
    padding: 1.8rem 1.25rem;
  }

  .tool-card {
    padding: 1.15rem;
  }

  .button-row {
    flex-direction: column;
  }

  .site-header {
    padding: 2.5rem 1rem;
  }

  .site-header h1 {
    font-size: 2.4rem;
  }

  .pill-nav,
  .main-nav {
    gap: 0.5rem;
  }
}
