/* ================================================================
   IndianTyping.com — tool.css
   Loaded only on: hindi-typing-tool.php, urdu-typing-tool.php,
                   bengali-typing-tool.php
   Depends on: main.css (must load first)
   Never contains: nav, footer, animations (those are in main.css)
================================================================ */

/* ================================================================
   1. PAGE LAYOUT
================================================================ */
.page-wrap {
  max-width: var(--tool-max);
  margin: 0 auto;
  padding: calc(var(--nav-h) + 32px) 24px 80px;
}

/* ================================================================
   2. PAGE HEADER
================================================================ */
.page-header {
  margin-bottom: 28px;
  animation: fadeUp 0.5s var(--ease) both;
}

.page-header h1 {
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 800; letter-spacing: -0.025em;
  line-height: 1.2; color: var(--text-1); margin-bottom: 6px;
}

.page-header h1 .hi { color: var(--brand); }

.page-header .sub {
  font-size: 15px; color: var(--text-2); line-height: 1.6;
}

.page-header .sub-dev {
  font-family: var(--font-dev); font-size: 16px;
  color: var(--text-2); margin-top: 2px;
}

/* ================================================================
   3. LANGUAGE TABS
================================================================ */
.lang-tabs {
  display: flex; gap: 6px; margin-bottom: 20px;
  animation: fadeUp 0.5s var(--ease) 0.05s both;
}

.lang-tab {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  font-size: 14px; font-weight: 600; color: var(--text-2);
  transition: all 0.2s var(--ease); cursor: pointer;
}

.lang-tab .tab-native {
  font-family: var(--font-dev); font-size: 16px; font-weight: 700;
}

.lang-tab:hover {
  border-color: var(--border-2); color: var(--text-1);
  background: var(--surface-3);
}

.lang-tab.active {
  border-color: var(--brand); background: var(--brand-dim);
  color: var(--brand); box-shadow: var(--shadow-glow);
}

.lang-tab.active .tab-native { color: var(--brand); }

.tab-badge {
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 2px 7px;
  border-radius: 100px; background: var(--brand); color: #fff;
}

/* ================================================================
   4. TOOL PANELS — Two-column input/output area
================================================================ */
.tool-area {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px; margin-bottom: 16px;
  animation: fadeUp 0.5s var(--ease) 0.1s both;
}

.tool-panel {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  display: flex; flex-direction: column;
  overflow: hidden; transition: border-color 0.2s;
}

.tool-panel:focus-within {
  border-color: var(--brand);
  box-shadow: var(--shadow-glow);
}

.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.panel-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-3);
}

.panel-label-active { color: var(--brand); }

.panel-stats {
  font-size: 12px; color: var(--text-3); font-weight: 500;
  display: flex; gap: 14px;
}

.panel-stats span { transition: color 0.2s; }
.panel-stats span.has-content { color: var(--text-2); }

/* Text areas */
.tool-textarea {
  flex: 1; width: 100%; padding: 18px 18px 14px;
  font-family: var(--font);
  font-size: 17px; line-height: 1.75; color: var(--text-1);
  background: transparent; border: none; outline: none; resize: none;
  min-height: 200px; caret-color: var(--brand); transition: color 0.2s;
}

.tool-textarea::placeholder { color: var(--text-3); font-size: 16px; }

.output-display {
  flex: 1; width: 100%; padding: 18px 18px 14px;
  font-family: var(--font-dev);
  font-size: 20px; line-height: 1.85; color: var(--text-1);
  min-height: 200px; word-break: break-word; white-space: pre-wrap;
}

.output-display.empty {
  color: var(--text-3); font-size: 16px; font-family: var(--font);
}

.output-display.rtl { direction: rtl; text-align: right; }

/* Panel footer */
.panel-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-top: 1px solid var(--border); background: var(--surface-2);
  gap: 8px; flex-wrap: wrap;
}

