/* ========================================
   ToolkitNest — Global Design System
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ---- CSS Custom Properties ---- */
:root {
  --hue: 220;
  --bg:        hsl(230, 20%, 8%);
  --bg-2:      hsl(230, 18%, 11%);
  --bg-3:      hsl(230, 16%, 15%);
  --glass:     hsla(230, 20%, 18%, 0.6);
  --glass-b:   hsla(230, 20%, 28%, 0.25);
  --border:    hsla(220, 30%, 60%, 0.12);
  --border-h:  hsla(220, 60%, 65%, 0.35);
  --accent:    hsl(213, 100%, 60%);
  --accent-2:  hsl(265, 90%, 65%);
  --accent-grd:linear-gradient(135deg, hsl(213,100%,60%), hsl(265,90%,65%));
  --text:      hsl(220, 20%, 92%);
  --text-2:    hsl(220, 12%, 60%);
  --text-3:    hsl(220, 10%, 40%);
  --success:   hsl(145, 70%, 50%);
  --warning:   hsl(38, 100%, 55%);
  --danger:    hsl(0, 80%, 60%);
  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 22px;
  --shadow:    0 4px 24px hsla(213, 80%, 40%, 0.15);
  --shadow-lg: 0 8px 48px hsla(213, 80%, 40%, 0.25);
  --font:      'Inter', sans-serif;
  --trans:     all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; transition: var(--trans); }
a:hover { color: hsl(213, 100%, 75%); }
img, svg { display: block; }
button { font-family: var(--font); cursor: pointer; border: none; outline: none; }
input, textarea, select { font-family: var(--font); }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ---- Background Gradient Blobs ---- */
body::before {
  content: '';
  position: fixed;
  top: -40%;
  left: -20%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, hsla(213,100%,60%,0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: '';
  position: fixed;
  bottom: -30%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, hsla(265,90%,65%,0.07) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ---- Navbar ---- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: hsla(230, 20%, 8%, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  font-weight: 800;
  background: var(--accent-grd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.nav-brand .logo-icon {
  width: 34px;
  height: 34px;
  background: var(--accent-grd);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-brand .logo-icon svg { color: white; -webkit-text-fill-color: white; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}
.nav-links a {
  color: var(--text-2);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--trans);
}
.nav-links a:hover { color: var(--text); }
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  padding: 4px;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-2);
  border-radius: 2px;
  transition: var(--trans);
}
.mobile-menu {
  display: none;
  flex-direction: column;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  gap: 1rem;
}
.mobile-menu.open { display: flex; }
.mobile-menu a { color: var(--text-2); font-size: 0.95rem; font-weight: 500; }
.mobile-menu a:hover { color: var(--text); }

/* ---- AdSense Slots ---- */
.ad-slot {
  width: 100%;
  background: hsla(230, 18%, 14%, 0.6);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.ad-slot-leaderboard { height: 90px; margin: 1rem 0; }
.ad-slot-rectangle  { height: 280px; max-width: 336px; margin: 1.5rem auto; }
.ad-slot-banner     { height: 60px; margin: 1.5rem 0; }

/* ---- Hero ---- */
.hero {
  text-align: center;
  padding: 5rem 2rem 3rem;
  position: relative;
}
.hero-badge {
  display: inline-block;
  background: var(--glass);
  border: 1px solid var(--border-h);
  border-radius: 99px;
  padding: 0.3rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1.5rem;
  letter-spacing: 0.04em;
  backdrop-filter: blur(10px);
}
.hero h1 {
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 1rem;
  background: var(--accent-grd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  max-width: 580px;
  margin: 0 auto 2rem;
  color: var(--text-2);
  font-size: 1.1rem;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
}
.stat { text-align: center; }
.stat-num { font-size: 1.8rem; font-weight: 800; color: var(--accent); }
.stat-lbl { font-size: 0.8rem; color: var(--text-3); }

/* ---- Search Bar ---- */
.search-bar-wrap {
  max-width: 520px;
  margin: 0 auto 2rem;
  position: relative;
}
.search-bar-wrap input {
  width: 100%;
  padding: 0.85rem 1.2rem 0.85rem 3rem;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--text);
  font-size: 0.95rem;
  backdrop-filter: blur(12px);
  transition: var(--trans);
}
.search-bar-wrap input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px hsla(213,100%,60%,0.15);
}
.search-bar-wrap .search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
}

/* ---- Category Tabs ---- */
.cat-tabs {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 2.5rem;
  padding: 0 1rem;
}
.cat-tab {
  padding: 0.45rem 1.1rem;
  border-radius: 99px;
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--trans);
  backdrop-filter: blur(8px);
}
.cat-tab:hover, .cat-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* ---- Tool Grid ---- */
.section { padding: 2rem; max-width: 1280px; margin: 0 auto; }
.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text);
}
.section-title span { color: var(--accent); }
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

