/* ─── CSS Variables ─────────────────────────────────────────────────────── */
:root {
  --accent: #C9A027;
  --accent-hover: #A8841F;
  --accent-light: #FBF5E0;
  --brand-green: #0D4F3C;
  --brand-green-dark: #0A3D2E;
  --tag-bg: #FBF5E0;
  --tag-text: #7A5C00;
  --success: #16a34a;
  --error: #dc2626;
  --warning: #d97706;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border: #e5e7eb;
  --bg: #f9fafb;
  --bg-white: #ffffff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.07), 0 4px 6px rgba(0,0,0,.05);
  --radius: 10px;
  --radius-sm: 6px;
  --nav-height: 60px;
}

/* ─── Reset / Base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
ul { list-style: none; }

/* ─── Navbar ────────────────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--brand-green);
  border-bottom: 1px solid var(--brand-green-dark);
  box-shadow: var(--shadow-sm);
}
.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.navbar-logo {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--accent);
  letter-spacing: -.5px;
  text-decoration: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.navbar-logo:hover { text-decoration: none; opacity: .9; }
.navbar-logo span { color: #ffffff; }
.navbar-logo-img {
  height: 38px;
  width: 38px;
  object-fit: contain;
  border-radius: 50%;
  flex-shrink: 0;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

/* Dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: .925rem;
  font-weight: 500;
  color: #ffffff;
  padding: .4rem .75rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: .35rem;
  transition: background .15s, color .15s;
}
.nav-dropdown-btn:hover, .nav-dropdown-btn.active {
  background: var(--brand-green-dark);
  color: var(--accent);
}
.nav-dropdown-btn svg { width: 14px; height: 14px; transition: transform .2s; }
.nav-dropdown:hover .nav-dropdown-btn svg { transform: rotate(180deg); }

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: .5rem;
  z-index: 200;
}
.nav-dropdown:hover .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
  display: block;
  padding: .45rem .75rem;
  font-size: .875rem;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  transition: background .12s;
}
.nav-dropdown-menu a:hover { background: var(--accent-light); color: var(--accent); text-decoration: none; }
.nav-dropdown-menu a.active { color: var(--accent); font-weight: 600; }

/* Hamburger */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: .5rem;
  margin-left: auto;
  flex-direction: column;
  gap: 5px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
  transition: all .25s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile sidebar */
.mobile-sidebar {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-white);
  z-index: 99;
  overflow-y: auto;
  padding: 1rem;
}
.mobile-sidebar.open { display: block; }
.mobile-sidebar-section { margin-bottom: 1rem; }
.mobile-sidebar-section h3 {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  padding: .5rem .5rem .25rem;
}
.mobile-sidebar-section a {
  display: block;
  padding: .55rem .75rem;
  font-size: .9rem;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  transition: background .12s;
}
.mobile-sidebar-section a:hover { background: var(--accent-light); color: var(--accent); text-decoration: none; }

/* ─── Breadcrumb ────────────────────────────────────────────────────────── */
.breadcrumb {
  max-width: 900px;
  margin: 1.25rem auto 0;
  padding: 0 1.25rem;
  font-size: .8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { opacity: .5; }
.breadcrumb .current { color: var(--text-secondary); }

/* ─── Tool Page Layout ──────────────────────────────────────────────────── */
.tool-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  flex: 1;
}
.tool-header {
  text-align: center;
  margin-bottom: 2rem;
}
.tool-icon {
  font-size: 2.5rem;
  margin-bottom: .5rem;
  display: block;
}
.tool-header h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: .5rem;
}
.tool-header p {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 550px;
  margin: 0 auto;
}

/* ─── Card ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

/* ─── Drop Zone ─────────────────────────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  background: var(--bg);
  position: relative;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-light);
}
.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.drop-zone-icon { font-size: 2.25rem; margin-bottom: .5rem; display: block; }
.drop-zone-text { font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.drop-zone-sub { font-size: .8rem; color: var(--text-muted); margin-top: .25rem; }
.drop-zone-btn {
  display: inline-block;
  margin-top: .75rem;
  padding: .45rem 1.1rem;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
  pointer-events: none;
}

/* ─── File List ─────────────────────────────────────────────────────────── */
.file-list { margin-top: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.file-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .5rem .75rem;
  font-size: .875rem;
}
.file-item-icon { font-size: 1.1rem; flex-shrink: 0; }
.file-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item-size { color: var(--text-muted); font-size: .8rem; flex-shrink: 0; }
.file-item-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  padding: .1rem .2rem;
  border-radius: 4px;
  flex-shrink: 0;
  transition: color .15s;
}
.file-item-remove:hover { color: var(--error); }

