/* ==========================================================================
   Shared site stylesheet — Tripoli Security Directorate & Aamen app pages
   Extracted from index.html; referenced by all pages of the site.
   ========================================================================== */

:root {
  --navy: #0b132b;
  --blue: #1c3d7a;
  --blue-light: #2c5aa0;
  --gold: #c9a227;
  --gold-light: #e2c158;
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-600: #475569;
  --gray-800: #1e293b;
  --shadow: 0 10px 30px -10px rgba(0,0,0,0.15);
  --radius: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Cairo', 'Inter', sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.7;
  overflow-x: hidden;
}

/* Language Toggle Logic - FIXED */
.lang-ar .en-content { display: none !important; }
.lang-en .ar-content { display: none !important; }

/* Ensure Arabic shows by default */
.ar-content { display: block; }
.en-content { display: none; }

.lang-en .ar-content { display: none !important; }
.lang-en .en-content { display: block !important; }

/* Typography - FIXED CENTERING */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.3; }
.section-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  text-align: center;
  margin-bottom: 1rem;
  color: var(--navy);
  position: relative;
  display: block;
  width: 100%;
}
.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--gold);
  margin: 0.5rem auto 0;
  border-radius: 2px;
}
.subtitle {
  text-align: center;
  color: var(--gray-600);
  max-width: 700px;
  margin: 0 auto 3rem;
  display: block;
}

/* Layout Utilities */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.grid { display: grid; gap: 2rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.text-center { text-align: center; }
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 1px solid rgba(0,0,0,0.05);
  position: relative;
  overflow: hidden;
}
.card:hover { transform: translateY(-5px); box-shadow: 0 20px 40px -15px rgba(28,61,122,0.2); }
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 4px; height: 100%;
  background: var(--gold);
  opacity: 0;
  transition: var(--transition);
}
.card:hover::before { opacity: 1; }

/* Navigation */
nav {
  position: fixed;
  top: 0; width: 100%;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  padding: 0.8rem 0;
}
.nav-inner { display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; gap: 0.8rem; font-weight: 800; color: var(--navy); font-size: 1.2rem; }
.logo img { height: 45px; width: auto; }
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { text-decoration: none; color: var(--gray-600); font-weight: 600; transition: var(--transition); }
.nav-links a:hover { color: var(--blue); }
.lang-switch {
  background: var(--blue);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}
.lang-switch:hover { background: var(--blue-light); }
.mobile-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--navy); }

/* Hero */
#hero {
  position: relative;
  height: 90vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  overflow: hidden;
  margin-top: 70px;
}
/* Default gradient; each page sets its own photo via an inline
   background on .hero-bg (URLs resolve relative to the page, not this file). */
.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  filter: brightness(0.9);
  z-index: -1;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(11,19,43,0.8), rgba(28,61,122,0.9));
  z-index: -1;
}
.hero-content { max-width: 800px; padding: 0 1.5rem; animation: fadeUp 1s ease-out; }
.hero-content h1 { font-size: clamp(2.5rem, 6vw, 4rem); margin-bottom: 1rem; text-shadow: 0 4px 20px rgba(0,0,0,0.4); }
.hero-content p { font-size: 1.2rem; margin-bottom: 2rem; opacity: 0.9; }
.btn {
  display: inline-block;
  padding: 0.9rem 2rem;
  background: var(--gold);
  color: var(--navy);
  text-decoration: none;
  border-radius: 50px;
  font-weight: 700;
  transition: var(--transition);
  border: 2px solid var(--gold);
}
.btn:hover { background: transparent; color: var(--gold); }
.btn-outline { background: transparent; color: white; border-color: white; margin-inline-start: 1rem; }
.btn-outline:hover { background: white; color: var(--navy); }

/* Sections */
section { padding: 5rem 0; }
#about { background: var(--white); }
.section-alt { background: var(--gray-100); }
.section-cta { background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%); color: white; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.about-img { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.about-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.about-img::after {
  content: '';
  position: absolute;
  bottom: -20px; right: -20px;
  width: 100px; height: 100px;
  border: 4px solid var(--gold);
  border-radius: var(--radius);
  z-index: -1;
}

/* Directors Timeline */
.timeline { position: relative; max-width: 800px; margin: 0 auto; padding-left: 2rem; border-left: 3px solid var(--blue-light); }
.timeline-item { position: relative; margin-bottom: 1.5rem; padding-left: 1.5rem; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -2.35rem; top: 0.2rem;
  width: 16px; height: 16px;
  background: var(--gold);
  border: 3px solid var(--white);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--blue-light);
}
.timeline-item.current::before { background: var(--blue); box-shadow: 0 0 0 3px var(--gold); }
.timeline-item h4 { color: var(--navy); margin-bottom: 0.2rem; }
.timeline-item span { color: var(--gray-600); font-size: 0.9rem; }

/* Tasks & Achievements */
.task-icon {
  width: 50px; height: 50px;
  background: rgba(28,61,122,0.1);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--blue);
  font-size: 1.4rem;
  margin-bottom: 1rem;
}
.achievement-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; }
.achievement-card { text-align: center; padding: 2rem 1.5rem; }
.achievement-card i { font-size: 2.5rem; color: var(--gold); margin-bottom: 1rem; }
.achievement-card h4 { margin-bottom: 0.5rem; }

/* Store / availability badges (dark CTA sections) */
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.6rem;
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: 50px;
  color: white;
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition);
}
.store-badge i { font-size: 1.4rem; }
.store-badge:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-3px); }

