:root {
  --bg: #020617;
  --bg-elevated: #020617;
  --card: #020617;
  --card-alt: #020617;
  --accent: #22c55e;
  --accent-alt: #38bdf8;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --border: #1e293b;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.9);
}

/* Dark theme variables */
body.theme-dark {
  --bg: #020617;
  --bg-elevated: rgba(15, 23, 42, 0.9);
  --card: rgba(15, 23, 42, 0.96);
  --card-alt: #020617;
  --accent: #22c55e;
  --accent-alt: #38bdf8;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --border: rgba(148, 163, 184, 0.3);
}

/* Light theme variables */
body.theme-light {
  --bg: #f9fafb;
  --bg-elevated: rgba(248, 250, 252, 0.9);
  --card: rgba(255, 255, 255, 0.96);
  --card-alt: #f3f4f6;
  --accent: #16a34a;
  --accent-alt: #2563eb;
  --text: #020617;
  --muted: #4b5563;
  --border: rgba(148, 163, 184, 0.5);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #0f172a 0, #020617 38%, #020617 100%);
  color: var(--text);
}

/* Light bg override */
body.theme-light {
  background: radial-gradient(circle at top left, #e5e7eb 0, #f9fafb 40%, #f9fafb 100%);
}

/* HEADER - glassmorphism */

.app-header {
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(30px) saturate(1.8);
  -webkit-backdrop-filter: blur(30px) saturate(1.8);
  background: linear-gradient(
    120deg,
    rgba(15, 23, 42, 0.96),
    rgba(15, 23, 42, 0.65),
    rgba(15, 23, 42, 0.98)
  );
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 22px 44px rgba(15, 23, 42, 0.85);
}

body.theme-light .app-header {
  background: linear-gradient(
    120deg,
    rgba(248, 250, 252, 0.95),
    rgba(255, 255, 255, 0.75),
    rgba(248, 250, 252, 0.98)
  );
  box-shadow: 0 18px 32px rgba(148, 163, 184, 0.55);
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 8px; /* optional for glass-style icons */
}


.brand-name {
  font-weight: 600;
  font-size: 1rem;
}

.brand-subtitle {
  font-size: 0.78rem;
  color: var(--muted);
}


/* Floating theme toggle */

.theme-toggle-fab {
  position: fixed;
  top: 10px;
  right: 15px;
  width: 35px;
  height: 35px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.7);
  z-index: 40;
}

body.theme-light .theme-toggle-fab {
  box-shadow: 0 10px 26px rgba(148, 163, 184, 0.5);
}

.theme-toggle-fab:hover {
  transform: translateY(-1px);
}

/* MAIN LAYOUT */

.app-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 26px 16px 80px;
}

/* HERO */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.1fr);
  gap: 26px;
  align-items: center;
  margin-bottom: 40px;
}

.hero-text h1 {
  font-size: clamp(2.2rem, 3.1vw, 2.8rem);
  line-height: 1.1;
  margin-bottom: 14px;
}

.accent {
  background: linear-gradient(135deg, #22c55e, #22c55e);
  -webkit-background-clip: text;
  color: transparent;
}

.hero-subtitle {
  color: var(--muted);
  font-size: 0.98rem;
  max-width: 540px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.hero-note {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--muted);
}

/* HERO CARD */

.hero-card {
  background: radial-gradient(circle at top left, rgba(34, 197, 94, 0.16), rgba(15, 23, 42, 0.98));
  border-radius: var(--radius-xl);
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 18px 18px 18px;
  box-shadow: var(--shadow-soft);
}

body.theme-light .hero-card {
  background: radial-gradient(circle at top left, rgba(34, 197, 94, 0.12), #ffffff);
}

.hero-card-header {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 8px;
}

/* Hero list — improved alignment & spacing (replace old .hero-list rules) */
.hero-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 10px;                 /* vertical spacing between items */
  align-items: flex-start;   /* icon + text aligned left inside card for readability */
  color: var(--text);
}

/* each list item: small icon + text row */
.hero-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  color: var(--muted);
}

/* emoji/icon size inside hero list (keeps visual rhythm) */
.hero-list li::marker { content: none; } /* ensure no bullets */
.hero-list li span.icon-hero {
  font-size: 1.15rem;
  line-height: 1;
  display: inline-block;
  width: 28px;
  text-align: center;
}

/* text in hero list */
.hero-list li .hero-item-text {
  font-size: 0.95rem;
  line-height: 1.15;
  color: var(--muted);
}

/* if card is narrow (mobile), keep items centered */
@media (max-width: 520px) {
  .hero-list {
    align-items: center;
    text-align: center;
  }
  .hero-list li {
    justify-content: center;
  }
  .hero-list li span.icon-hero { width: 30px; }
}

/* BUTTONS */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, opacity 0.12s ease;
}

.btn.primary {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #022c22;
  box-shadow: 0 10px 30px rgba(34, 197, 94, 0.45);
}

.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 40px rgba(34, 197, 94, 0.6);
}

