/* =====================================================
   EnglishToTelugu.net — Main Stylesheet
   Design: Refined dark-first with warm amber accents
   Fonts: Sora (UI) + Noto Sans Telugu (script)
   ===================================================== */

/* ---- Variables ---- */
:root {
  --bg: #0d0d14;
  --bg-card: #13131f;
  --bg-panel: #17172a;
  --bg-hover: #1e1e30;
  --border: rgba(255,255,255,0.07);
  --border-focus: rgba(255,180,50,0.5);
  --text: #e8e8f0;
  --text-secondary: #9090a8;
  --text-muted: #5a5a72;
  --accent: #f5a623;
  --accent-2: #e5722a;
  --accent-glow: rgba(245,166,35,0.18);
  --gradient: linear-gradient(135deg, #f5a623, #e5722a);
  --success: #34d399;
  --error: #f87171;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-sm: 0 2px 12px rgba(0,0,0,0.25);
  --font: 'Sora', sans-serif;
  --font-te: 'Noto Sans Telugu', serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition: 0.2s ease;
  --header-h: 68px;
}

.light-mode {
  --bg: #f4f0e8;
  --bg-card: #ffffff;
  --bg-panel: #faf8f2;
  --bg-hover: #f0ece0;
  --border: rgba(0,0,0,0.1);
  --border-focus: rgba(229,114,42,0.5);
  --text: #1a1a2e;
  --text-secondary: #4a4a6a;
  --text-muted: #8888aa;
  --accent-glow: rgba(245,166,35,0.12);
  --shadow: 0 8px 32px rgba(0,0,0,0.12);
  --shadow-sm: 0 2px 12px rgba(0,0,0,0.08);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; transition: opacity var(--transition); }
a:hover { opacity: 0.8; }
button { font-family: var(--font); cursor: pointer; border: none; background: none; }

/* ---- Accessibility ---- */
.skip-link {
  position: absolute; top: -999px; left: 16px; padding: 8px 16px;
  background: var(--accent); color: #000; font-weight: 600; border-radius: 8px;
  z-index: 9999; transition: top 0s;
}
.skip-link:focus { top: 12px; }

*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---- Container ---- */
.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13,13,20,0.92);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}
.light-mode .site-header { background: rgba(244,240,232,0.92); }

.header-inner {
  display: flex; align-items: center; gap: 24px;
  height: var(--header-h);
}

.logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text);
}
.logo-icon {
  font-family: var(--font-te);
  font-size: 1.6rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 600;
}
.logo-text { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; }
.accent { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.logo-dot { color: var(--text-muted); font-size: 0.85rem; font-weight: 400; }

.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-link {
  padding: 8px 14px; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: 0.9rem; font-weight: 500;
  transition: background var(--transition), color var(--transition);
}
.nav-link:hover, .nav-link.active {
  background: var(--bg-hover); color: var(--text); opacity: 1;
}

.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: background var(--transition), border-color var(--transition);
  flex-shrink: 0;
}
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle:hover { background: var(--bg-hover); color: var(--accent); border-color: var(--accent); }

.icon-sun { display: block; }
.icon-moon { display: none; }
.light-mode .icon-sun { display: none; }
.light-mode .icon-moon { display: block; }

.menu-toggle {
  display: none; flex-direction: column; justify-content: center;
  gap: 5px; width: 38px; height: 38px; padding: 8px; flex-shrink: 0;
}
.menu-toggle span {
  display: block; height: 2px; background: var(--text);
  border-radius: 2px; transition: transform 0.3s, opacity 0.3s;
}
.menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  display: none; flex-direction: column; gap: 4px;
  padding: 12px 20px 16px; border-top: 1px solid var(--border);
  background: var(--bg-card);
}
.mobile-nav.open { display: flex; }
.mobile-nav-link {
  padding: 10px 14px; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: 0.95rem; font-weight: 500;
}
.mobile-nav-link:hover { background: var(--bg-hover); color: var(--text); opacity: 1; }

/* ---- Hero ---- */
.hero {
  position: relative; overflow: hidden;
  padding: 80px 0 60px;
  text-align: center;
}
.hero-inner { position: relative; z-index: 2; }

.hero-badge {
  display: inline-block;
  padding: 6px 18px; border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 20px;
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: var(--text-secondary);
  max-width: 580px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.hero-stats {
  display: flex; align-items: center; justify-content: center; gap: 24px;
  flex-wrap: wrap;
}
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat strong { font-size: 1.3rem; font-weight: 700; color: var(--accent); }
.stat span { font-size: 0.75rem; color: var(--text-muted); letter-spacing: 0.04em; text-transform: uppercase; }
.stat-sep { width: 1px; height: 36px; background: var(--border); }

.hero-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.blob {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.18;
  animation: floatBlob 8s ease-in-out infinite alternate;
}
.blob-1 { width: 480px; height: 480px; background: var(--accent); top: -180px; left: -120px; }
.blob-2 { width: 380px; height: 380px; background: var(--accent-2); bottom: -160px; right: -80px; animation-delay: -4s; }

@keyframes floatBlob {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, 20px) scale(1.08); }
}