.panel-footer-left  { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.panel-footer-right { display: flex; align-items: center; gap: 6px; }

/* ================================================================
   5. BUTTONS (tool-specific)
================================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); transition: all 0.15s var(--ease);
  cursor: pointer; white-space: nowrap;
}

.btn:hover { border-color: var(--border-2); color: var(--text-1); background: var(--surface-3); }

.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 4px 14px rgba(232,66,10,0.3); }

.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border); }

.btn-danger { color: var(--red); border-color: transparent; background: transparent; }
.btn-danger:hover { background: var(--red-dim); border-color: var(--red); }

.btn-copy.copied { background: var(--green); border-color: var(--green); color: #fff; }

.btn-whatsapp { background: #25D366; border-color: #25D366; color: #fff; }
.btn-whatsapp:hover { filter: brightness(1.05); }

.btn-icon-sm {
  width: 32px; height: 32px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--text-2); transition: all 0.15s;
}

.btn-icon-sm:hover { border-color: var(--border-2); color: var(--text-1); background: var(--surface-3); }

/* Char count pill */
.char-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--text-3); font-weight: 500;
  padding: 3px 10px; border-radius: 100px;
  background: var(--surface-3); border: 1px solid var(--border);
}

/* ================================================================
   6. BEGINNER HELPER
================================================================ */
.helper-section {
  background: var(--surface);
  border: 1.5px solid var(--border); border-radius: var(--r-xl);
  overflow: hidden; margin-bottom: 16px;
  animation: fadeUp 0.5s var(--ease) 0.15s both;
  transition: border-color 0.2s;
}

.helper-section:hover { border-color: var(--border-2); }

.helper-toggle {
  width: 100%; display: flex; align-items: center;
  justify-content: space-between; padding: 14px 20px;
  cursor: pointer; background: none; font-family: var(--font);
}

.helper-toggle-left { display: flex; align-items: center; gap: 10px; }

.helper-toggle-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--brand-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}

.helper-toggle-text { text-align: left; }
.helper-toggle-title { font-size: 14px; font-weight: 700; color: var(--text-1); display: block; }
.helper-toggle-sub   { font-size: 12px; color: var(--text-3); display: block; margin-top: 1px; }

.helper-chevron {
  font-size: 18px; color: var(--text-3);
  transition: transform 0.25s var(--ease);
}

.helper-section.open .helper-chevron { transform: rotate(180deg); }

.helper-body {
  display: none; padding: 0 20px 20px;
  border-top: 1px solid var(--border);
  animation: fadeUp 0.3s var(--ease) both;
}

.helper-section.open .helper-body { display: block; }

.helper-intro {
  font-size: 14px; color: var(--text-2); line-height: 1.65;
  padding: 16px 0 12px;
}

/* Example cards */
.helper-examples {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-bottom: 16px;
}

.ex-card {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 12px 14px;
  cursor: pointer; transition: all 0.2s var(--ease);
}

.ex-card:hover {
  border-color: var(--brand); background: var(--brand-dim);
  transform: translateY(-1px);
}

.ex-card:hover .ex-english { color: var(--brand); }
.ex-english { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.ex-arrow   { font-size: 11px; color: var(--text-3); margin-bottom: 5px; }
.ex-hindi   { font-family: var(--font-dev); font-size: 18px; font-weight: 600; color: var(--text-1); }

/* Rules grid */
.helper-rules {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 14px 16px;
}

.rules-title {
  font-size: 12px; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--text-3); margin-bottom: 10px;
}

.rules-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 20px; }

.rule-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; padding: 3px 0;
}

.rule-en  { font-weight: 600; color: var(--brand); min-width: 40px; font-family: monospace; font-size: 14px; }
.rule-sep { color: var(--text-3); font-size: 11px; }
.rule-hi  { font-family: var(--font-dev); font-size: 16px; color: var(--text-1); }
.rule-ex  { font-size: 11px; color: var(--text-3); }

.helper-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 600; color: var(--brand);
  margin-top: 12px; transition: gap 0.15s;
}

.helper-link:hover { gap: 8px; }

/* ================================================================
   7. VIRTUAL KEYBOARD
================================================================ */
.keyboard-section {
  background: var(--surface);
  border: 1.5px solid var(--border); border-radius: var(--r-xl);
  overflow: hidden; margin-bottom: 16px;
  animation: fadeUp 0.5s var(--ease) 0.18s both;
  transition: border-color 0.2s;
}

.keyboard-section:hover { border-color: var(--border-2); }

.keyboard-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
}

.kb-header-left { display: flex; align-items: center; gap: 10px; }
.kb-title { font-size: 14px; font-weight: 700; color: var(--text-1); }
.kb-sub   { font-size: 12px; color: var(--text-3); margin-top: 1px; }

.kb-layout-btns { display: flex; gap: 6px; }

