@import url('https://fonts.googleapis.com/css2?family=Noto+Nastaliq+Urdu&display=swap');

:root {
  --bg: #ffffff;
  --fg: #0f172a;
  --card: #ffffff;
  --card-border: #e2e8f0;
  --muted: #f1f5f9;
  --muted-fg: #64748b;
  --primary: #0f172a;
  --primary-fg: #ffffff;
  --accent: #f1f5f9;
  --ring: #94a3b8;
}

.dark {
  --bg: #0f172a;
  --fg: #f8fafc;
  --card: #1e293b;
  --card-border: #334155;
  --muted: #1e293b;
  --muted-fg: #94a3b8;
  --primary: #f8fafc;
  --primary-fg: #0f172a;
  --accent: #1e293b;
  --ring: #475569;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  transition: background 0.2s, color 0.2s;
}

/* Header */
.header {
  border-bottom: 1px solid var(--card-border);
  background: var(--card);
  padding: 1.5rem 1rem;
}

.header-inner {
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header h1 {
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.header p {
  color: var(--muted-fg);
  margin-top: 0.25rem;
  font-size: 0.95rem;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  border: 1px solid var(--card-border);
  background: var(--card);
  color: var(--fg);
  cursor: pointer;
  font-size: 1.25rem;
  transition: background 0.15s;
}

.icon-btn:hover { background: var(--accent); }

/* Main */
.main {
  max-width: 72rem;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Tabs */
.tabs-list {
  display: flex;
  gap: 0;
  max-width: 28rem;
  background: var(--muted);
  border-radius: 0.5rem;
  padding: 0.25rem;
  margin-bottom: 1.5rem;
}

.tab-btn {
  flex: 1;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--muted-fg);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.tab-btn.active {
  background: var(--card);
  color: var(--fg);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 0.75rem;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem 0.75rem;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.card-content {
  padding: 0 1.25rem 1.25rem;
}

.card-actions {
  display: flex;
  gap: 0.5rem;
}

/* Textarea */
textarea {
  width: 100%;
  min-height: 120px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--card-border);
  border-radius: 0.5rem;
  background: var(--bg);
  color: var(--fg);
  font-size: 1.1rem;
  line-height: 1.75;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.15s;
}

textarea:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.2);
}

textarea::placeholder { color: var(--muted-fg); }

/* Output box */
.output-box {
  min-height: 120px;
  padding: 1rem;
  border: 1px solid var(--card-border);
  border-radius: 0.5rem;
  background: var(--muted);
  font-size: 1.1rem;
  line-height: 1.75;
  color: var(--fg);
  word-wrap: break-word;
}

.output-box.urdu {
  direction: rtl;
  font-family: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', serif;
  font-size: 1.25rem;
  line-height: 2.25;
}

.output-placeholder {
  color: var(--muted-fg);
  font-style: italic;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--card-border);
  border-radius: 0.375rem;
  background: var(--card);
  color: var(--fg);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.btn:hover { background: var(--accent); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost {
  border-color: transparent;
  background: transparent;
}

.btn-ghost:hover { background: var(--accent); }

/* Grid */
.output-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .output-grid { grid-template-columns: 1fr 1fr; }
}

/* Tab content */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--primary);
  color: var(--primary-fg);
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}
