/* ===== Design Tokens ===== */
:root {
  --primary: #2196F3;
  --primary-dark: #1976D2;
  --accent: #FCB040;
  --bg: #FAFAFA;
  --bg-white: #FFFFFF;
  --text-dark: #212121;
  --text-secondary: #616161;
  --text-light: #9E9E9E;
  --border: #E0E0E0;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 800px;
  --nav-height: 64px;
}

/* ===== Reset ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===== Base ===== */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-dark);
  line-height: 1.7;
  font-size: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Language Toggle ===== */
html.en .lang-ar { display: none !important; }
html.ar .lang-en { display: none !important; }

html.ar {
  direction: rtl;
}

html.ar body {
  font-family: 'Cairo', -apple-system, BlinkMacSystemFont, sans-serif;
  text-align: right;
}

/* ===== Typography ===== */
h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary);
  display: inline-block;
}

h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--primary-dark);
}

ul, ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

html.ar ul, html.ar ol {
  padding-left: 0;
  padding-right: 1.5rem;
}

li {
  margin-bottom: 0.4rem;
}

strong {
  color: var(--text-dark);
}

/* ===== Navbar ===== */
.navbar {
  background: var(--bg-white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
}

.nav-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 1rem;
}

.nav-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-brand .brand-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-links a {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--primary);
  background: rgba(33, 150, 243, 0.06);
}

.nav-links a.active {
  color: var(--primary);
  background: rgba(33, 150, 243, 0.1);
  font-weight: 600;
}

.lang-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: 'Cairo', 'Inter', sans-serif;
}

.lang-btn:hover {
  background: #e9a02e;
  transform: translateY(-1px);
}

/* ===== Main Content ===== */
main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  width: 100%;
}

.page-header {
  margin-bottom: 2rem;
}

.last-updated {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

.section {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.section h2 {
  margin-top: 0;
}

.contact-box {
  background: rgba(33, 150, 243, 0.05);
  border: 1px solid rgba(33, 150, 243, 0.15);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-top: 0.5rem;
}

.contact-box p {
  margin-bottom: 0.4rem;
}

/* ===== About Page Specifics ===== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.feature-item {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
}

.feature-item .icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.feature-item h3 {
  margin-top: 0;
  font-size: 0.95rem;
}

.feature-item p {
  font-size: 0.85rem;
  margin-bottom: 0;
}

/* ===== Footer ===== */
footer {
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
}

footer p {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 0.25rem;
}

footer a {
  color: var(--primary);
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.15rem;
  }

  .nav-inner {
    padding: 0 1rem;
  }

  .nav-brand {
    font-size: 1.05rem;
  }

  .nav-links a {
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
  }

  .lang-btn {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
  }

  main {
    padding: 1.5rem 1rem 2rem;
  }

  .section {
    padding: 1.25rem 1rem;
  }
}

@media (max-width: 400px) {
  .nav-links a span {
    font-size: 0.75rem;
  }

  .nav-brand .brand-text {
    display: none;
  }
}
