@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Noto+Nastaliq+Urdu:wght@400;700&display=swap');

/* ══════════════════════════════════════
   LIGHT MODE — default
══════════════════════════════════════ */
.uet-root {
  --bg-card:       #f6f7ff;
  --bg-toolbar:    #f6f7ff;
  --bg-chips:      #f6f7ff;
  --bg-panel-l:    #ffffff;
  --bg-panel-r:    #ffffff;
  --bg-panelbar:   #f6f7ff;
  --bg-label:      #f6f7ff;

  --border:        #c8caee;
  --divider:       #dddff5;

  --text-h:        #111127;
  --text-body:     #1e1e3a;
  --text-muted:    #5a5a8a;
  --text-dim:      #aaaac8;

  --accent:        #059669;
  --accent-h:      #047857;
  --accent-light:  #d1fae5;
  --accent-dim:    #6ee7b7;

  --chip-bg:       #e8eafc;
  --chip-border:   #c8caee;
  --chip-hover:    #dddff5;
  --chip-text:     #4a4a72;

  --urdu-input:    #111127;
  --en-output:     #1e1e3a;
  --ph-color:      #b0b0d0;
  --err-color:     #b91c1c;
  --rtl-badge-bg:  #e8eafc;
  --rtl-badge-txt: #4f46e5;

  --shadow: 0 2px 16px rgba(79,70,229,0.09), 0 0 0 1px #c8caee;
  --radius: 14px;
  --radius-sm: 8px;

  max-width: 860px;
  margin: 0 auto;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text-body);
}

/* ══════════════════════════════════════
   DARK MODE
══════════════════════════════════════ */
.uet-root.uet-dark {
  --bg-card:       #0f1f18;
  --bg-toolbar:    #0a1a12;
  --bg-chips:      #0d1a14;
  --bg-panel-l:    #0f1f18;
  --bg-panel-r:    #0a1a14;
  --bg-panelbar:   #0a1a12;
  --bg-label:      #0d1a14;

  --border:        #1a4030;
  --divider:       #142e22;

  --text-h:        #d0f0e4;
  --text-body:     #b0d8c8;
  --text-muted:    #5a9080;
  --text-dim:      #2a4a38;

  --accent:        #10b981;
  --accent-h:      #34d399;
  --accent-light:  #064e3b;
  --accent-dim:    #065f46;

  --chip-bg:       #0d2a1e;
  --chip-border:   #1a4030;
  --chip-hover:    #143824;
  --chip-text:     #6ee7b7;

  --urdu-input:    #c8f0e0;
  --en-output:     #b0d8c8;
  --ph-color:      #1e3a2c;
  --rtl-badge-bg:  #0d2a1e;
  --rtl-badge-txt: #6ee7b7;

  --shadow: 0 4px 32px rgba(0,0,0,0.6), 0 0 0 1px #1a4030;
}

/* ══════════════════════════════════════
   SEO HEADER
══════════════════════════════════════ */
.uet-h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-h);
  line-height: 1.3;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
  transition: color 0.3s;
}

.uet-tagline {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 20px;
  transition: color 0.3s;
}

/* ══════════════════════════════════════
   CARD
══════════════════════════════════════ */
.uet-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: background 0.3s, box-shadow 0.3s;
}

/* ── Toolbar ── */
.uet-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  background: var(--bg-toolbar);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}

.uet-lang-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
}

.uet-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  transition: color 0.3s;
}

.uet-tab.uet-tab-active { color: var(--accent); }

.uet-tab-arrow {
  font-size: 15px;
  color: var(--text-dim);
  transition: color 0.3s;
}

.uet-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.uet-dot-ur { background: var(--accent); }
.uet-dot-en { background: #3b82f6; }

.uet-theme-btn {
  background: var(--bg-panel-l);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.2s;
  padding: 0;
}
.uet-theme-btn:hover { background: var(--chip-hover); }

/* ── Chips ── */
.uet-chips-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  padding: 10px 18px 12px;
  background: var(--bg-chips);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}

.uet-chips-label {
  font-family: 'Noto Nastaliq Urdu', serif;
  font-size: 13px;
  color: var(--text-dim);
  white-space: nowrap;
  direction: rtl;
}

.uet-chip {
  font-family: 'Noto Nastaliq Urdu', serif;
  font-size: 13px;
  color: var(--chip-text);
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  border-radius: 20px;
  padding: 4px 14px;
  cursor: pointer;
  transition: all 0.15s;
  direction: rtl;
  line-height: 1.8;
}
.uet-chip:hover {
  background: var(--chip-hover);
  border-color: var(--accent);
  color: var(--accent);
}