/* ─── Form Fields ───────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  margin-bottom: .4rem;
  color: var(--text-primary);
}
.form-input {
  width: 100%;
  padding: .55rem .85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  color: var(--text-primary);
  background: var(--bg-white);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201,160,39,.18);
}
.form-input.error { border-color: var(--error); }
.form-hint { font-size: .78rem; color: var(--text-muted); margin-top: .3rem; }

/* Radio Group */
.radio-group { display: flex; flex-wrap: wrap; gap: .5rem; }
.radio-label {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  font-size: .875rem;
  transition: border-color .15s, background .15s;
  user-select: none;
}
.radio-label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}
.radio-label input { accent-color: var(--accent); }

/* Range Slider */
.range-wrap { display: flex; align-items: center; gap: .75rem; }
input[type="range"] {
  flex: 1;
  height: 6px;
  accent-color: var(--accent);
  cursor: pointer;
}
.range-value {
  min-width: 2.5rem;
  text-align: right;
  font-weight: 700;
  color: var(--accent);
  font-size: .95rem;
}

/* Checkbox */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .875rem;
  cursor: pointer;
  user-select: none;
}
.checkbox-label input { accent-color: var(--accent); width: 15px; height: 15px; }

/* Textarea */
.form-textarea {
  width: 100%;
  padding: .65rem .85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-family: 'Courier New', monospace;
  resize: vertical;
  min-height: 180px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201,160,39,.18);
}

/* ─── Progress Bar ──────────────────────────────────────────────────────── */
.progress-wrap { display: none; margin: 1rem 0; }
.progress-wrap.show { display: block; }
.progress-bar-bg {
  background: var(--border);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .3s ease;
  width: 0%;
}
.progress-label { font-size: .8rem; color: var(--text-secondary); margin-top: .35rem; }

/* ─── Process Button ────────────────────────────────────────────────────── */
.btn-process {
  display: block;
  width: 100%;
  padding: .85rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s;
  margin-top: 1.25rem;
}
.btn-process:hover:not(:disabled) { background: var(--accent-hover); }
.btn-process:active:not(:disabled) { transform: scale(.98); }
.btn-process:disabled { opacity: .5; cursor: not-allowed; }

/* ─── Status Message ────────────────────────────────────────────────────── */
.status-msg {
  display: none;
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  margin-top: 1rem;
  align-items: center;
  gap: .5rem;
}
.status-msg.show { display: flex; }
.status-msg.success {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}
.status-msg.error {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}
.status-msg.info {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
}

/* ─── Info Strip ────────────────────────────────────────────────────────── */
.info-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  background: var(--accent-light);
  border: 1px solid #e6cc80;
  border-radius: var(--radius-sm);
  padding: .75rem 1.1rem;
  font-size: .8rem;
  color: var(--brand-green);
  margin: 1.5rem 0;
}
.info-strip span { display: flex; align-items: center; gap: .35rem; }

/* ─── Ad Slot ───────────────────────────────────────────────────────────── */
.ad-slot {
  min-height: 90px;
  background: #f8f9fa;
  border: 1px dashed #dee2e6;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #adb5bd;
  font-size: .75rem;
  margin: 1.5rem 0;
  text-align: center;
}

/* ─── Footer ────────────────────────────────────────────────────────────── */
.footer {
  background: var(--brand-green);
  border-top: none;
  padding: 1.5rem 1.25rem;
  text-align: center;
  font-size: .8rem;
  color: rgba(255,255,255,0.8);
  margin-top: auto;
}
.footer a { color: var(--accent); }
.footer a:hover { color: var(--accent); }
.footer-links { margin-top: .3rem; display: flex; justify-content: center; gap: 1.25rem; flex-wrap: wrap; }