/* ---- Tool Card ---- */
.tool-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  cursor: pointer;
  transition: var(--trans);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
}
.tool-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-grd);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: inherit;
}
.tool-card:hover {
  border-color: var(--border-h);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  color: var(--text);
}
.tool-card:hover::before { opacity: 0.05; }
.tool-card .card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.tool-card .card-title {
  font-size: 0.95rem;
  font-weight: 700;
  position: relative;
  z-index: 1;
}
.tool-card .card-desc {
  font-size: 0.82rem;
  color: var(--text-2);
  line-height: 1.5;
  position: relative;
  z-index: 1;
}
.card-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--accent);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 99px;
  letter-spacing: 0.05em;
  z-index: 2;
}

/* Icon Color Variants */
.icon-blue   { background: hsla(213,100%,60%,0.15); color: hsl(213,100%,65%); }
.icon-purple { background: hsla(265,90%,65%,0.15); color: hsl(265,90%,70%); }
.icon-green  { background: hsla(145,70%,50%,0.15); color: hsl(145,70%,55%); }
.icon-orange { background: hsla(38,100%,55%,0.15); color: hsl(38,100%,60%); }
.icon-pink   { background: hsla(330,90%,65%,0.15); color: hsl(330,90%,70%); }
.icon-cyan   { background: hsla(190,90%,55%,0.15); color: hsl(190,90%,60%); }

/* ---- Tool Page Layout ---- */
.tool-page { max-width: 900px; margin: 0 auto; padding: 2rem; }
.tool-header { margin-bottom: 2rem; }
.tool-header .breadcrumb {
  font-size: 0.8rem;
  color: var(--text-3);
  margin-bottom: 0.75rem;
}
.tool-header .breadcrumb a { color: var(--text-3); }
.tool-header .breadcrumb span { margin: 0 0.4rem; }
.tool-header h1 { font-size: 1.8rem; font-weight: 800; margin-bottom: 0.5rem; }
.tool-header p  { color: var(--text-2); font-size: 0.95rem; }

/* ---- Glass Panel ---- */
.panel {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  backdrop-filter: blur(16px);
  margin-bottom: 1.5rem;
}

/* ---- Drop Zone ---- */
.drop-zone {
  border: 2px dashed var(--border-h);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: var(--trans);
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent);
  background: hsla(213,100%,60%,0.05);
}
.drop-zone .dz-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.drop-zone .dz-text { color: var(--text-2); font-size: 0.9rem; }
.drop-zone .dz-text strong { color: var(--accent); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.72rem 1.5rem;
  border-radius: 99px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--trans);
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: var(--accent-grd);
  color: white;
  box-shadow: 0 4px 16px hsla(213,100%,60%,0.3);
}
.btn-primary:hover { box-shadow: 0 4px 24px hsla(213,100%,60%,0.5); transform: translateY(-1px); }
.btn-secondary {
  background: var(--glass);
  border: 1px solid var(--border-h);
  color: var(--text);
  backdrop-filter: blur(8px);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-success { background: var(--success); color: white; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
.btn-group { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.25rem; }

/* ---- Form Controls ---- */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}
.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  transition: var(--trans);
}
.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px hsla(213,100%,60%,0.12);
}
textarea.form-control { resize: vertical; min-height: 180px; font-family: 'Fira Code', monospace; }
select.form-control { cursor: pointer; }