.btn.secondary {
  background: rgba(37, 99, 235, 0.18);
  color: #dbeafe;
  border: 1px solid rgba(59, 130, 246, 0.5);
}

body.theme-light .btn.secondary {
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
}

.btn.secondary:hover {
  transform: translateY(-1px);
}

.btn.ghost {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.6);
  color: var(--muted);
}

.btn.ghost:hover {
  background: rgba(15, 23, 42, 0.8);
  color: var(--text);
}

body.theme-light .btn.ghost:hover {
  background: rgba(148, 163, 184, 0.15);
}

.btn.full-width {
  width: 100%;
}

/* SECTION HEADERS */

.tools-section,
.features-section,
.faq-section {
  margin-top: 40px;
}


h2 {
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.section-subtitle {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 14px;
}

/* MESSAGES */

.messages {
  background: rgba(220, 38, 38, 0.16);
  border: 1px solid rgba(248, 113, 113, 0.7);
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 0.86rem;
  color: #fecaca;
  margin: 10px 0 16px;
}

/* TOOL CARDS */

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.tool-card {
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.16), var(--card));
  border-radius: var(--radius-lg);
  padding: 18px 16px 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.tool-card:nth-child(2) {
  background: radial-gradient(circle at top left, rgba(34, 197, 94, 0.16), var(--card));
}

/* Title row + badges */

.tool-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.tool-title-row h3 {
  margin: 0;
  font-size: 1.05rem;
}

.tool-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tool-view-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.7);
  font-size: 0.74rem;
  color: var(--muted);
}

body.theme-light .tool-view-chip {
  background: rgba(255, 255, 255, 0.85);
}

.eye-icon {
  font-size: 0.85rem;
}

.tool-view-count {
  font-weight: 600;
  min-width: 1.3em;
  text-align: right;
}

.tool-text {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 12px;
}

/* Keep your existing rules but override any layout-reset styles that hide inputs */
.tool-form {
  margin-top: 8px;
  /* ensure the form participates in layout */
  display: block;
  width: 100%;
  box-sizing: border-box;
}

/* Labels */
.field-label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: var(--muted, #6b7280);
}

/* Row spacing */
.field-row {
  margin-top: 8px; /* larger gap so inputs don't visually collapse */
}

/* Generic rule to make all inputs inside .tool-form visible & usable.
   This targets text, number, file, email, tel, url, etc. but not buttons. */
.tool-form input[type="text"],
.tool-form input[type="number"],
.tool-form input[type="tel"],
.tool-form input[type="email"],
.tool-form input[type="url"],
.tool-form input[type="search"],
.tool-form input[type="file"],
.tool-form input[type="date"],
.tool-form input[type="datetime-local"],
.tool-form input[type="time"],
.tool-form input:not([type]) {
  display: block !important;       /* override any display:none/inline rules */
  width: 100% !important;          /* full width inside row */
  padding: 8px 10px !important;    /* comfortable hit area */
  font-size: 1rem !important;
  line-height: 1.25 !important;
  border: 1px solid rgba(0,0,0,0.12) !important;
  border-radius: 6px !important;
  background: var(--surface, #fff) !important;
  color: inherit !important;
  box-sizing: border-box !important; /* important so padding doesn't break width */
  min-height: 38px !important;       /* prevent zero-height inputs */
  max-width: 100% !important;
  margin: 0;                          /* remove stray margins */
  vertical-align: middle;
}

/* File input: keep compact but visible */
.tool-form input[type="file"] {
  padding: 6px !important;
  min-height: auto !important;
}

/* Track number / year numeric fields: better mobile keyboard */
.tool-form input[type="number"] {
  -moz-appearance: textfield; /* remove spinner in Firefox if desired */
}

/* Button styling fallback if .btn classes are missing */
.tool-form button,
.tool-form input[type="submit"] {
  display: inline-block;
  padding: 10px 14px;
  font-size: 1rem;
  border-radius: 6px;
  cursor: pointer;
  box-sizing: border-box;
}

/* Defensive: if a parent has collapsed height, make sure form's container can grow */
.tool-form,
.tool-form * {
  min-width: 0; /* allow flex children to shrink properly */
}

/* Accessibility: focus ring */
.tool-form input:focus,
.tool-form button:focus {
  outline: 3px solid rgba(59,130,246,0.25);
  outline-offset: 2px;
}


/* INPUTS / SELECTS */

input[type="url"],
input[type="file"],
select {
  width: 100%;
  padding: 9px 11px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

body.theme-light input[type="url"],
body.theme-light input[type="file"],
body.theme-light select {
  background: rgba(255, 255, 255, 0.96);
}

input[type="url"]::placeholder {
  color: rgba(148, 163, 184, 0.7);
}

input[type="file"] {
  padding: 7px 8px;
}

select {
  appearance: none;
  -moz-appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) calc(50% - 3px),
    calc(100% - 9px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.45);
}

.tool-hint {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--muted);
}

