@import url("./design-tokens.css");

:root {
  --ink: var(--wu-color-ink);
  --muted: var(--wu-color-muted);
  --green: var(--wu-color-brand);
  --deep: var(--wu-color-brand-strong);
  --mint: var(--wu-color-brand-soft);
  --cream: #fbfcfb;
  --line: var(--wu-color-border);
  --shadow: var(--wu-shadow-md);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { max-width: 100%; overflow-x: clip; }
body {
  min-height: 100vh;
  margin: 0 !important;
  padding-bottom: 0 !important;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 3%, rgb(23 114 69 / 8%), transparent 28rem),
    linear-gradient(180deg, #fff 0, var(--cream) 34rem, #fff 100%);
  font-family: var(--wu-font-ui);
  font-weight: var(--wu-weight-regular);
  line-height: 1.6;
}
a { color: var(--green); }
a:hover { color: var(--deep); }
:focus-visible { outline: 3px solid rgb(11 111 194 / 35%); outline-offset: 3px; }

body > .container-fluid { padding: 0; }
body > .container-fluid > .row:first-child { margin: 0 !important; }
body > .container-fluid > .row:first-child > .container-fluid { padding: 0; }

.navbar {
  min-height: 68px;
  padding: .7rem max(1.25rem, calc((100vw - var(--wu-content-width)) / 2)) !important;
  background: rgb(13 46 31 / 97%) !important;
  border-bottom: 1px solid rgb(255 255 255 / 8%);
  box-shadow: 0 8px 28px rgb(8 35 23 / 14%);
}
.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: #fff !important;
  font-size: 1.08rem;
  font-weight: var(--wu-weight-bold);
  letter-spacing: -.02em;
}
.navbar-brand::before {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: var(--wu-radius-md);
  background: rgb(255 255 255 / 9%);
  content: "و";
  color: #fff;
  font: var(--wu-weight-bold) 1.2rem var(--wu-font-urdu);
}
.navbar-nav { gap: .2rem; }
.navbar .nav-item { border-radius: var(--wu-radius-sm); background: transparent !important; }
.navbar .nav-link {
  padding: .55rem .72rem !important;
  border-radius: var(--wu-radius-sm);
  color: rgb(255 255 255 / 76%) !important;
  font-size: .88rem;
  font-weight: var(--wu-weight-medium);
}
.navbar .nav-link:hover { background: rgb(255 255 255 / 9%); color: #fff !important; }
.navbar .nav-link.active { background: #fff; color: var(--deep) !important; font-weight: var(--wu-weight-semibold); }
.navbar-toggler { border: 1px solid rgb(255 255 255 / 35%) !important; }
.navbar-toggler::after { content: "Menu"; color: #fff; font-size: .78rem; }

body > .container-fluid > .row:nth-of-type(2) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: min(var(--wu-content-width), calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}
body > .container-fluid > .row:nth-of-type(2) > .col-12 { width: 100%; max-width: none; padding: 0; }
.logo { width: 50px; height: 50px; margin: 0 14px 10px 0; object-fit: contain; border-radius: 14px; box-shadow: var(--wu-shadow-sm); }

h1, h2, h3, h4 { color: var(--ink); }
h1 { margin: 0 0 8px; max-width: 830px; font-size: clamp(2rem, 4vw, 3.15rem); font-weight: var(--wu-weight-bold); letter-spacing: -.045em; line-height: 1.06; }
h2 { font-weight: var(--wu-weight-bold); letter-spacing: -.025em; }
h3, h4 { font-weight: var(--wu-weight-semibold); }
.page-intro { max-width: 760px; margin: 0; color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.13rem); line-height: 1.7; }
mark.sm { padding: 0; color: var(--green); background: transparent; font-size: .9rem; font-weight: var(--wu-weight-semibold); }
hr.solid { margin: 18px 0; border: 0; border-top: 1px solid var(--line); }

.home-hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; color: var(--muted); font-size: .78rem; font-weight: var(--wu-weight-medium); }
.home-hero-meta span { padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--wu-radius-pill); background: #fff; }
.home-hero-meta span:first-child { color: var(--deep); border-color: #bfe2cb; background: var(--mint); }
.home-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.home-hero-cta {
  display: inline-flex;
  min-height: var(--wu-control-height);
  align-items: center;
  justify-content: center;
  padding: .7rem 1rem;
  border: 1px solid #c5ddd0;
  border-radius: var(--wu-radius-md);
  color: var(--deep);
  background: #fff;
  font-size: .9rem;
  font-weight: var(--wu-weight-semibold);
  text-decoration: none;
  transition: transform var(--wu-transition-fast), box-shadow var(--wu-transition-fast), background var(--wu-transition-fast);
}
.home-hero-cta:hover { transform: translateY(-1px); box-shadow: var(--wu-shadow-sm); text-decoration: none; }
.home-hero-cta-primary { border-color: var(--green); color: #fff; background: var(--green); }
.home-hero-cta-primary:hover { color: #fff; background: var(--deep); }
.home-hero-cta-tertiary { border-color: transparent; background: transparent; }

.col-12.col-md-9 > .container:nth-of-type(2) { max-width: none; padding: 0; }
.col-12.col-md-9 > .container:nth-of-type(2) > .row > div.home-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.home-actions-group { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn, .home-actions summary {
  min-height: 40px;
  margin: 0 !important;
  padding: .55rem .78rem !important;
  border-radius: var(--wu-radius-md) !important;
  font-size: .86rem;
  font-weight: var(--wu-weight-semibold);
  box-shadow: none !important;
  transition: transform var(--wu-transition-fast), box-shadow var(--wu-transition-fast);
}
.btn:hover, .home-actions summary:hover { transform: translateY(-1px); box-shadow: var(--wu-shadow-sm) !important; }
.btn-success { background: var(--green) !important; }
.btn-dark { color: #fff !important; background: #26372e !important; }
.btn-outline-editor { border: 1px solid #bdd7c8 !important; color: var(--deep) !important; background: #fff !important; }
.btn-quiet { color: #31473b !important; background: #eef3f0 !important; }

.action-menu { position: relative; }
.action-menu summary { display: inline-flex; align-items: center; gap: 6px; list-style: none; cursor: pointer; }
.action-menu summary::-webkit-details-marker { display: none; }
.action-menu[open] > summary { color: #fff !important; background: var(--green) !important; }
.action-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 1200;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  width: 320px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--wu-radius-lg);
  background: #fff;
  box-shadow: var(--wu-shadow-md);
}
.action-menu-panel label, .action-menu-panel input { grid-column: 1 / -1; }
.action-menu-panel input { min-height: 40px; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--wu-radius-sm); }
.action-menu-panel button, .action-menu-panel a { display: flex; min-height: 40px; align-items: center; gap: 7px; padding: 8px 10px; border: 0; border-radius: var(--wu-radius-sm); color: var(--ink); background: var(--wu-color-surface-soft); text-decoration: none; }
.action-menu-panel button:hover, .action-menu-panel a:hover { background: var(--mint); }
.settings-panel { right: 0; left: auto; display: grid; width: 250px; }

.editor-chrome, .input-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  margin-top: 14px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--wu-radius-lg) var(--wu-radius-lg) 0 0;
  color: #53665c;
  background: #f5f8f6;
  font-size: .8rem;
  font-weight: var(--wu-weight-medium);
}
.editor-shortcut { color: #77877e; }
.btn-clear { min-height: 32px; margin-left: auto; padding: 4px 9px; border: 0; border-radius: var(--wu-radius-sm); color: #9b3434; background: #ffeded; font-weight: var(--wu-weight-semibold); }
#demo { overflow: hidden; padding: 0 !important; border: 1px solid var(--line) !important; border-radius: 0 0 var(--wu-radius-lg) var(--wu-radius-lg); background: #fff; box-shadow: var(--wu-shadow-md); }
#transliterateTextarea {
  display: block;
  width: 100%;
  min-height: clamp(380px, 58vh, 640px);
  padding: clamp(24px, 4vw, 44px);
  resize: vertical;
  border: 0 !important;
  outline: 0;
  color: #16251e;
  background: #fff;
  font-family: var(--wu-font-urdu) !important;
  font-size: clamp(1.4rem, 2.5vw, 1.8rem) !important;
  line-height: 2.15;
  text-align: right;
  caret-color: var(--green);
}
#transliterateTextarea:focus { box-shadow: inset 0 0 0 3px rgb(23 114 69 / 16%); }
.editor-hint { margin: 10px 2px 0; color: var(--muted); font-size: .82rem; }
#UsageAlert { margin: 20px 0 14px; padding: 14px 16px; border: 1px solid #cdebd9; border-radius: var(--wu-radius-md); color: var(--deep); background: var(--mint); font-size: .9rem; }

.card, .home-new-tools, .home-how-it-works {
  margin-top: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--wu-radius-lg);
  background: rgb(255 255 255 / 94%);
  box-shadow: var(--wu-shadow-sm);
}
.card-body { padding: clamp(24px, 4vw, 38px); }
.card-title { margin-bottom: 16px; font-size: 1.4rem; font-weight: var(--wu-weight-bold); }
.card-subtitle { margin-bottom: 10px; color: var(--green); font-weight: var(--wu-weight-semibold); }
.card-text { display: grid; gap: 10px; margin: 0; color: var(--muted); line-height: 1.7; }
.home-new-tools, .home-how-it-works { padding: 26px; background: linear-gradient(135deg, #f3fbf5, #fff); }
.home-section-eyebrow { margin: 0; color: var(--green); font-size: .73rem; font-weight: var(--wu-weight-bold); letter-spacing: .08em; text-transform: uppercase; }
.tool-promo-grid, .home-how-it-works-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.tool-promo-card, .home-how-it-works-list li { padding: 18px; border: 1px solid #dcebe2; border-radius: var(--wu-radius-md); background: #fff; box-shadow: 0 8px 22px rgb(20 35 28 / 5%); }
.tool-promo-card { display: flex; flex-direction: column; gap: 8px; }
.tool-promo-card h3 { margin: 0; font-size: 1.03rem; }
.tool-promo-card p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.6; }
.tool-promo-link { margin-top: auto; font-weight: var(--wu-weight-semibold); text-decoration: none; }
.home-how-it-works-list { margin-bottom: 0; padding: 0; list-style: none; counter-reset: home-step; }
.home-how-it-works-list li { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; counter-increment: home-step; }
.home-how-it-works-list li::before { grid-row: span 2; display: grid; width: 26px; height: 26px; place-items: center; border-radius: 50%; content: counter(home-step); color: #fff; background: var(--green); font-size: .76rem; font-weight: var(--wu-weight-bold); }
.home-how-it-works-list span { color: var(--muted); font-size: .84rem; line-height: 1.5; }

footer { position: static !important; padding: 38px max(20px, calc((100vw - var(--wu-content-width)) / 2)) 0 !important; background: #10281c !important; color: rgb(255 255 255 / 64%) !important; line-height: 2; }
footer a { color: rgb(255 255 255 / 88%) !important; }
footer .text-center { margin: 24px 0 0; padding: 18px 0 !important; border-top: 1px solid rgb(255 255 255 / 8%); font-size: .82rem; }

@media (max-width: 767px) {
  .navbar { padding: .65rem 1rem !important; }
  .navbar-collapse { padding-top: .7rem; }
  body > .container-fluid > .row:nth-of-type(2) { width: min(100% - 22px, var(--wu-content-width)); padding: 22px 0 48px; }
  .logo { width: 46px; height: 46px; border-radius: 12px; }
  h1 { font-size: clamp(1.85rem, 8vw, 2.45rem); }
  .home-hero-actions { align-items: stretch; }
  .home-hero-cta { flex: 1 1 calc(50% - 10px); }
  .home-hero-cta-tertiary { flex-basis: 100%; }
  .home-actions-group { width: 100%; }
  .home-actions .btn, .home-actions summary { flex: 1 1 auto; min-height: 44px; }
  .action-menu { flex: 1 1 auto; }
  .action-menu summary { width: 100%; }
  .action-menu-panel, .settings-panel { position: fixed; right: 12px; bottom: 12px; left: 12px; top: auto; width: auto; max-height: 70vh; overflow: auto; }
  .tool-promo-grid, .home-how-it-works-list { grid-template-columns: 1fr; }
  .home-new-tools, .home-how-it-works { padding: 20px; }
  #transliterateTextarea { min-height: 360px; padding: 22px 18px; font-size: 1.38rem !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
