/* ================================================================
   IndianTyping.com — main.css
   Shared across every page.
   Contains: design system, reset, nav, footer, bottom nav,
             drawer, toast, scroll-reveal, animations, utilities.
   Never contains: page-specific (tool.css / test.css).
================================================================ */

/* ================================================================
   1. DESIGN SYSTEM — CSS CUSTOM PROPERTIES
================================================================ */
:root {
  /* Brand */
  --brand-primary:   #E8420A;
  --brand-secondary: #1B6B3A;
  --brand-accent:    #F5A623;
  --brand-glow:      rgba(232, 66, 10, 0.15);

  /* Semantic aliases (used by tool.css & test.css) */
  --brand:           #E8420A;
  --brand-dim:       rgba(232, 66, 10, 0.12);
  --green:           #1B6B3A;
  --green-dim:       rgba(27, 107, 58, 0.10);
  --red:             #C0392B;
  --red-dim:         rgba(192, 57, 43, 0.10);
  --amber:           #D4770A;
  --amber-dim:       rgba(212, 119, 10, 0.10);
  --blue:            #1A56A0;
  --blue-dim:        rgba(26, 86, 160, 0.10);

  /* Surfaces — Light Mode */
  --bg:              #FAFAF8;
  --bg-alt:          #F2F0EB;
  --surface:         #FFFFFF;
  --surface-2:       #F7F5F0;
  --surface-3:       #EFEDE8;
  --border:          #E8E4DC;
  --border-strong:   #C8C4BC;
  --border-2:        #C8C4BC;  /* alias */
  --text-1:          #1A1814;
  --text-2:          #5C5852;
  --text-3:          #9C9890;

  /* Shadows */
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg:   0 12px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-glow: 0 0 0 3px rgba(232, 66, 10, 0.15);

  /* Typography */
  --font-display:    'Sora', sans-serif;
  --font-devanagari: 'Noto Sans Devanagari', sans-serif;
  --font-urdu:       'Noto Nastaliq Urdu', serif;
  --font-mono:       'JetBrains Mono', monospace;

  /* Aliases used by tool/test CSS */
  --font:     'Sora', sans-serif;
  --font-dev: 'Noto Sans Devanagari', sans-serif;
  --mono:     'JetBrains Mono', monospace;

  /* Layout */
  --nav-h:      64px;
  --max-w:      1200px;
  --tool-max:   1100px;
  --test-max:   760px;

  /* Radii */
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --radius-xl:  28px;
  --r-sm:       6px;
  --r-md:       12px;
  --r-lg:       18px;
  --r-xl:       24px;

  /* Easing */
  --ease:        cubic-bezier(0.22, 1, 0.36, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --easeb:       cubic-bezier(0.34, 1.56, 0.64, 1); /* alias */
}

/* Dark Mode overrides */
[data-theme="dark"] {
  --brand-primary:   #FF5520;
  --brand:           #FF5520;
  --brand-dim:       rgba(255, 85, 32, 0.18);
  --brand-glow:      rgba(255, 85, 32, 0.20);
  --green:           #52B788;
  --green-dim:       rgba(82, 183, 136, 0.12);
  --red:             #FF6B6B;
  --red-dim:         rgba(255, 107, 107, 0.12);

  --bg:              #0E0D0B;
  --bg-alt:          #161410;
  --surface:         #1C1A17;
  --surface-2:       #242220;
  --surface-3:       #2C2A26;
  --border:          #2E2C28;
  --border-strong:   #3E3C38;
  --border-2:        #3E3C38;
  --text-1:          #F0EDE6;
  --text-2:          #A09C94;
  --text-3:          #605C54;

  --shadow-sm:       0 1px 3px rgba(0,0,0,0.30);
  --shadow-md:       0 4px 16px rgba(0,0,0,0.40);
  --shadow-lg:       0 12px 40px rgba(0,0,0,0.50);
  --shadow-glow:     0 0 0 3px rgba(255, 85, 32, 0.20);
}

/* ================================================================
   2. RESET & BASE
================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-display);
  background: var(--bg);
  color: var(--text-1);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

img  { display: block; max-width: 100%; }
a    { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }

/* ================================================================
   3. NAVIGATION
================================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s;
}

.nav.scrolled { box-shadow: var(--shadow-md); }

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 32px;
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nav-logo-mark {
  width: 34px; height: 34px;
  background: var(--brand-primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; color: #fff;
  letter-spacing: -0.5px;
  transition: transform 0.2s var(--ease-bounce);
}

.nav-logo:hover .nav-logo-mark { transform: scale(1.08) rotate(-3deg); }

.nav-logo-text {
  font-size: 17px; font-weight: 700;
  color: var(--text-1); letter-spacing: -0.3px;
}

.nav-logo-text span { color: var(--brand-primary); }

/* Desktop links */
.nav-links {
  display: flex; align-items: center;
  gap: 4px; list-style: none;
  margin-left: auto;
}

.nav-links a {
  display: flex; align-items: center; gap: 4px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; color: var(--text-2);
  transition: color 0.15s, background 0.15s;
}

.nav-links a:hover { color: var(--text-1); background: var(--surface-2); }

.nav-links a.active {
  color: var(--brand-primary);
  background: var(--brand-glow);
}

/* Dropdown */
.nav-links .nav-dropdown { position: relative; }

.nav-links .nav-dropdown > a::after {
  content: '';
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  opacity: 0.6;
}

.nav-dropdown-menu {
  position: absolute;
  /* top: 100% + padding-top creates an invisible bridge
     so mouse can travel from parent to menu without gap */
  top: 100%; left: 0;
  padding-top: 8px;
  min-width: 200px;
  opacity: 0; pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  z-index: 100;
}

/* Visual card sits inside the padding bridge */
.nav-dropdown-menu-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 8px;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1; pointer-events: auto; transform: translateY(0);
}