/* FEATURES */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 10px;
}

.feature-card {
  background: var(--card);
  border-radius: 18px;
  padding: 12px 14px 14px;
  border: 1px solid rgba(51, 65, 85, 0.9);
}

.feature-card h3 {
  margin-top: 0;
  font-size: 0.98rem;
}

.feature-card p {
  margin: 6px 0 0;
  font-size: 0.86rem;
  color: var(--muted);
}

/* FAQ */

.faq-list {
  margin-top: 10px;
}

.faq-item {
  background: var(--card);
  border-radius: 16px;
  border: 1px solid rgba(51, 65, 85, 0.9);
  padding: 8px 12px;
  margin-bottom: 8px;
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.9rem;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "▾";
  float: right;
  font-size: 0.8rem;
  color: var(--muted);
}

.faq-item[open] summary::after {
  content: "▴";
}

.faq-item p {
  margin-top: 6px;
  font-size: 0.84rem;
  color: var(--muted);
}

/* FOOTER – clear & a bit higher */

.app-footer {
  border-top: 1px solid rgba(30, 64, 175, 0.6);
  padding: 18px 16px 20px;
  text-align: center;
  font-size: 0.86rem;
  font-weight: 500;
  color: rgba(226, 232, 240, 0.9);
  background: linear-gradient(to top, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.6), transparent);
  margin-top: 12px;
  /*margin-bottom: 30px; /* thoda upar dikhne ke liye */
}

body.theme-light .app-footer {
  background: linear-gradient(
    to top,
    rgba(248, 250, 252, 0.98),
    rgba(248, 250, 252, 0.8),
    transparent
  );
  color: rgba(55, 65, 81, 0.95);
  border-top-color: rgba(148, 163, 184, 0.7);
}


/* Glasa Morphism Nav — improved (replace your old nav block) */
nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 1rem;
  width: min(950px, 90%);      /* responsive width */
  max-width: 980px;
  z-index: 60;

  /* frosted glass */
  background: rgba(255, 255, 255, 0.08);       /* dark-mode base (slightly translucent) */
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);

  padding: 6px 10px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  display: flex;
  justify-content: center;
}

/* light theme variant */
body.theme-light nav {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 6px 18px rgba(148, 163, 184, 0.18);
}

/* UL layout */
nav ul {
  list-style: none;
  display: flex;
  gap: clamp(18px, 6vw, 48px); /* responsive gap */
  margin: 0;
  padding: 0 6px;
  align-items: center;
}

/* LI */
nav li {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Link — make touch-friendly */
nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;           /* larger hit area */
  border-radius: 12px;
  transition: transform .12s ease, background .12s ease, color .14s ease;
  cursor: pointer;
  min-width: 48px;
}

/* Icon size */
nav .icon {
  font-size: 1.25rem;
  line-height: 1;
  display: block;
}

/* Label */
nav .text {
  font-size: 0.72rem;
  line-height: 1;
  color: inherit;
  opacity: 0.92;
  white-space: nowrap;
}

/* Hover / active */
nav a:hover,
nav a:focus {
  color: #ffffff;
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.06);
}

body.theme-light nav a:hover,
body.theme-light nav a:focus {
  background: rgba(0,0,0,0.06);
}

/* underline animation */
nav a::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 8px;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg,var(--accent),var(--accent-alt));
  transition: width .26s ease;
  border-radius: 2px;
  pointer-events: none;
}
nav a:hover::after,
nav a:focus::after {
  width: 60%;
}

/* make icons a bit stronger color for emphasis */
nav a .icon { color: var(--accent-alt); }
body.theme-light nav a .icon { color: var(--accent); }

/* small screens: reduce paddings and gap */
@media (max-width: 420px) {
  nav {
    bottom: 0.8rem;
    padding: 6px 6px;
    width: 96%;
  }
  nav ul { gap: 18px; }
  nav a { padding: 8px 8px; min-width: 44px; }
  nav .icon { font-size: 1.05rem; }
  nav .text { font-size: 0.62rem; }
}

/* hide nav on large screens if you rely on desktop header */
@media (min-width: 920px) {
  nav { display: none; }
}


/* LOADER */

.hidden {
  display: none !important;
}

.loader-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

body.theme-light .loader-backdrop {
  background: rgba(15, 23, 42, 0.35);
}

.loader-card {
  background: rgba(15, 23, 42, 0.96);
  border-radius: 18px;
  padding: 16px 18px 14px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 220px;
}

body.theme-light .loader-card {
  background: rgba(255, 255, 255, 0.96);
}

.loader-card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.loader-subtext {
  font-size: 0.78rem;
  opacity: 0.9;
}

.loader-spinner {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 3px solid rgba(148, 163, 184, 0.4);
  border-top-color: var(--accent);
  animation: spin-loader 0.7s linear infinite;
}

@keyframes spin-loader {
  to {
    transform: rotate(360deg);
  }
}

/* RESPONSIVE */

@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }


  .hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-card {
    order: -1;
  }
}