/* ---- Range Slider ---- */
input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: var(--bg-3);
  border-radius: 99px;
  outline: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 8px hsla(213,100%,60%,0.5);
}

/* ---- Result Box ---- */
.result-box {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-size: 0.9rem;
  min-height: 80px;
  word-break: break-all;
}
.result-box.code { font-family: 'Fira Code', monospace; font-size: 0.85rem; white-space: pre-wrap; max-height: 400px; overflow-y: auto; }

/* ---- Stats Row ---- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}
.stat-box {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
}
.stat-box .s-val { font-size: 1.6rem; font-weight: 800; color: var(--accent); }
.stat-box .s-lbl { font-size: 0.75rem; color: var(--text-3); margin-top: 0.2rem; }

/* ---- Progress Bar ---- */
.progress-wrap { margin: 0.75rem 0; }
.progress-label { font-size: 0.8rem; color: var(--text-2); margin-bottom: 0.4rem; display: flex; justify-content: space-between; }
.progress-bar {
  height: 8px;
  background: var(--bg-3);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent-grd);
  border-radius: 99px;
  transition: width 0.5s ease;
}
.progress-fill.danger { background: var(--danger); }
.progress-fill.success { background: var(--success); }

/* ---- Toast ---- */
#toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.toast {
  background: var(--bg-2);
  border: 1px solid var(--border-h);
  border-radius: var(--radius);
  padding: 0.85rem 1.25rem;
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
  max-width: 320px;
}
.toast.success { border-color: var(--success); }
.toast.error   { border-color: var(--danger); }
@keyframes slideUp {
  from { opacity:0; transform: translateY(20px); }
  to   { opacity:1; transform: translateY(0); }
}

/* ---- Footer ---- */
.footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding: 3rem 2rem 2rem;
  margin-top: 4rem;
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
}
.footer-brand p { font-size: 0.85rem; color: var(--text-2); margin-top: 0.75rem; max-width: 260px; line-height: 1.6; }
.footer-col h4 { font-size: 0.85rem; font-weight: 700; color: var(--text); margin-bottom: 1rem; letter-spacing: 0.04em; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.footer-col ul a { font-size: 0.83rem; color: var(--text-2); }
.footer-col ul a:hover { color: var(--accent); }
.footer-bottom {
  max-width: 1280px;
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-3);
}

/* ---- Utility ---- */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-accent { color: var(--accent); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.chip {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--text-2);
}
.chip.green { background: hsla(145,70%,50%,0.15); border-color: hsla(145,70%,50%,0.3); color: var(--success); }
.chip.red   { background: hsla(0,80%,60%,0.15);   border-color: hsla(0,80%,60%,0.3);   color: var(--danger); }
.divider { height: 1px; background: var(--border); margin: 1.5rem 0; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .hero { padding: 3rem 1.25rem 2rem; }
  .hero-stats { gap: 1.5rem; }
  .footer-inner { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .section { padding: 1.25rem; }
  .tool-page { padding: 1.25rem; }
  .panel { padding: 1.25rem; }
  .btn { font-size: 0.85rem; padding: 0.65rem 1.2rem; }
}

/* ---- Fade In Animation ---- */
.fade-in { animation: fadeIn 0.5s ease both; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Checkbox / Toggle ---- */
.toggle-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
}
input[type=checkbox] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}
.toggle-group label { font-size: 0.88rem; color: var(--text-2); cursor: pointer; }

/* ---- Color swatch ---- */
.color-swatch {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  cursor: pointer;
}
.color-swatch-lg {
  width: 100%;
  height: 120px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* ---- Tabs ---- */
.tab-bar {
  display: flex;
  gap: 0.4rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.tab-btn {
  padding: 0.55rem 1.1rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-2);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--trans);
  margin-bottom: -1px;
}
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-btn:hover  { color: var(--text); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
