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

:root {
  --bg-primary: #050505;
  --bg-secondary: #111111;
  --bg-card: #1A1A1A;
  --text-primary: #FFFFFF;
  --text-secondary: #A1A1AA;
  --text-muted: #71717A;
  
  --accent-primary: #0F766E; /* Teal */
  --accent-primary-light: #14B8A6;
  --accent-secondary: #B45309; /* Gold/Amber */
  --accent-secondary-light: #F59E0B;
  
  --border-color: #27272A;
  
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;
  
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
}

/* Presentation Layout */
.presentation-container {
  height: 100vh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scrollbar-width: none; /* Firefox */
}
.presentation-container::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.slide {
  min-height: 100vh;
  width: 100vw;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-xl) var(--space-lg);
  position: relative;
}

.slide-content {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Typography Utility */
.text-gradient {
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.text-accent-1 { color: var(--accent-primary-light); }
.text-accent-2 { color: var(--accent-secondary-light); }
.text-large { font-size: 3.5rem; letter-spacing: -0.02em; margin-bottom: var(--space-md); }
.text-title { font-size: 2.5rem; margin-bottom: var(--space-sm); }
.text-subtitle { font-size: 1.25rem; color: var(--text-secondary); margin-bottom: var(--space-md); }
.text-body { font-size: 1rem; color: var(--text-secondary); margin-bottom: var(--space-sm); }

/* Layout Utility */
.grid { display: grid; gap: var(--space-md); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.flex { display: flex; gap: var(--space-md); }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.text-center { text-align: center; }
.mt-auto { margin-top: auto; }
.mb-lg { margin-bottom: var(--space-lg); }

@media (max-width: 1024px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .slide { padding: var(--space-lg) var(--space-md); }
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .slide { 
    padding: var(--space-md) var(--space-sm); 
    padding-top: calc(var(--space-md) + 60px); 
    height: auto; 
    min-height: auto; 
    scroll-snap-align: none; 
    margin-bottom: var(--space-lg);
  }
  .presentation-container { scroll-snap-type: none; overflow-y: auto; }
  .text-large { font-size: 2.2rem; }
  .text-title { font-size: 1.8rem; }
  .stat-box .number { font-size: 2.2rem; }
  .nav-dots { display: none; }
  .lang-switcher { top: var(--space-sm); right: var(--space-sm); }
  html[dir="rtl"] .lang-switcher { left: var(--space-sm); right: auto; }
  
  /* Make sure table text sizes scale down on mobile */
  th, td { padding: var(--space-xs) var(--space-sm); font-size: 0.85rem; }
}

@media (max-width: 480px) {
  .text-large { font-size: 1.8rem; }
  .text-title { font-size: 1.5rem; }
  .stat-box .number { font-size: 1.8rem; }
}

/* Components */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  transition: transform 0.3s ease, border-color 0.3s ease;
}
.card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-primary);
}
.card.accent-2:hover { border-color: var(--accent-secondary); }

.stat-box {
  text-align: center;
  padding: var(--space-md);
  background: linear-gradient(180deg, rgba(20, 184, 166, 0.05) 0%, transparent 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}
.stat-box .number {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent-primary-light);
  margin-bottom: var(--space-xs);
}
.stat-box .label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
th, td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-color);
}
th {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 600;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background-color: rgba(255, 255, 255, 0.02); }

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  background-color: rgba(20, 184, 166, 0.1);
  color: var(--accent-primary-light);
  margin-bottom: var(--space-xs);
}
.badge.gold {
  background-color: rgba(245, 158, 11, 0.1);
  color: var(--accent-secondary-light);
}

.equation {
  background-color: var(--bg-secondary);
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  font-family: monospace;
  color: var(--accent-primary-light);
  border-left: 3px solid var(--accent-primary);
  margin: var(--space-sm) 0;
}

.timeline {
  position: relative;
  border-left: 2px solid var(--border-color);
  padding-left: var(--space-md);
  margin-left: var(--space-md);
}
.timeline-item {
  position: relative;
  margin-bottom: var(--space-md);
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(var(--space-md) * -1 - 6px);
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--accent-primary-light);
  box-shadow: 0 0 0 4px var(--bg-primary);
}

/* Animations */
.fade-in { 
  opacity: 0; 
  transform: translateY(20px); 
  transition: opacity 0.8s ease, transform 0.8s ease; 
  will-change: opacity, transform;
}
.fade-in.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 768px) {
  .fade-in {
    transform: translateY(10px); /* Smaller movement on mobile */
    transition-duration: 0.5s; /* Faster on mobile */
  }
}
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }

/* Navigation */
.nav-dots {
  position: fixed;
  right: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 100;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--border-color);
  cursor: pointer;
  transition: all 0.3s ease;
}
.dot.active {
  background-color: var(--accent-primary-light);
  transform: scale(1.3);
}

/* Specific Section Styles */
#cover {
  background: radial-gradient(circle at top right, rgba(15, 118, 110, 0.2), transparent 40%),
              radial-gradient(circle at bottom left, rgba(180, 83, 9, 0.15), transparent 40%);
}

/* RTL Support */
html[dir="rtl"] {
  font-family: 'Cairo', var(--font-body);
}
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3, html[dir="rtl"] h4, html[dir="rtl"] h5, html[dir="rtl"] h6 {
  font-family: 'Cairo', var(--font-heading);
}
html[dir="rtl"] .timeline {
  border-left: none;
  border-right: 2px solid var(--border-color);
  padding-left: 0;
  padding-right: var(--space-md);
  margin-left: 0;
  margin-right: var(--space-md);
}
html[dir="rtl"] .timeline-item::before {
  left: auto;
  right: calc(var(--space-md) * -1 - 6px);
}
html[dir="rtl"] table {
  text-align: right;
}
html[dir="rtl"] .nav-dots {
  right: auto;
  left: var(--space-md);
}

/* Language Switcher */
.lang-switcher {
  position: fixed;
  top: var(--space-md);
  right: var(--space-md);
  z-index: 1000;
  display: flex;
  gap: 0.5rem;
  background: var(--bg-card);
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}
html[dir="rtl"] .lang-switcher {
  right: auto;
  left: var(--space-md);
}
.lang-switcher button {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}
.lang-switcher button.active {
  background: var(--accent-primary-light);
  color: var(--bg-primary);
}
