/* 
 * ScanAIPro - Tajik Cyrillic ⇄ Persian Converter
 * Enterprise Design System, Glassmorphic UI & Comprehensive Typography
 */

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

:root {
  --primary-blue: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --bg-gradient-start: #0f172a;
  --bg-gradient-end: #1e293b;
  --card-bg: rgba(255, 255, 255, 0.95);
  --card-border: rgba(226, 232, 240, 0.8);
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --purple-badge: #7c3aed;
  --green-badge: #059669;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --radius-lg: 16px;
  --radius-xl: 24px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', 'Noto Sans', system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #60a5fa 100%);
  color: var(--text-dark);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px;
}

/* Header & Brand Navigation */
.header-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  margin-bottom: 12px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 28px;
  font-weight: 800;
  color: #ffffff;
  text-decoration: none;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: #ffffff;
  color: var(--primary-blue);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  box-shadow: var(--shadow-md);
}

.lang-switcher-pills {
  display: flex;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  padding: 4px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.lang-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
  transition: all 0.2s ease;
}

.lang-btn.active, .lang-btn:hover {
  background: #ffffff;
  color: var(--primary-blue);
}

/* Visible Breadcrumbs UI */
.breadcrumb-nav {
  margin-bottom: 24px;
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
}

.breadcrumb-list a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
}

.breadcrumb-list a:hover {
  text-decoration: underline;
}

.breadcrumb-separator {
  color: rgba(255, 255, 255, 0.6);
}

/* Main Grid Layout */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 40px;
  align-items: start;
  margin-bottom: 40px;
}

@media (max-width: 1024px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
}

.hero-content {
  color: #ffffff;
  padding-top: 10px;
}

.badge-ai {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
  color: #ffffff;
  padding: 8px 18px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.hero-title {
  font-size: 44px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
  letter-spacing: -1px;
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 30px;
  }
}

.hero-subtitle {
  font-size: 18px;
  opacity: 0.9;
  margin-bottom: 32px;
  font-weight: 500;
}

/* Feature Grid Cards */
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.feature-card {
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-dark);
  padding: 20px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-2px);
}

.feat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.feat-icon-blue { background: #dbeafe; color: #2563eb; }
.feat-icon-purple { background: #f3e8ff; color: #7c3aed; }
.feat-icon-green { background: #d1fae5; color: #059669; }

.feat-info h4 {
  font-size: 15px;
  font-weight: 700;
}

.feat-info p {
  font-size: 12px;
  color: var(--text-muted);
}

/* Converter Card Container */
.converter-card {
  background: #ffffff;
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--card-border);
  position: relative;
}

.converter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
}

.converter-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
}

.direction-badge {
  background: #eff6ff;
  color: var(--primary-blue);
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Converter Dual Text Panes */
.panes-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
  position: relative;
}

@media (max-width: 768px) {
  .panes-container {
    grid-template-columns: 1fr;
  }
}

.pane-box {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease;
}

.pane-box:focus-within {
  border-color: var(--primary-blue);
  background: #ffffff;
}

.pane-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.converter-textarea {
  width: 100%;
  height: 180px;
  border: none;
  background: transparent;
  resize: vertical;
  font-size: 16px;
  font-family: inherit;
  color: var(--text-dark);
  outline: none;
}

.converter-textarea.persian-font {
  font-family: 'Vazirmatn', sans-serif;
  font-size: 18px;
  direction: rtl;
}

.pane-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #e2e8f0;
  font-size: 12px;
  color: var(--text-muted);
}

.pane-tools {
  display: flex;
  gap: 8px;
}

.icon-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: #f1f5f9;
  color: var(--primary-blue);
}

/* Action Control Buttons Bar */
.action-buttons-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.btn-primary {
  background: var(--primary-blue);
  color: #ffffff;
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: all 0.2s ease;
  flex: 1 1 180px;
  justify-content: center;
  text-decoration: none;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #f1f5f9;
  color: var(--text-dark);
  border: 1px solid #cbd5e1;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  transition: all 0.2s ease;
  flex: 1 1 140px;
  justify-content: center;
}

.btn-secondary:hover {
  background: #e2e8f0;
}

/* Trust Bar */
.trust-bar {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 16px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  padding: 16px 24px;
  border-radius: 16px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 40px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* EEAT Author Card Top */
.author-eeat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 20px;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}

.author-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  color: #ffffff;
  font-size: 24px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.author-details h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dark);
}