.nav-dropdown-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  font-size: 14px; color: var(--text-2);
  transition: background 0.12s, color 0.12s;
}

.nav-dropdown-menu a:hover { background: var(--surface-2); color: var(--text-1); }
.nav-dropdown-menu .menu-icon { font-size: 16px; width: 20px; text-align: center; }

/* Nav actions */
.nav-actions {
  display: flex; align-items: center; gap: 8px;
}

/* Theme toggle — works as .btn-theme (homepage) or .btn-icon (inner pages) */
.btn-theme, .btn-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2); font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s var(--ease);
}

.btn-theme { border-radius: 50%; }

.btn-theme:hover, .btn-icon:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: var(--brand-glow);
}

/* Breadcrumb (inner pages) */
.nav-sep { width: 1px; height: 20px; background: var(--border); flex-shrink: 0; }

.nav-breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 14px; color: var(--text-3);
}

.nav-breadcrumb a { color: var(--text-2); transition: color 0.12s; }
.nav-breadcrumb a:hover { color: var(--brand-primary); }
.nav-breadcrumb .sep { color: var(--text-3); font-size: 12px; }
.nav-breadcrumb .current { color: var(--text-1); font-weight: 600; }

/* Nav extra buttons (inner pages) */
.btn-nav-test, .btn-hindi-test {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 13px; font-weight: 600; color: var(--text-2);
  transition: all 0.15s var(--ease);
}

.btn-nav-test:hover, .btn-hindi-test:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: var(--brand-glow);
}

/* Hamburger button */
.btn-menu {
  display: none;
  width: 40px; height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  color: var(--text-1);
}

.btn-menu span {
  display: block; width: 18px; height: 2px;
  background: currentColor; border-radius: 2px;
  transition: all 0.2s var(--ease);
}