/* ══════════════════════════════════════
   PANELS
══════════════════════════════════════ */
.uet-panels {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  min-height: 250px;
}

.uet-panel-divider { background: var(--divider); }

.uet-panel {
  display: flex;
  flex-direction: column;
}

.uet-panel-left  { background: var(--bg-panel-l); transition: background 0.3s; }
.uet-panel-right { background: var(--bg-panel-r); transition: background 0.3s; }

/* ── Panel label ── */
.uet-panel-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px 9px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: var(--bg-label);
  border-bottom: 1px solid var(--divider);
  transition: background 0.3s, color 0.3s;
}

.uet-rtl-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--rtl-badge-txt);
  background: var(--rtl-badge-bg);
  border-radius: 4px;
  padding: 2px 7px;
  transition: background 0.3s, color 0.3s;
}

/* ── Urdu input textarea (RTL, Nastaliq) ── */
.uet-textarea {
  flex: 1;
  width: 100%;
  min-height: 190px;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  padding: 16px 18px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-body);
  caret-color: var(--accent);
  box-sizing: border-box;
  display: block;
  transition: color 0.3s;
}

.uet-textarea-urdu {
  font-family: 'Noto Nastaliq Urdu', serif;
  font-size: 20px;
  line-height: 2.2;
  direction: rtl;
  text-align: right;
  color: var(--urdu-input);
}

.uet-textarea::placeholder { color: var(--text-dim); font-size: 16px; }
.uet-textarea-urdu::placeholder { font-family: 'Noto Nastaliq Urdu', serif; font-size: 16px; }

/* ── English output ── */
.uet-out-area {
  flex: 1;
  padding: 16px 18px;
  min-height: 190px;
}

.uet-out-text {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: var(--en-output);
  line-height: 1.75;
  margin: 0;
  transition: color 0.3s;
}

.uet-placeholder {
  font-size: 14px;
  color: var(--ph-color);
  line-height: 1.6;
  font-style: italic;
  transition: color 0.3s;
}

/* ── Loader dots ── */
.uet-loader {
  display: none;
  gap: 5px;
  align-items: center;
  margin-top: 12px;
}
.uet-loader.uet-on { display: flex; }

.uet-ld {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.2;
  animation: uet-pulse 1.2s ease-in-out infinite;
}
.uet-ld:nth-child(2) { animation-delay: 0.2s; }
.uet-ld:nth-child(3) { animation-delay: 0.4s; }
@keyframes uet-pulse { 0%,100%{opacity:.15} 50%{opacity:.8} }

.uet-error {
  font-size: 13px;
  color: var(--err-color);
  line-height: 1.5;
  margin: 8px 0 0;
}

/* ── Panel bottom bar ── */
.uet-panel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 16px 10px;
  background: var(--bg-panelbar);
  border-top: 1px solid var(--divider);
  gap: 8px;
  transition: background 0.3s;
}

.uet-panel-bar-right { justify-content: flex-end; }

.uet-bar-actions { display: flex; gap: 8px; align-items: center; }

.uet-cc {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  transition: color 0.3s;
}

.uet-char-hint {
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
}

/* ══════════════════════════════════════
   BUTTONS
══════════════════════════════════════ */
.uet-btn {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  padding: 7px 16px;
  line-height: 1.4;
  transition: all 0.15s;
  white-space: nowrap;
}

.uet-btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--divider);
}
.uet-btn-ghost:hover { background: var(--chip-bg); color: var(--text-body); border-color: var(--border); }

.uet-btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
}
.uet-btn-primary:hover:not(:disabled) { background: var(--accent-h); border-color: var(--accent-h); }
.uet-btn-primary:active:not(:disabled) { transform: scale(0.97); }
.uet-btn-primary:disabled {
  background: var(--accent-light);
  border-color: var(--accent-light);
  color: var(--accent-dim);
  cursor: not-allowed;
}

.uet-btn-copy {
  background: transparent;
  color: var(--accent);
  border-color: var(--chip-border);
  font-size: 12px;
  padding: 4px 12px;
}
.uet-btn-copy:hover { background: var(--chip-bg); border-color: var(--accent); }
.uet-btn-copy.uet-ok { color: #065f46; border-color: #6ee7b7; background: var(--chip-bg); }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 600px) {
  .uet-panels {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1px auto;
  }
  .uet-panel-divider { height: 1px; }
  .uet-h1 { font-size: 18px; }
  .uet-toolbar { flex-wrap: wrap; gap: 8px; }
}
