/* ===========================================================================
   NexMinds - one stylesheet for the whole site.
   Edit colours and spacing here and every page follows.

   Sections:
     1. Theme variables (light + dark)
     2. Base elements
     3. Header and navigation
     4. Footer
     5. Layout (main, hero, category grid, cards)
     6. Tool interface (boxes, forms, buttons, output, tables)
     7. Ad slots
     8. SEO content + FAQ
     9. Responsive breakpoints
   =========================================================================== */

/* 1. Theme variables ------------------------------------------------------- */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --accent: #f5610f;
  --accent-hover: #d8540b;
  --border: #e2e8f0;
  --ad-bg: #f1f5f9;
  --error: #dc2626;
  --success: #16a34a;

  --font-heading: 'Futura', 'Trebuchet MS', Arial, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;

  --max-width: 900px;
  --radius: 10px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent: #fb7a2a;
  --accent-hover: #fc8f4d;
  --border: #334155;
  --ad-bg: #1e293b;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

/* 2. Base elements --------------------------------------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  line-height: 1.25;
}

img {
  max-width: 100%;
  height: auto;
}

/* 3. Header and navigation ------------------------------------------------- */
.site-header {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: inline-flex;
  align-items: center;
}

.logo img {
  height: 34px;
  width: auto;
  display: block;
  border-radius: 6px;
}

.logo:hover {
  text-decoration: none;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.main-nav a {
  color: var(--text-secondary);
  font-weight: 500;
}

.main-nav a:hover {
  color: var(--accent);
  text-decoration: none;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  color: var(--text-primary);
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.9rem;
}

.theme-toggle:hover {
  border-color: var(--accent);
}

/* Hamburger button, hidden until the layout gets narrow */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background-color: var(--text-primary);
  border-radius: 2px;
}

/* 4. Footer ---------------------------------------------------------------- */
.site-footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 2rem;
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-heading {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.footer-col a {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.footer-col a:hover {
  color: var(--accent);
}

.footer-note {
  color: var(--text-secondary);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}

.footer-copy {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* 5. Layout ---------------------------------------------------------------- */
main {
  max-width: var(--max-width);
  margin: 2.5rem auto;
  padding: 0 1.25rem;
}

.hero {
  text-align: center;
  margin-bottom: 2.5rem;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.hero p {
  color: var(--text-secondary);
  font-size: 1.15rem;
  max-width: 620px;
  margin: 0 auto;
}

.search-box {
  width: 100%;
  max-width: 480px;
  margin: 1.5rem auto 0;
  display: block;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
}

.search-box:focus {
  outline: 2px solid var(--accent);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.category-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.category-card h2 {
  font-size: 1.3rem;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.tool-list {
  list-style: none;
}

.tool-list li {
  margin-bottom: 0.6rem;
}

.tool-list a {
  color: var(--text-primary);
  font-weight: 500;
}

.tool-list a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* 6. Tool interface -------------------------------------------------------- */
.tool-intro {
  margin-bottom: 1.5rem;
}

.tool-intro h1 {
  font-size: 2.1rem;
  margin-bottom: 0.5rem;
}

.tagline {
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.tool-box {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.mode-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.mode-btn {
  background-color: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.7rem;
  font-weight: 600;
  font-family: var(--font-body);
  border-radius: 6px;
  cursor: pointer;
}

.mode-btn.active {
  background-color: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

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

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 0.7rem;
  background-color: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
}

textarea {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  resize: vertical;
  min-height: 140px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--accent);
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.btn {
  background-color: var(--accent);
  color: #ffffff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 1rem;
  font-family: var(--font-body);
  cursor: pointer;
}

.btn:hover {
  background-color: var(--accent-hover);
}

.btn-secondary {
  background-color: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background-color: rgba(148, 163, 184, 0.12);
}

.error-message {
  color: var(--error);
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  display: none;
}

.trust-badge {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 1.25rem;
  text-align: center;
}

.result {
  margin-top: 1.25rem;
  padding: 1.25rem;
  background-color: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.result-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-heading);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.95rem;
}

th, td {
  border: 1px solid var(--border);
  padding: 0.6rem 0.75rem;
  text-align: left;
}

th {
  background-color: var(--bg-primary);
  font-weight: 600;
}

.table-scroll {
  overflow-x: auto;
}

/* 7. Ad slots -------------------------------------------------------------- */
/* HIDDEN FOR SEO: empty ad placeholders were hurting rankings, so both the
   markup (commented out in each page) and these styles are disabled for now.
   Re-enable after the site ranks — just uncomment this block.

   Reserved height so ads never push content around (good Core Web Vitals).
.ad-unit {
  background-color: var(--ad-bg);
  border: 1px dashed var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  margin: 1.5rem 0;
  overflow: hidden;
}

.ad-top { width: 100%; height: 90px; }
.ad-inline { width: 100%; height: 250px; }
.ad-in-tool { width: 100%; height: 100px; }
*/

/* 8. SEO content + FAQ ----------------------------------------------------- */
.seo-content {
  border-top: 1px solid var(--border);
  padding-top: 1.75rem;
}

.seo-content h2 {
  font-size: 1.5rem;
  margin: 1.75rem 0 0.6rem;
}

.seo-content h3 {
  font-size: 1.15rem;
  margin: 1.25rem 0 0.4rem;
}

.seo-content p,
.seo-content li {
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.seo-content ul,
.seo-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.formula {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text-primary);
  overflow-x: auto;
  margin-bottom: 1rem;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  background-color: var(--bg-secondary);
}

.faq-item summary {
  padding: 0.9rem 1rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-primary);
}

.faq-item p {
  padding: 0 1rem 1rem;
  margin: 0;
}

.legal-content p,
.legal-content li {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.legal-content h2 {
  font-size: 1.3rem;
  margin: 1.75rem 0 0.5rem;
}

/* Related tools block (added to each tool page by the build) */
.related-tools {
  margin-top: 2.5rem;
}

/* Developer profile (about + developer pages) */
.profile-header {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.profile-photo {
  width: 170px;
  height: 170px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--border);
}

/* Breadcrumb trail (added by the build to category and tool pages) */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.breadcrumb a {
  color: var(--text-secondary);
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb .sep {
  margin: 0 0.4rem;
  opacity: 0.6;
}

.legal-date {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* 9. Responsive breakpoints ------------------------------------------------ */

/* Tablet (iPad) and below: nav becomes a toggled menu */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
    z-index: 1000;
  }

  .main-nav.open {
    display: flex;
  }

  .header-inner {
    position: relative;
  }

  .hero h1 {
    font-size: 2rem;
  }
}

/* Phones */
@media (max-width: 480px) {
  main {
    margin: 1.5rem auto;
  }

  .tool-box {
    padding: 1.25rem;
  }

  .mode-selector {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 1.7rem;
  }

  .hero p {
    font-size: 1.05rem;
  }

  .result-value {
    font-size: 1.5rem;
  }

  .btn,
  .btn-secondary {
    width: 100%;
  }
}