/* ---- Translator Section ---- */
.translator-section { padding: 0 0 60px; }

.translator-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.5);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Lang Bar */
.lang-bar {
  display: flex; align-items: center; gap: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
}

.lang-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 20px;
  font-size: 0.95rem; font-weight: 600;
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
  border-bottom: 3px solid transparent;
}
.lang-btn:hover { color: var(--text); }
.lang-btn.active {
  color: var(--text);
  border-bottom-color: var(--accent);
  background: var(--bg-card);
}
.lang-flag { font-size: 1.2rem; }

.swap-btn {
  width: 48px; height: 48px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition), transform 0.4s ease;
}
.swap-btn:hover { background: var(--accent); color: #000; transform: rotate(180deg); }
.swap-btn svg { width: 18px; height: 18px; }

/* Text Panels */
.text-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 260px;
}

.panel {
  display: flex; flex-direction: column;
  border-right: 1px solid var(--border);
}
.panel:last-child { border-right: none; }

.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 0;
}
.panel-label { font-size: 0.78rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.char-count { font-size: 0.75rem; color: var(--text-muted); font-family: var(--font-mono); }

.panel-textarea {
  flex: 1; width: 100%; border: none; outline: none; resize: none;
  background: transparent; color: var(--text);
  font-family: var(--font); font-size: 1.05rem; line-height: 1.7;
  padding: 12px 16px;
  min-height: 180px;
}
.panel-textarea::placeholder { color: var(--text-muted); }

.output-area {
  cursor: default;
  font-family: var(--font-te), var(--font);
  font-size: 1.05rem; line-height: 1.8;
  color: var(--text);
  overflow-y: auto;
  word-break: break-word;
}
.placeholder-text { color: var(--text-muted); font-family: var(--font); font-style: italic; }
.output-area.has-content .placeholder-text { display: none; }

.panel-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-panel);
  flex-wrap: wrap; gap: 4px;
}

.panel-actions { display: flex; align-items: center; gap: 2px; }

.action-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 10px; border-radius: var(--radius-sm);
  font-size: 0.78rem; font-weight: 500; color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
}
.action-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.action-btn:hover { background: var(--bg-hover); color: var(--text); }
.action-btn.success { color: var(--success); }

.word-count { font-size: 0.75rem; color: var(--text-muted); font-family: var(--font-mono); }

.translation-status {
  font-size: 0.75rem; font-weight: 500;
  padding: 3px 10px; border-radius: 999px;
}
.translation-status.loading { background: rgba(245,166,35,0.15); color: var(--accent); }
.translation-status.error { background: rgba(248,113,113,0.15); color: var(--error); }
.translation-status.done { background: rgba(52,211,153,0.15); color: var(--success); }

/* Translate Button Bar */
.translate-bar {
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  gap: 12px; padding: 20px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-panel);
}

.translate-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 40px;
  background: var(--gradient);
  color: #fff; font-size: 1rem; font-weight: 700; letter-spacing: 0.02em;
  border-radius: 999px;
  box-shadow: 0 4px 20px rgba(245,166,35,0.35);
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
  position: relative; overflow: hidden;
}
.translate-btn::before {
  content: ''; position: absolute; inset: 0;
  background: rgba(255,255,255,0.15);
  transform: translateX(-100%);
  transition: transform 0.4s ease;
}
.translate-btn:hover::before { transform: translateX(0); }
.translate-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(245,166,35,0.45); }
.translate-btn:active { transform: translateY(0); }

.btn-arrow { font-size: 1.1rem; transition: transform var(--transition); }
.translate-btn:hover .btn-arrow { transform: translateX(4px); }
.btn-loading { display: none; }
.translate-btn.loading .btn-text,
.translate-btn.loading .btn-arrow { display: none; }
.translate-btn.loading .btn-loading { display: flex; }

.spinner { width: 20px; height: 20px; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Toggle Switch */
.toggle-switch {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; user-select: none;
}
.toggle-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  width: 38px; height: 22px; border-radius: 999px;
  background: var(--bg-hover); border: 1px solid var(--border);
  position: relative; transition: background 0.2s;
  flex-shrink: 0;
}
.toggle-track::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--text-muted);
  transition: transform 0.2s, background 0.2s;
}
.toggle-switch input:checked + .toggle-track { background: var(--accent); border-color: var(--accent); }
.toggle-switch input:checked + .toggle-track::after { transform: translateX(16px); background: #fff; }
.toggle-label { font-size: 0.82rem; color: var(--text-secondary); font-weight: 500; }

/* Transliteration Row */
.transliteration-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  font-size: 0.9rem;
}
.translit-label {
  display: flex; align-items: center; gap: 6px;
  color: var(--text-muted); font-weight: 600; font-size: 0.8rem;
  white-space: nowrap; flex-shrink: 0;
}
.translit-label svg { width: 14px; height: 14px; }
.translit-text {
  flex: 1; font-family: var(--font-mono); font-size: 0.88rem;
  color: var(--accent); letter-spacing: 0.02em;
}
.translit-copy { padding: 4px 8px; margin-left: auto; }

