/**
 * PyrMaker Platform - Standalone Policy & Documentation Pages Theme
 * Modern, clean, dark-theme styling with full text selection and responsive layout.
 */

:root, html, body {
  color-scheme: only dark !important;
}
html[data-darkreader-scheme],
html[data-darkreader-mode] {
  filter: none !important;
}

:root {
  color-scheme: dark;
  --bg-dark: #070d18;
  --bg-card: #0d1627;
  --bg-elevated: rgba(15, 23, 42, 0.75);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-gold: rgba(245, 158, 11, 0.35);
  --accent: #f59e0b;
  --gold: #f59e0b;
  --gold-light: #fef08a;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-ar: 'Cairo', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-en: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-ar);
  background: var(--bg-dark);
  background-image: radial-gradient(circle at 50% 0%, #1e1b4b 0%, #070d18 70%);
  color: var(--text-main);
  user-select: text !important;
  -webkit-user-select: text !important;
  line-height: 1.8;
}

/* Header */
.doc-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 18, 32, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-gold);
  padding: 0.6rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text-main);
}

.brand-icon {
  font-size: 1.35rem;
  color: var(--accent);
}

.brand-icon-img {
  width: 28px;
  height: 28px;
  display: block;
  flex-shrink: 0;
}

.brand-title {
  font-family: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  display: inline-flex;
  align-items: baseline;
  direction: ltr;
  unicode-bidi: isolate;
}

.brand-title-pyr {
  color: #E69A17;
}

.brand-title-maker {
  color: #F8FAFC;
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 800;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 0.1rem 0.4rem;
  border-radius: 99px;
  margin-inline-start: 0.4rem;
}

/* Navigation Bar */
.doc-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
  white-space: nowrap;
  padding: 0.2rem 0;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 99px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--border-gold);
  color: var(--gold-light);
}

.nav-home-btn {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--gold);
  color: var(--gold-light);
}

/* Main Container */
.doc-container {
  max-width: 920px;
  margin: 2.5rem auto 4rem;
  padding: 0 1.25rem;
}

.doc-paper {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2.25rem;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

.doc-hero {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
}

.doc-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 0.2rem 0.65rem;
  border-radius: 99px;
  margin-bottom: 0.75rem;
}

.doc-title {
  font-size: 1.85rem;
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 0.5rem;
  line-height: 1.35;
}

.doc-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Callout Box */
.doc-alert {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  color: #fef08a;
  font-size: 0.92rem;
}

/* Section Content */
.doc-section {
  margin: 2rem 0;
}

.section-h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--gold-light);
  border-bottom: 1px solid rgba(245, 158, 11, 0.25);
  padding-bottom: 0.45rem;
  margin-bottom: 0.85rem;
}

.doc-section p {
  color: #e2e8f0;
  font-size: 0.94rem;
  margin-bottom: 0.85rem;
  text-align: justify;
}

.doc-section ul {
  padding-inline-start: 1.5rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  color: #cbd5e1;
  font-size: 0.92rem;
}

.doc-section li strong {
  color: #fff;
}

/* Contact / Table */
.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.88rem;
}

.doc-table th, .doc-table td {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-subtle);
  text-align: start;
}

.doc-table th {
  background: rgba(15, 23, 42, 0.8);
  color: var(--gold-light);
  font-weight: 800;
}

.doc-table td {
  color: #cbd5e1;
}

.doc-table a {
  color: var(--gold-light);
  text-decoration: underline;
}

/* Footer */
.doc-footer {
  text-align: center;
  padding: 2rem 1rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.doc-footer a {
  color: var(--gold);
  text-decoration: none;
}

@media (max-width: 768px) {
  .doc-header {
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem 1rem;
  }
  .doc-paper {
    padding: 1.5rem 1.25rem;
  }
  .doc-title {
    font-size: 1.4rem;
  }
}

/* Bilingual Language Switching */
html[lang="en"] body {
  font-family: var(--font-en);
}

html[lang="ar"] [data-lang="en"],
html[dir="rtl"] [data-lang="en"] {
  display: none !important;
}

html[lang="en"] [data-lang="ar"],
html[dir="ltr"] [data-lang="ar"] {
  display: none !important;
}
