/* ============================================================
   GO UP — Global Design System
   Modern Light theme with gold accents
   ============================================================ */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;900&family=Inter:wght@300;400;500;600;700&display=swap');

/* ---- Design Tokens ---- */
:root {
  /* Colors */
  --color-bg: #FFFFFF;
  --color-surface: #F7F4EF;
  --color-surface-2: #F0EDE7;
  --color-border: rgba(0, 0, 0, 0.08);
  --color-gold: #B8962E;
  --color-dark: #1C1C2E;
  --color-light-bg: #F8F6F1;
  --color-light-card: #FFFFFF;
  --color-gold-light: #D4AF37;
  --color-gold-dim: rgba(184, 150, 46, 0.1);
  --color-text: #c9a84c;
  --color-text-muted: #4A5568;
  --color-danger: #C0392B;
  --color-success: #0D6E4F;
  --color-info: #1B4F72;

  /* Gradients */
  --grad-gold: linear-gradient(135deg, #B8962E 0%, #D4AF37 50%, #8A6D22 100%);
  --grad-hero: linear-gradient(165deg, #F7F4EF 0%, #FFFFFF 100%);
  --grad-card: linear-gradient(145deg, #FFFFFF, #FBFBFB);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-2xl: 64px;
  --space-3xl: 96px;

  /* Typography */
  --font-body: 'Inter', 'Cairo', sans-serif;
  --font-arabic: 'Cairo', sans-serif;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 32px;
  --radius-full: 9999px;

  /* Shadow */
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-gold: 0 0 24px rgba(184, 150, 46, 0.15);

  /* Transitions */
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: #F8F6F1;
  color: var(--color-text);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---- Typography ---- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-arabic);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}

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

.btn a:hover,
.btn:hover {
  color: #FFF;
}

.nav-links a:hover {
  color: var(--color-gold) !important;
}

p {
  color: var(--color-text-secondary);
}

.rtl {
  direction: rtl;
  text-align: right;
}

/* ---- Layout ---- */
.container {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: var(--space-2xl) 0;
}

/* ---- Grid ---- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

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

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-arabic);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
}

.btn-primary {
  background: var(--color-dark);
  color: #FFFFFF;
}

.btn-primary:hover {
  background: #2D2D44;
}

.btn-accent {
  background: var(--color-gold);
  color: #FFFFFF;
}

.btn-accent:hover {
  background: var(--color-gold-light);
}

.btn-outline {
  background: transparent;
  color: var(--color-dark);
  border: 1.5px solid var(--color-dark);
}

/* ---- Cards ---- */
.card {
  background: #FFFFFF;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

/* ---- Badge ---- */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-gold {
  background: var(--color-gold-dim);
  color: var(--color-gold);
}

.badge-green {
  background: rgba(13, 110, 79, 0.1);
  color: var(--color-success);
}

.badge-red {
  background: rgba(192, 57, 43, 0.1);
  color: var(--color-danger);
}

.badge-blue {
  background: rgba(27, 79, 114, 0.1);
  color: var(--color-info);
}

/* ---- Nav ---- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.nav-links a {
  color: #FFFFFF !important;
  font-weight: 600;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-gold) !important;
}

/* Section Page Components */
.section-page {
  background-color: #F8F6F1;
}

.section-header-banner {
  width: 100%;
  min-height: 160px;
  background: linear-gradient(135deg, #0D2545 0%, #1A3F70 100%);
  border-bottom: 4px solid var(--color-gold);
  display: flex;
  align-items: center;
  color: #FFFFFF;
  padding: var(--space-xl) 0;
  position: relative;
  overflow: hidden;
}

.section-header-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('/static/img/grid.svg');
  opacity: 0.05;
  pointer-events: none;
}

.section-header-content {
  display: flex;
  align-items: center;
  gap: 24px;
  position: relative;
  z-index: 2;
}

.section-icon {
  font-size: 3.5rem;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
}

.section-title-group h1 {
  color: #FFFFFF;
  margin: 0 0 4px 0;
  font-size: 2.25rem;
  font-family: var(--font-arabic);
}

.section-title-group p {
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
  font-size: 1.1rem;
  font-weight: 500;
}

.data-tile-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 1.5rem 0;
  scrollbar-width: thin;
}

.data-tile {
  background: #FFFFFF;
  border: 1px solid #E2D9CC;
  border-radius: 12px;
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  min-width: 160px;
  box-shadow: var(--shadow-card);
}

.data-tile .label {
  font-size: 11px;
  color: #718096;
  font-weight: 600;
}

.data-tile .value {
  font-size: 16px;
  font-weight: 800;
  color: #1A1A2E;
}

/* ---- Forms ---- */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.9rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: var(--transition);
  background: #FFFFFF;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(184, 150, 46, 0.1);
}

.form-range {
  width: 100%;
  margin-top: 0.5rem;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-family: var(--font-arabic);
  cursor: pointer;
  transition: var(--transition);
  border: none;
  gap: 8px;
  font-size: 0.95rem;
}

.btn-primary {
  background: var(--color-dark);
  color: #FFF;
}

.btn-primary:hover {
  background: #2a2a3e;
  transform: translateY(-2px);
}

.btn-accent {
  background: var(--color-gold);
  color: #FFF;
}

.btn-accent:hover {
  background: var(--color-gold-light);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--color-gold);
  color: var(--color-gold);
}

.btn-outline:hover {
  background: var(--color-gold);
  color: #FFF;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ---- Fahim Bubble ---- */
.fahim-bubble {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: #1C1C2E;
  color: white;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border-right: 4px solid var(--color-gold);
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.fahim-bubble::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(184, 150, 46, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

.fahim-bubble-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.fahim-bubble-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
}


/* ---- Animations & Motion ----
   Hidden initial states are scoped to html.js (set inline in base.html head)
   so content stays visible when JS is disabled, blocked, or errors out. */
.js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.8s cubic-bezier(0.2, 1, 0.3, 1);
  will-change: transform, opacity;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.js .reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: all 0.8s cubic-bezier(0.2, 1, 0.3, 1);
}

.js .reveal-right {
  opacity: 0;
  transform: translateX(30px);
  transition: all 0.8s cubic-bezier(0.2, 1, 0.3, 1);
}

.reveal-left.active,
.reveal-right.active {
  opacity: 1;
  transform: translateX(0);
}

.js .scale-in {
  opacity: 0;
  transform: scale(0.95);
  transition: all 0.6s cubic-bezier(0.2, 1, 0.3, 1);
}

.scale-in.active {
  opacity: 1;
  transform: scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal,
  .js .reveal-left,
  .js .reveal-right,
  .js .scale-in {
    transition: none;
    transform: none;
    opacity: 1;
  }
}

/* Staggered Delay Helpers */
.delay-1 {
  transition-delay: 0.1s;
}

.delay-2 {
  transition-delay: 0.2s;
}

.delay-3 {
  transition-delay: 0.3s;
}

.delay-4 {
  transition-delay: 0.4s;
}

.delay-5 {
  transition-delay: 0.5s;
}

/* Subtle Hover Motions */
.hover-lift {
  transition: transform 0.3s cubic-bezier(0.2, 1, 0.3, 1);
}

.hover-lift:hover {
  transform: translateY(-5px);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}