/* ================================================================
   4. MOBILE NAV DRAWER
================================================================ */
.nav-drawer {
  display: none;
  position: fixed;
  top: var(--nav-h); left: 0; right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px;
  z-index: 999;
  box-shadow: var(--shadow-lg);
  transform: translateY(-100%);
  transition: transform 0.3s var(--ease);
}

.nav-drawer.open { transform: translateY(0); }

.nav-drawer-section { margin-bottom: 8px; }

.nav-drawer-label {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-3); padding: 8px 12px 4px;
}

.nav-drawer a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: 8px;
  font-size: 15px; font-weight: 500; color: var(--text-2);
  transition: background 0.12s, color 0.12s;
}

.nav-drawer a:hover, .nav-drawer a:active {
  background: var(--surface-2); color: var(--text-1);
}

.nav-drawer a .menu-icon { font-size: 18px; width: 24px; text-align: center; }

/* ================================================================
   5. FOOTER
================================================================ */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 56px 24px 32px;
}

.footer-inner { max-width: var(--max-w); margin: 0 auto; }

.footer-top {
  display: grid;
  grid-template-columns: 1.8fr repeat(3, 1fr);
  gap: 48px; margin-bottom: 48px;
}

/* Brand col — alias for homepage .footer-brand and inner .footer-brand-col */
.footer-brand .nav-logo,
.footer-brand-col .nav-logo,
.footer-logo { margin-bottom: 16px; }

.footer-tagline {
  font-size: 14px; color: var(--text-2);
  line-height: 1.7; max-width: 260px; margin-bottom: 20px;
}

.footer-social { display: flex; gap: 8px; }

.social-btn {
  width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: var(--text-2); transition: all 0.15s;
}

.social-btn:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: var(--brand-glow);
}

.footer-col-title {
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 16px;
}

.footer-links { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-links a { font-size: 14px; color: var(--text-2); transition: color 0.12s; }
.footer-links a:hover { color: var(--brand-primary); }

.footer-bottom {
  border-top: 1px solid var(--border); padding-top: 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}

.footer-copy { font-size: 13px; color: var(--text-3); }

.footer-legal { display: flex; gap: 20px; }
.footer-legal a { font-size: 13px; color: var(--text-3); transition: color 0.12s; }
.footer-legal a:hover { color: var(--text-2); }

/* Ad unit in footer */
.ad-footer-wrap { max-width: var(--max-w); margin: 0 auto 32px; }

.ad-unit {
  width: 100%; background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 12px; font-weight: 500;
  letter-spacing: 0.05em; text-transform: uppercase;
}

.ad-footer { height: 90px; max-width: var(--max-w); margin: 0 auto 32px; }

/* ================================================================
   6. BOTTOM NAV (mobile only)
================================================================ */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 998;
  padding: 0 0 env(safe-area-inset-bottom, 0);
}

.bottom-nav-inner { display: grid; grid-template-columns: repeat(4, 1fr); }

.bottom-nav-item, .bn-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 3px; padding: 10px 4px 8px;
  color: var(--text-3); font-size: 11px; font-weight: 500;
  transition: color 0.15s; cursor: pointer; text-decoration: none;
}

.bottom-nav-item.active, .bn-item.active { color: var(--brand-primary); }

.bottom-nav-item .bn-icon, .bn-item .bn-icon {
  font-size: 22px; line-height: 1;
}

/* ================================================================
   7. TOAST NOTIFICATION SYSTEM
================================================================ */
.toast-container, .toast-wrap {
  position: fixed; bottom: 80px; right: 24px;
  z-index: 2000;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  font-size: 14px; font-weight: 500; color: var(--text-1);
  animation: toastIn 0.3s var(--ease-bounce) both;
  pointer-events: auto;
}

.toast.success { border-color: var(--green); }
.toast .toast-icon { font-size: 16px; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px) scale(0.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

/* ================================================================
   8. SCROLL REVEAL
================================================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.reveal.visible { opacity: 1; transform: translateY(0); }

.reveal-delay-1, .rd1 { transition-delay: 0.1s; }
.reveal-delay-2, .rd2 { transition-delay: 0.2s; }
.reveal-delay-3       { transition-delay: 0.3s; }

/* ================================================================
   9. SHARED ANIMATIONS
================================================================ */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.4); opacity: 0.7; }
}