/* Footer */
footer { background: var(--navy); color: white; padding: 4rem 0 2rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; margin-bottom: 3rem; }
.footer-col h3 { color: var(--gold); margin-bottom: 1.2rem; font-size: 1.3rem; }
.footer-col p, .footer-col a { color: rgba(255,255,255,0.7); text-decoration: none; display: block; margin-bottom: 0.8rem; transition: var(--transition); }
.footer-col a:hover { color: var(--gold); padding-inline-start: 5px; }
.social-links { display: flex; gap: 1rem; margin-top: 1rem; }
.social-links a { width: 40px; height: 40px; background: rgba(255,255,255,0.1); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; transition: var(--transition); }
.social-links a:hover { background: var(--gold); color: var(--navy); transform: translateY(-3px); }
.copyright { text-align: center; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 2rem; color: rgba(255,255,255,0.5); font-size: 0.9rem; }

/* Animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
.reveal { opacity: 0; transform: translateY(30px); transition: all 0.8s ease; }
.reveal.active { opacity: 1; transform: translateY(0); }

/* Responsive */
@media (max-width: 768px) {
  .nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0; background: white; flex-direction: column; padding: 1.5rem; box-shadow: var(--shadow); }
  .nav-links.active { display: flex; }
  .mobile-toggle { display: block; }
  .about-grid { grid-template-columns: 1fr; }
  .hero-content h1 { font-size: 2.2rem; }
  .btn-outline { margin-inline-start: 0; margin-top: 1rem; display: block; }
  [dir="rtl"] .about-img::after { right: auto; left: -20px; }
}

/* ==========================================================================
   Sub-pages: legal & utility pages (privacy policy, account deletion, ...)
   ========================================================================== */

.container-narrow { max-width: 760px; }

/* Slim header band used instead of the full hero on sub-pages */
.page-band {
  margin-top: 70px;
  padding: 5rem 0 3.5rem;
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
  color: white;
  text-align: center;
}
.page-band h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); color: white; margin-bottom: 0.5rem; }
.page-band .lead { color: rgba(255,255,255,0.75); max-width: 620px; margin: 0 auto; font-size: 1.05rem; }

.page-body { padding: 3rem 0 5rem; }

/* Vertical rhythm between stacked cards */
.stack > * + * { margin-top: 1.5rem; }

/* Prose inside cards (the site reset strips default list styling) */
.prose h2 { font-size: 1.15rem; color: var(--navy); margin-bottom: 0.6rem; }
.prose p { color: var(--gray-600); margin-bottom: 0.75rem; }
.prose p:last-child { margin-bottom: 0; }
.prose ul { margin: 0.5rem 0 0; padding-inline-start: 1.4rem; }
.prose li { color: var(--gray-600); margin-bottom: 0.45rem; }
.prose li:last-child { margin-bottom: 0; }

/* Small pill badges */
.badge {
  display: inline-block;
  padding: 0.15rem 0.8rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  vertical-align: middle;
}
.badge-danger { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.badge-muted { background: var(--gray-100); color: var(--gray-600); border: 1px solid #e2e8f0; }

/* Inline LTR islands inside RTL text (phone numbers, codes, emails) */
.ltr { direction: ltr; unicode-bidi: embed; display: inline-block; }

/* Forms */
.form-label { display: block; font-weight: 600; margin: 1.1rem 0 0.4rem; color: var(--navy); }
.form-label:first-child { margin-top: 0; }
.form-input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font: inherit;
  direction: ltr;
  text-align: left;
  background: var(--white);
  color: var(--gray-800);
  transition: var(--transition);
}
.form-input:focus { outline: 2px solid var(--blue); border-color: transparent; }
.form-input--otp { letter-spacing: 0.35em; text-align: center; }

/* Button variants for forms / destructive actions (defined after .btn) */
.btn-full { display: block; width: 100%; margin-top: 1.25rem; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: white; }
.btn-primary:hover { background: var(--blue-light); color: white; }
.btn-danger { background: #b91c1c; border-color: #b91c1c; color: white; }
.btn-danger:hover { background: #991b1b; color: white; }
.btn-ghost { background: transparent; border-color: var(--blue); color: var(--blue); }
.btn-ghost:hover { background: rgba(28,61,122,0.08); color: var(--blue); }

/* Alerts & status blocks */
.alert { display: none; margin-top: 1rem; padding: 0.8rem 1rem; border-radius: 10px; font-size: 0.92rem; }
.alert.show { display: block; }
.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.success { display: none; background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; border-radius: 10px; padding: 1.2rem; text-align: center; font-weight: 700; }
.success.show { display: block; }
.muted { color: var(--gray-600); font-size: 0.85rem; }
.success .muted { color: #166534; opacity: 0.8; }

/* Slim footer for utility pages */
.footer-slim { background: var(--navy); color: rgba(255,255,255,0.5); text-align: center; padding: 2rem 0; font-size: 0.9rem; }
.footer-slim a { color: rgba(255,255,255,0.7); text-decoration: none; margin: 0 0.4rem; transition: var(--transition); }
.footer-slim a:hover { color: var(--gold); }
.footer-slim .fineprint { margin-top: 0.8rem; font-size: 0.85rem; }

/* Subtle legal links row (e.g. inside the main footer copyright) */
.legal-links { margin-top: 0.6rem; font-size: 0.85rem; }
.legal-links a { color: rgba(255,255,255,0.5); text-decoration: none; margin: 0 0.35rem; transition: var(--transition); }
.legal-links a:hover { color: var(--gold); }

@media (max-width: 768px) {
  .page-band { padding: 3.5rem 0 2.5rem; }
}
