/* ===== Tahlil Page — page-specific styles ===== */
/* #325/T5: extracted from tahlil.html <style>, dedup'd against noor.css */

:root {
  --bg-deep:     #030712;
  --glass-bg:    rgba(255,255,255,0.04);
  --glass-heavy: rgba(255,255,255,0.08);
  --glass-border:rgba(255,255,255,0.08);
  --accent:      #10B981;
  --gold:        #F59E0B;
  --text:        #F9FAFB;
  --muted:       rgba(249,250,251,0.5);
  --radius:      16px;
}

/* Nav */
.nav {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
}
.nav-logo img, .nav-logo svg { width: 32px; height: 32px; }
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { font-size: 0.875rem; color: var(--muted); transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }

/* Layout */
.page-wrap {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 1.25rem 3rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  text-align: center;
}

/* Control Panel */
.tahlil-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 1.25rem;
  margin-bottom: 1rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
}

.tahlil-controls select,
.tahlil-controls input {
  background: var(--glass-heavy);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.tahlil-controls select:focus,
.tahlil-controls input:focus {
  border-color: var(--accent);
}

.tahlil-controls select {
  min-width: 200px;
  max-width: 100%;
}

.page-range {
  display: flex;
  align-items: center;
  gap: 8px;
}
.page-range input {
  width: 70px;
}
.page-range small {
  color: var(--muted);
  font-size: 11px;
}

.btn-accent {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
  font-family: inherit;
}
.btn-accent:hover { opacity: 0.85; }
.btn-accent:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-danger {
  background: #EF4444;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
  font-family: inherit;
}
.btn-danger:hover { opacity: 0.85; }

/* Progress */
#progressWrap {
  margin-bottom: 1.25rem;
}
#progressBar {
  height: 3px;
  background: var(--accent);
  width: 0%;
  transition: width 0.3s;
  border-radius: 2px;
}
#progressLabel {
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
  display: block;
}

/* Result Cards */
.tahlil-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.tahlil-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.scholar-badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--scholar-color, var(--gold)) 12%, transparent);
  color: var(--scholar-color, var(--gold));
  border: 1px solid color-mix(in srgb, var(--scholar-color, var(--gold)) 25%, transparent);
}

/* T28k-4: JS inline style → CSS classes */
.thl-error-text { color: #EF4444; font-size: 13px; padding: 8px 0; }

.para-num {
  font-size: 12px;
  color: var(--muted);
}

.original-text {
  font-family: 'Scheherazade New', serif;
  direction: rtl;
  text-align: right;
  color: var(--muted);
  border-right: 3px solid var(--gold);
  padding-right: 12px;
  margin: 0.75rem 0;
  font-size: 1.1rem;
  line-height: 1.7;
  word-break: break-word;
}

.analysis-text {
  line-height: 1.8;
  color: var(--text);
  font-size: 0.925rem;
}

.analysis-text strong {
  color: var(--accent);
}

.scholar-hint {
  margin-top: 0.75rem;
  padding: 8px 12px;
  background: rgba(16,185,129,0.08);
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s;
}
.scholar-hint:hover {
  background: rgba(16,185,129,0.14);
}

.sources-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 0.5rem;
}

.source-chip {
  font-size: 11px;
  background: var(--glass-heavy);
  padding: 2px 8px;
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.2s;
}
.source-chip:hover {
  background: rgba(255,255,255,0.14);
  color: var(--text);
}

/* Shimmer loading (page-specific override) */
@keyframes shimmer {
  0%   { opacity: 0.4; }
  50%  { opacity: 0.8; }
  100% { opacity: 0.4; }
}
.shimmer {
  animation: shimmer 1.5s infinite;
  background: var(--glass-heavy);
  border-radius: 6px;
  height: 14px;
  margin: 6px 0;
}

/* Fade-in animation for new cards */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Indeterminate progress sweep */
@keyframes tahlil-sweep {
  0%   { left: -30%; width: 30%; }
  100% { left: 100%; width: 30%; }
}
#progressBar.indeterminate {
  position: relative;
  animation: tahlil-sweep 1.4s ease-in-out infinite;
  width: auto;
}
.tahlil-card {
  animation: cardIn 0.35s ease-out;
}

/* Warning bar */
.warning-bar {
  color: #F59E0B;
  font-size: 12px;
  margin-top: 6px;
}

/* Empty state (page-specific extras) */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.empty-state h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

/* Error toast */
.error-toast {
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: #EF4444;
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

/* === Phase 2: Inline-Style-Klassen (T22) === */
.thl-hidden { display: none; }

/* Responsive */
@media (max-width: 640px) {
  .tahlil-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .tahlil-controls select {
    min-width: unset;
  }
  .page-range {
    justify-content: center;
  }
  .page-title {
    font-size: 1.25rem;
  }
  .original-text {
    font-size: 1rem;
  }
}