/* ─── Home Page ─────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--brand-green) 0%, #1a6b52 100%);
  color: #fff;
  padding: 3.5rem 1.25rem 3rem;
  text-align: center;
}
.hero h1 {
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  font-weight: 900;
  margin-bottom: .6rem;
  color: #fff;
  line-height: 1.2;
}
.hero h1 span { color: var(--accent); }
.hero p {
  font-size: 1rem;
  color: rgba(255,255,255,.8);
  margin-bottom: 1.75rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}
.hero-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1.75rem;
}
.hero-badge {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25);
  color: rgba(255,255,255,.9);
  border-radius: 999px;
  padding: .3rem .85rem;
  font-size: .78rem;
  font-weight: 600;
}
.hero-search {
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}
.hero-search input {
  width: 100%;
  padding: .85rem 1.1rem .85rem 2.8rem;
  border-radius: 999px;
  border: none;
  font-size: .95rem;
  outline: none;
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
  color: var(--text-primary);
}
.hero-search input:focus { box-shadow: 0 4px 20px rgba(0,0,0,.3), 0 0 0 3px rgba(201,160,39,.4); }
.hero-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* ─── Tools Section ──────────────────────────────────────────────────────── */
.tools-section {
  width: 100%;
  max-width: 1200px;
  margin: 2rem auto 3rem;
  padding: 0 1.25rem;
  box-sizing: border-box;
}

/* ─── Tool Group Panel ───────────────────────────────────────────────────── */
.tool-group {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.tool-group-header {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 1.25rem;
  padding-bottom: .85rem;
  border-bottom: 2px solid var(--accent-light);
}
.tool-group-icon { font-size: 1.3rem; }
.tool-group-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--brand-green);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.tool-group-count {
  margin-left: auto;
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: .15rem .55rem;
  border-radius: 999px;
}

/* ─── Tools Grid ─────────────────────────────────────────────────────────── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .85rem;
}

/* ─── Tool Card ──────────────────────────────────────────────────────────── */
.tool-card {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem .9rem;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s, background .15s;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  text-decoration: none;
  color: var(--text-primary);
  min-height: 110px;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.tool-card:hover, .tool-card:focus-visible {
  border-color: var(--accent);
  background: var(--bg-white);
  box-shadow: 0 4px 14px rgba(201,160,39,.18);
  transform: translateY(-2px);
  text-decoration: none;
  outline: none;
}
.tool-card:active { transform: translateY(0); }
.tool-card-icon { font-size: 1.6rem; line-height: 1; }
.tool-card h3 { font-size: .875rem; font-weight: 700; margin: 0; line-height: 1.3; }
.tool-card p { font-size: .75rem; color: var(--text-secondary); margin: 0; line-height: 1.35; }
.tool-card-tags { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .2rem; }
.tag {
  display: inline-block;
  padding: .1rem .45rem;
  background: var(--tag-bg);
  color: var(--tag-text);
  border-radius: 999px;
  font-size: .65rem;
  font-weight: 700;
}
.tool-card-link {
  margin-top: auto;
  font-size: .75rem;
  color: var(--accent);
  font-weight: 700;
  padding-top: .4rem;
}
.tool-card.hidden { display: none; }

/* ─── No results ─────────────────────────────────────────────────────────── */
#no-results { text-align: center; padding: 3rem; color: var(--text-muted); }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .navbar-nav { display: none; }
  .hamburger { display: flex; }
  .tool-header h1 { font-size: 1.5rem; }
  .card { padding: 1.25rem; }
  .tools-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .65rem; }
  .tool-group { padding: 1.1rem; }
}

@media (max-width: 480px) {
  .hero { padding: 2.25rem 1rem 2rem; }
  .hero h1 { font-size: 1.6rem; }
  .tools-section { padding: 0 .85rem; }
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  .tool-card { min-height: 100px; padding: .85rem .75rem; }
  .tool-card p { display: none; }
  .tool-group { padding: 1rem .85rem; border-radius: 10px; }
  .radio-group { flex-direction: column; }
  .hero-badges { gap: .35rem; }
}

@media (min-width: 1024px) {
  .tools-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}

/* Touch devices — remove hover transform to avoid sticky state */
@media (hover: none) {
  .tool-card:hover { transform: none; box-shadow: none; border-color: var(--border); background: var(--bg); }
  .tool-card:active { border-color: var(--accent); background: var(--accent-light); }
}
