/* ==========================================================================
   Tooler - SarkariStep Tools Core Stylesheet
   ========================================================================== */

:root {
  --primary: #a61c39;
  --primary-dark: #7c1129;
  --primary-light: #fdeef1;
  --ink: #1a1a1a;
  --ink-light: #5b655e;
  --paper: #f4f6f8;
  --panel: #ffffff;
  --line: #e2e6ea;
  --line-focus: #a61c39;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --ok: #1e8449;
  --ok-bg: #e8f6ee;
  --err: #c0392b;
  --err-bg: #fbe6e5;
  --font-main: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--primary-dark);
}

/* ==================== Top Navbar ==================== */
.navbar {
  background: var(--primary);
  color: #fff;
  padding: 10px 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.nav-brand {
  display: flex;
  align-items: center;
  color: #fff;
  text-decoration: none;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  flex-shrink: 0;
}

.nav-categories {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-cat-link {
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  opacity: 0.92;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nav-cat-link:hover {
  opacity: 1;
  background: rgba(255,255,255,0.18);
  text-decoration: none;
  color: #fff;
}

.nav-cat-sep {
  color: rgba(255,255,255,0.35);
  font-size: 13px;
  user-select: none;
  font-weight: 300;
}

.nav-right-wrap {
  flex-shrink: 0;
}

.nav-back-main {
  background: rgba(255,255,255,0.18);
  color: #fff !important;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 13.5px !important;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,0.25);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nav-back-main:hover {
  background: #fff;
  color: var(--primary) !important;
  text-decoration: none !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

/* ==================== Main Container ==================== */
.main-wrapper {
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 24px 60px;
  flex: 1;
}

/* ==================== Sleek Search Bar Section ==================== */
.search-header-wrap {
  margin: 10px auto 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.search-box-wrap {
  position: relative;
  width: 100%;
  max-width: 680px;
}

.search-input-modern {
  width: 100%;
  padding: 14px 44px 14px 48px;
  border: 2px solid var(--line);
  border-radius: 50px;
  font-family: inherit;
  font-size: 15px;
  background: #fff;
  box-shadow: 0 4px 18px rgba(0,0,0,0.05);
  transition: all 0.2s ease;
  color: var(--ink);
}

.search-input-modern:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 6px 24px rgba(166,28,57,0.16);
}

.search-input-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  opacity: 0.55;
  pointer-events: none;
}

.search-clear-btn {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: #e2e6ea;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: bold;
  color: #555;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}

.search-clear-btn:hover {
  background: #ccc;
  color: #000;
}

.category-quick-pills {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cat-pill {
  background: #fff;
  border: 1px solid var(--line);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
  text-decoration: none;
}

.cat-pill:hover, .cat-pill.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-dark);
}

/* ==================== Tool Categories & Grid ==================== */
.category-group {
  margin-bottom: 38px;
  scroll-margin-top: 80px;
}

.category-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 18px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 18px 20px;
  text-align: center;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative;
}

.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
  color: var(--ink);
}

.tool-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  margin: 0 auto 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.tool-icon.c1 { background: #e6f6ec; }
.tool-icon.c2 { background: #e8edfb; }
.tool-icon.c3 { background: #fdeaea; }
.tool-icon.c4 { background: #eaf7f0; }
.tool-icon.c5 { background: #fdf3d9; }
.tool-icon.c6 { background: #eef1fb; }
.tool-icon.c7 { background: #fdeef7; }
.tool-icon.c8 { background: #e7f7fb; }
.tool-icon.c9 { background: #f7ecff; }
.tool-icon.c10 { background: #fff0e6; }
.tool-icon.c11 { background: #e9f9ec; }

.tool-title {
  font-size: 15.5px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--ink);
}

.tool-desc {
  font-size: 13px;
  color: var(--ink-light);
  line-height: 1.45;
  margin-bottom: 18px;
  flex: 1;
}

.btn-use {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 7px;
  transition: background 0.15s;
}

.tool-card:hover .btn-use {
  background: var(--primary-dark);
}

/* ==================== Tool Detail / Single Page ==================== */
.breadcrumbs {
  font-size: 13px;
  color: var(--ink-light);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.breadcrumbs a {
  color: var(--ink-light);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--primary);
}

.tool-container {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
}

.tool-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.tool-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}

.tool-header p {
  font-size: 14px;
  color: var(--ink-light);
}

/* ==================== Dropzone & File List ==================== */
.dropzone {
  border: 2px dashed #9fb0a6;
  border-radius: var(--radius);
  padding: 30px 18px;
  text-align: center;
  cursor: pointer;
  background: #fafbfa;
  transition: border-color 0.15s, background 0.15s;
}

.dropzone.dragover, .dropzone:hover {
  border-color: var(--primary);
  background: #fdf5f6;
}

.dropzone input[type="file"] {
  display: none;
}

.dropzone-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.dropzone-text {
  font-size: 14.5px;
  color: #3e4841;
}

.dropzone-text .browse-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: underline;
}

.filelist {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fileitem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 13.5px;
  gap: 12px;
}

.fileitem .name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.fileitem .meta {
  color: var(--ink-light);
  font-family: var(--font-mono);
  font-size: 12px;
}

.btn-remove {
  background: none;
  border: none;
  color: #a3231f;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

.btn-remove:hover {
  background: var(--err-bg);
}

/* ==================== Form Controls & Inputs ==================== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: #3b443e;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(166,28,57,0.12);
}

.row-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.row-inline span {
  color: #888;
  font-size: 14px;
}

/* ==================== Buttons & Action Rows ==================== */
.actions-row {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 22px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s, transform 0.1s;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-ghost {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s;
}

.btn-ghost:hover {
  background: #f0f2f5;
}

/* ==================== Results & Output Cards ==================== */
.status-msg {
  margin-top: 14px;
  font-size: 14px;
  font-weight: 500;
}

.status-msg.working { color: #465049; }
.status-msg.error { color: var(--err); }
.status-msg.success { color: var(--ok); }

.results-container {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.result-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--ok-bg);
  border: 1px solid #bfe0cb;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.result-card img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #bfe0cb;
  border-radius: 6px;
}

.result-card .info {
  flex: 1;
  font-size: 13.5px;
}

.result-card .info .fn {
  font-weight: 700;
  color: var(--ink);
  word-break: break-all;
}

.result-card .info .sz {
  color: #2b593b;
  font-family: var(--font-mono);
  font-size: 12px;
  margin-top: 2px;
}

.btn-download {
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 6px;
  white-space: nowrap;
}

.btn-download:hover {
  background: var(--primary-dark);
  color: #fff;
}

/* ==================== Calculation Result Cards ==================== */
.calc-result-box {
  margin-top: 22px;
  background: #f8faf8;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
}

.calc-result-box .big-val {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 4px;
}

.calc-result-box .sub-val {
  font-size: 13px;
  color: #6b7280;
}

.calc-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 13.5px;
}

.calc-table td {
  padding: 8px 4px;
  border-bottom: 1px solid #e5e8e5;
}

.calc-table td:last-child {
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 600;
}

.calc-table tr:last-child td {
  border-bottom: none;
}

/* ==================== Validation / Checker Rows ==================== */
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #e8ebe8;
  font-size: 13.5px;
}

.check-item:last-child {
  border-bottom: none;
}

.check-badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.check-badge.pass { background: var(--ok); }
.check-badge.fail { background: var(--err); }

.verdict-box {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
}

.verdict-box.pass { background: var(--ok-bg); color: var(--ok); }
.verdict-box.fail { background: var(--err-bg); color: var(--err); }

/* ==================== SEO & Educational Content Box ==================== */
.seo-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 22px;
  margin-top: 24px;
}

.seo-card h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 8px;
}

.seo-card ul, .seo-card ol {
  margin-left: 20px;
  margin-bottom: 18px;
  font-size: 13.5px;
  color: #3b423c;
  line-height: 1.7;
}

.seo-card p {
  font-size: 13.5px;
  color: #555e58;
  line-height: 1.7;
}

/* ==================== Footer ==================== */
.footer {
  background: #111;
  color: #888;
  font-size: 13px;
  text-align: center;
  padding: 24px 18px;
  margin-top: auto;
}

.footer a {
  color: #ccc;
  text-decoration: none;
}

.footer a:hover {
  color: #fff;
  text-decoration: underline;
}

@media (max-width: 600px) {
  .hero-title { font-size: 26px; }
  .tools-grid { grid-template-columns: 1fr; }
  .tool-container { padding: 20px 16px; }
  .nav-container { flex-direction: column; gap: 10px; text-align: center; }
}