.author-role {
  font-size: 13px;
  color: var(--primary-blue);
  font-weight: 600;
}

.author-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Article & FAQ Section (On-Page SEO) */
.content-section {
  background: #ffffff;
  border-radius: var(--radius-xl);
  padding: 48px;
  margin-bottom: 40px;
  box-shadow: var(--shadow-xl);
}

@media (max-width: 768px) {
  .content-section {
    padding: 24px;
  }
}

.article-header h2 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 20px;
}

/* Table of Contents (TOC) */
.table-of-contents {
  background: #f1f5f9;
  border-left: 4px solid var(--primary-blue);
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 32px;
}

.table-of-contents h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-dark);
}

.table-of-contents ol {
  padding-left: 20px;
}

.table-of-contents li {
  margin-bottom: 6px;
  font-size: 14px;
}

.table-of-contents a {
  color: var(--primary-blue);
  text-decoration: none;
  font-weight: 500;
}

.table-of-contents a:hover {
  text-decoration: underline;
}

/* Article Hero Image Banner */
.article-featured-banner {
  margin: 24px 0 36px 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid #e2e8f0;
}

.article-hero-img {
  width: 100%;
  height: auto;
  display: block;
}

.article-featured-banner figcaption {
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px 12px;
  background: #f8fafc;
  text-align: center;
}

.article-body h3 {
  font-size: 22px;
  font-weight: 700;
  margin: 36px 0 16px 0;
  color: var(--text-dark);
}

.article-body p {
  font-size: 16px;
  color: #334155;
  margin-bottom: 16px;
  line-height: 1.7;
}

.article-body ul, .article-body ol {
  margin: 0 0 20px 24px;
  color: #334155;
  font-size: 15px;
}

.article-body li {
  margin-bottom: 8px;
}

/* Responsive Table */
.table-responsive {
  overflow-x: auto;
  margin: 20px 0;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.rules-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.rules-table th, .rules-table td {
  border: 1px solid #e2e8f0;
  padding: 12px;
  text-align: left;
}

.rules-table th {
  background: #f1f5f9;
  font-weight: 700;
  color: var(--text-dark);
}

/* Example Box */
.example-box {
  background: #eff6ff;
  border-left: 4px solid var(--primary-blue);
  padding: 20px;
  border-radius: 12px;
  margin: 20px 0;
  font-size: 15px;
}

.example-box code {
  background: #dbeafe;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}

/* Bottom CTA Banner */
.bottom-cta-banner {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #ffffff;
  padding: 32px;
  border-radius: var(--radius-xl);
  text-align: center;
  margin: 40px 0;
  box-shadow: var(--shadow-xl);
}

.bottom-cta-banner h3 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 8px;
}

.bottom-cta-banner p {
  font-size: 16px;
  opacity: 0.9;
  margin-bottom: 20px;
}

.btn-cta-top {
  display: inline-flex;
  margin: 0 auto;
  max-width: 240px;
}

/* FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

.faq-item {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  background: #f8fafc;
}

.faq-item h4 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-dark);
}

.faq-item p {
  font-size: 15px;
  color: #475569;
}

/* Related Tools Section */
.related-tools-section {
  margin-top: 50px;
  padding-top: 32px;
  border-top: 2px solid #e2e8f0;
}

.related-tools-section h3 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 20px;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.tool-link-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 16px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-dark);
  transition: all 0.2s ease;
}

.tool-link-card:hover {
  background: #ffffff;
  border-color: var(--primary-blue);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.tool-icon {
  font-size: 24px;
}

.tool-link-card h4 {
  font-size: 15px;
  font-weight: 700;
}

.tool-link-card p {
  font-size: 12px;
  color: var(--text-muted);
}

/* Sources Citation Box */
.sources-citation-box {
  margin-top: 40px;
  padding: 20px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  font-size: 14px;
}

.sources-citation-box ul {
  margin: 8px 0 0 20px;
}

/* Modal Dialog */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 90%;
  max-width: 600px;
  box-shadow: var(--shadow-xl);
  position: relative;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #0f172a;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-success { background: #059669; }
.toast-warning { background: #d97706; }
.toast-error { background: #dc2626; }

/* Footer */
footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 40px 20px;
  text-align: center;
  margin-top: 40px;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
}

footer a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 14px;
}

footer a:hover {
  color: #ffffff;
  text-decoration: underline;
}