.kb-layout-btn {
  padding: 6px 12px; border-radius: 6px;
  font-size: 12px; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2);
  transition: all 0.15s;
}

.kb-layout-btn.active {
  border-color: var(--brand); background: var(--brand-dim); color: var(--brand);
}

.kb-layout-btn:hover:not(.active) {
  border-color: var(--border-2); color: var(--text-1); background: var(--surface-3);
}

.keyboard-body { padding: 16px 20px 20px; }

.kb-legend { display: flex; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }

.kb-legend-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-3); font-weight: 500;
}

.kb-legend-dot { width: 12px; height: 12px; border-radius: 3px; }

.kb-rows { display: flex; flex-direction: column; gap: 6px; }
.kb-row  { display: flex; gap: 5px; align-items: center; justify-content: center; }

.key {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 44px; height: 50px; padding: 0 6px;
  border-radius: 7px; border: 1px solid var(--border);
  background: var(--surface-2); cursor: pointer; position: relative;
  transition: all 0.12s var(--ease); flex-shrink: 0; user-select: none;
}

.key:hover {
  border-color: var(--border-2); background: var(--surface-3);
  transform: translateY(-1px); box-shadow: var(--shadow-sm);
}

.key:active { transform: translateY(0); box-shadow: none; }
.key.active { background: var(--brand-dim) !important; border-color: var(--brand) !important; }

.key-en       { font-size: 10px; font-weight: 700; color: var(--text-3); line-height: 1; margin-bottom: 2px; }
.key-hi       { font-family: var(--font-dev); font-size: 14px; font-weight: 600; color: var(--text-1); line-height: 1; }
.key-hi-shift { font-family: var(--font-dev); font-size: 10px; color: var(--text-3); line-height: 1; margin-top: 1px; }

.key.vowel { background: rgba(27,107,58,0.06); border-color: rgba(27,107,58,0.2); }
.key.vowel .key-hi { color: var(--green); }
[data-theme="dark"] .key.vowel { background: rgba(82,183,136,0.08); border-color: rgba(82,183,136,0.2); }

.key.matra { background: rgba(26,86,160,0.06); border-color: rgba(26,86,160,0.2); }
.key.matra .key-hi { color: var(--blue); }
[data-theme="dark"] .key.matra { background: rgba(116,185,255,0.08); border-color: rgba(116,185,255,0.2); }

.key.special     { background: var(--surface-3); min-width: 60px; }
.key.special .key-en { font-size: 11px; }
.key.space-key   { min-width: 220px; height: 42px; }
.key.space-key .key-en { font-size: 12px; color: var(--text-2); }

/* ================================================================
   8. SEO / CONTENT SECTIONS
================================================================ */
.content-section {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--r-xl); padding: 36px 40px; margin-bottom: 20px;
}

.content-section h2 {
  font-size: 22px; font-weight: 800; letter-spacing: -0.02em;
  color: var(--text-1); margin-bottom: 12px; line-height: 1.3;
}

.content-section h3 {
  font-size: 17px; font-weight: 700; color: var(--text-1);
  margin: 24px 0 10px; letter-spacing: -0.01em;
}

.content-section p  { font-size: 15px; color: var(--text-2); line-height: 1.75; margin-bottom: 14px; }
.content-section ul { padding-left: 20px; margin-bottom: 14px; }
.content-section li { font-size: 15px; color: var(--text-2); line-height: 1.75; margin-bottom: 6px; }

/* Tool ad unit */
.ad-unit { height: 90px; margin-bottom: 32px; }

/* ================================================================
   9. RESPONSIVE
================================================================ */
@media (max-width: 800px) {
  .tool-area      { grid-template-columns: 1fr; }
  .tool-textarea,
  .output-display { min-height: 150px; font-size: 16px; }
  .output-display { font-size: 18px; }
  .helper-examples  { grid-template-columns: repeat(2, 1fr); }
  .rules-grid       { grid-template-columns: 1fr; }
  .keyboard-section { display: none; }
  .nav-breadcrumb   { display: none; }
  .content-section  { padding: 24px 20px; }
}

@media (max-width: 560px) {
  .lang-tabs { flex-wrap: wrap; }
  .lang-tab  { flex: 1; justify-content: center; min-width: 0; }
  .helper-examples { grid-template-columns: 1fr; }
  .page-wrap { padding-left: 16px; padding-right: 16px; }
}