/* ================================================================
   10. SHARED CONTENT COMPONENTS (used on multiple pages)
================================================================ */

/* FAQ accordion (tool + test pages) */
.faq-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }

.faq-item {
  border: 1px solid var(--border); border-radius: var(--radius-md);
  overflow: hidden; transition: border-color 0.2s;
}

.faq-item:hover { border-color: var(--border-2); }

.faq-q, .faq-q {
  width: 100%; display: flex; align-items: center;
  justify-content: space-between;
  padding: 14px 18px; cursor: pointer;
  background: none; font-family: var(--font-display);
  text-align: left; gap: 12px;
}

.faq-q-text { font-size: 15px; font-weight: 600; color: var(--text-1); }
.faq-chevron, .faq-chev { font-size: 18px; color: var(--text-3); transition: transform 0.25s var(--ease); flex-shrink: 0; }
.faq-item.open .faq-chevron,
.faq-item.open .faq-chev { transform: rotate(180deg); }

.faq-a {
  display: none; padding: 12px 18px 14px;
  font-size: 14px; color: var(--text-2); line-height: 1.7;
  border-top: 1px solid var(--border);
}

.faq-item.open .faq-a { display: block; animation: fadeUp 0.25s var(--ease) both; }

/* Related cards grid */
.related-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px; margin-top: 8px;
}

.related-card {
  display: flex; flex-direction: column;
  padding: 16px 18px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all 0.2s var(--ease);
}

.related-card:hover {
  border-color: var(--brand-primary);
  background: var(--brand-glow);
  transform: translateY(-2px);
}

.related-icon { font-size: 22px; margin-bottom: 8px; }
.related-title { font-size: 14px; font-weight: 700; color: var(--text-1); margin-bottom: 4px; }
.related-desc { font-size: 12px; color: var(--text-3); flex: 1; margin-bottom: 10px; line-height: 1.5; }
.related-link { font-size: 12px; font-weight: 700; color: var(--brand-primary); display: flex; align-items: center; gap: 4px; }

/* Data table (shared) */
.table-wrap {
  overflow-x: auto; margin: 16px 0;
  border-radius: var(--radius-md); border: 1px solid var(--border);
}

.data-table, table.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { background: var(--surface-2); padding: 10px 16px; text-align: left; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); border-bottom: 1px solid var(--border); }
.data-table td { padding: 11px 16px; border-bottom: 1px solid var(--border); color: var(--text-2); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface-2); }

/* Badges */
.badge-pill, .pill { display: inline-block; padding: 2px 10px; border-radius: 100px; font-size: 11px; font-weight: 700; }
.badge-green, .pill-green { background: var(--green-dim); color: var(--green); }
.badge-orange, .pill-amber { background: var(--amber-dim); color: var(--amber); }
.pill-red   { background: var(--red-dim); color: var(--red); }

/* ================================================================
   11. UTILITY CLASSES
================================================================ */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
}

/* ================================================================
   12. RESPONSIVE — SHARED BREAKPOINTS
================================================================ */
@media (max-width: 900px) {
  .nav-links  { display: none; }
  .btn-menu   { display: flex; }
  .nav-drawer { display: block; }
  .bottom-nav { display: block; }
  body { padding-bottom: calc(60px + env(safe-area-inset-bottom, 0)); }

  .footer-top { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-brand,
  .footer-brand-col { grid-column: 1 / -1; }

  .related-grid { grid-template-columns: 1fr; }
}

@media (max-width: 580px) {
  .footer-top    { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .footer        { padding: 40px 16px 24px; }
  .toast-container,
  .toast-wrap    { right: 12px; bottom: 70px; }
}