/* G-SAILM Lovable Homepage
   Premium AI Education Platform · Mobile-First RTL Design
   Colors: Green (152° 65% 26%) · Red accent (0° 72% 50%) · Light background
*/

:root {
  /* Colors — HSL format */
  --bg-primary: #f5fdf9;
  --bg-card: #ffffff;
  --text-primary: #1a3d2d;
  --text-secondary: #5a7e74;
  --text-muted: #8a9d98;
  --primary-color: #2b8a5e;
  --primary-light: #4db878;
  --primary-glow: #6bc999;
  --primary-soft: #e8f5f0;
  --highlight: #d94a3f;
  --highlight-light: #ff6b5f;
  --border-light: #e0ede8;

  /* Shadows */
  --shadow-soft: 0 4px 20px rgba(43, 138, 94, 0.08);
  --shadow-glow: 0 20px 60px rgba(107, 201, 153, 0.3);
  --shadow-glow-red: 0 20px 60px rgba(217, 74, 63, 0.25);
  --shadow-card: 0 8px 32px rgba(26, 61, 45, 0.08);
  --shadow-elevated: 0 24px 64px rgba(26, 61, 45, 0.12);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #2b8a5e, #4db878);
  --gradient-hero: linear-gradient(135deg, #1a5a47 0%, #2b8a5e 50%, #d94a3f 120%);
  --gradient-green-bright: linear-gradient(135deg, #2b8a5e, #6bc999);
  --gradient-text-brand: linear-gradient(135deg, #2b8a5e, #d94a3f);

  /* Motion */
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  /* Override legacy LMS base (62.5%) so homepage rem scale renders at normal size */
  font-size: 100% !important;
  scroll-behavior: smooth;
  direction: rtl;
  text-align: right;
}

body {
  font-size: 16px;
  font-family: 'Tajawal', 'Cairo', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Cairo', 'Tajawal', system-ui, sans-serif;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 7vw, 4rem); }
h2 { font-size: clamp(1.75rem, 5vw, 3.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 2rem); }
h4 { font-size: 1.25rem; }

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

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

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

/* Containers & Sections */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
  width: 100%;
}

section {
  position: relative;
  z-index: 1;
}

/* Glass Morphism */
.glass {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-card);
}

.glass-soft {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

/* Gradients for text */
.text-gradient-brand {
  background: var(--gradient-text-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Cards & Interactive */
.card-hover {
  transition: all 0.4s var(--ease-smooth);
  cursor: pointer;
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.glow-on-hover {
  transition: all 0.4s var(--ease-smooth);
}

.glow-on-hover:hover {
  box-shadow: var(--shadow-glow);
}

/* Reveal Animation */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease-smooth), transform 0.8s var(--ease-smooth);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.875rem 2rem;
  border-radius: 9999px;
  border: none;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s var(--ease-smooth);
  text-decoration: none;
  white-space: nowrap;
  min-height: 3rem;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 70px rgba(43, 138, 94, 0.35);
}

.btn-outline {
  border: 2px solid rgba(26, 61, 45, 0.15);
  background: rgba(255, 255, 255, 0.85);
  color: var(--text-primary);
  backdrop-filter: blur(8px);
}

.btn-outline:hover {
  border-color: var(--highlight);
  color: var(--highlight);
  box-shadow: var(--shadow-glow-red);
}

.btn-white {
  background: white;
  color: var(--text-primary);
  box-shadow: var(--shadow-glow);
  font-weight: 800;
}

.btn-white:hover {
  background: rgba(255, 255, 255, 0.9);
}

.btn-transparent {
  background: transparent;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.25);
}

.btn-transparent:hover {
  border-color: white;
  background: rgba(255, 255, 255, 0.1);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: white;
  border: 1px solid rgba(43, 138, 94, 0.2);
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: var(--shadow-soft);
}

.badge-pulse {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
}

.pulse-dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  background: var(--primary-color);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Icon Badge */
.icon-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1rem;
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-glow);
}

.icon-badge-soft {
  background: var(--primary-soft);
  color: var(--primary-color);
}

/* Animations */
@keyframes float {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-14px) rotate(0.5deg);
  }
}

@keyframes float-slow {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-28px);
  }
}

@keyframes pulse-soft {
  0%, 100% {
    opacity: 0.4;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.06);
  }
}

@keyframes typing-dot {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

.animate-float {
  animation: float 7s ease-in-out infinite;
}

.animate-float-slow {
  animation: float-slow 11s ease-in-out infinite;
}

.animate-pulse-soft {
  animation: pulse-soft 4s ease-in-out infinite;
}

.animate-typing-dot {
  display: inline-block;
  width: 0.375rem;
  height: 0.375rem;
  background: var(--primary-color);
  border-radius: 50%;
  animation: typing-dot 1.4s ease-in-out infinite;
}

/* Grid & Flex Utils */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { flex-direction: column; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* Spacing */
.my-8 { margin-top: 2rem; margin-bottom: 2rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-10 { margin-top: 2.5rem; }
.my-16 { margin-top: 4rem; margin-bottom: 4rem; }

.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

/* Responsive */
@media (max-width: 640px) {
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  
  .container { padding: 1rem; }
  .btn { width: 100%; }
  
  .grid-4 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}

@media (max-width: 767px) {
  html,
  body {
    overflow-x: hidden;
  }

  section {
    overflow-x: clip;
  }

  .container {
    padding-inline: 0.9rem;
  }

  .btn {
    min-height: 2.8rem;
    padding-inline: 1rem;
  }
}

@media (min-width: 768px) {
  .container { padding: 2rem; }
}

@media (min-width: 1024px) {
  .container { padding: 3rem 2rem; }
}

/* Loading & States */
.loading {
  animation: pulse-soft 1s ease-in-out infinite;
}

.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}