/* Quick Examples */
.quick-examples { margin-top: 24px; }
.examples-label { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 10px; font-weight: 500; }
.examples-list { display: flex; flex-wrap: wrap; gap: 8px; }
.example-chip {
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text-secondary);
  font-size: 0.82rem; font-weight: 500;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.example-chip:hover {
  background: var(--accent-glow); color: var(--accent);
  border-color: var(--accent);
}

/* ---- Features Section ---- */
.features-section {
  padding: 80px 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700; text-align: center;
  letter-spacing: -0.02em; margin-bottom: 10px;
}
.section-sub { text-align: center; color: var(--text-secondary); margin-bottom: 48px; font-size: 1rem; }

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

.feature-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 24px var(--accent-glow);
}
.feature-icon { font-size: 2rem; margin-bottom: 14px; }
.feature-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.feature-card p { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.65; }

/* ---- About Section ---- */
.about-section {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}
.about-inner {
  display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: start;
}
.about-content h2 { font-size: 1.8rem; font-weight: 700; margin-bottom: 18px; letter-spacing: -0.02em; }
.about-content h3 { font-size: 1.1rem; font-weight: 600; margin: 24px 0 12px; }
.about-content p { color: var(--text-secondary); line-height: 1.75; margin-bottom: 14px; }
.tips-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.tips-list li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6;
}
.tips-list li::before { content: '→'; color: var(--accent); font-weight: 700; flex-shrink: 0; }

.telugu-script-showcase {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.script-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px 8px;
  transition: border-color var(--transition), background var(--transition);
}
.script-item:hover { border-color: var(--accent); background: var(--accent-glow); }
.script-item span {
  font-family: var(--font-te); font-size: 2rem; color: var(--text);
  line-height: 1;
}
.script-item em { font-style: normal; font-size: 0.72rem; color: var(--text-muted); font-family: var(--font-mono); }

/* ---- FAQ Section ---- */
.faq-section {
  padding: 80px 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}
.faq-list { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }

.faq-item {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--transition);
}
.faq-item[open] { border-color: var(--accent); }
.faq-item[open] > .faq-q { color: var(--accent); }

.faq-q {
  padding: 18px 20px; cursor: pointer;
  font-weight: 600; font-size: 0.95rem;
  list-style: none; user-select: none;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  transition: color var(--transition);
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::after {
  content: '+'; font-size: 1.3rem; color: var(--text-muted);
  flex-shrink: 0; transition: transform 0.2s;
}
.faq-item[open] .faq-q::after { transform: rotate(45deg); color: var(--accent); }
.faq-a {
  padding: 0 20px 18px;
  font-size: 0.88rem; color: var(--text-secondary); line-height: 1.7;
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}
.footer-inner {
  display: grid; grid-template-columns: 1.5fr 1fr 1.5fr; gap: 40px;
  padding: 60px 0 40px;
}
.footer-brand .footer-logo { margin-bottom: 14px; }
.footer-tagline { font-size: 0.85rem; color: var(--text-muted); max-width: 260px; line-height: 1.6; }
.footer-nav-title { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 14px; }
.footer-links ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-links a { font-size: 0.88rem; color: var(--text-secondary); }
.footer-links a:hover { color: var(--accent); opacity: 1; }
.footer-info p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.65; }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 16px 0;
  text-align: center;
}
.footer-bottom p { font-size: 0.78rem; color: var(--text-muted); }
.footer-legal { margin-top: 4px; }
.footer-legal a { color: var(--text-muted); font-size: 0.75rem; }
.footer-legal a:hover { color: var(--accent); }

/* ---- Toast ---- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  padding: 12px 24px; border-radius: 999px;
  background: var(--bg-card); color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 0.88rem; font-weight: 500;
  z-index: 9999; white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1; pointer-events: auto;
}
.toast.success { border-color: var(--success); color: var(--success); }
.toast.error { border-color: var(--error); color: var(--error); }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .menu-toggle { display: flex; }

  .about-inner { grid-template-columns: 1fr; gap: 40px; }
  .about-visual { order: -1; }

  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  .hero { padding: 50px 0 40px; }

  .text-panels { grid-template-columns: 1fr; }
  .panel { border-right: none; border-bottom: 1px solid var(--border); }
  .panel:last-child { border-bottom: none; }

  .lang-bar { gap: 0; }
  .lang-btn .lang-flag { font-size: 1rem; }

  .translate-bar { padding: 16px; }
  .translate-btn { padding: 12px 28px; font-size: 0.95rem; }

  .footer-inner { grid-template-columns: 1fr; gap: 30px; }

  .hero-stats { gap: 16px; }
  .stat-sep { height: 24px; }

  .transliteration-row { flex-wrap: wrap; }
}

@media (max-width: 420px) {
  .container { padding: 0 14px; }
  .translator-card { border-radius: var(--radius); }
  .features-grid { grid-template-columns: 1fr; }
  .action-btn span { display: none; }
  .action-btn { padding: 6px 8px; }
}

/* ---- Print ---- */
@media print {
  .site-header, .hero, .features-section, .about-section, .faq-section, .site-footer { display: none; }
  .translator-section { padding: 0; }
}
