/* Global styles (RTL template) */
/* Use this file for global utilities and component base styles.
   For production: it's recommended to compile only used Tailwind utilities. */

:root {
  --primary-color: #1f332a;
  --secondary-color: #c8f169;
  --base-font: 'Tajawal', sans-serif;
}

/* Accessibility: respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

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

body {
  overflow-x: hidden;
  position: relative;
  font-family: var(--base-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #0f172a;
  background: #ffffff;
  padding-top: 80px; /* Fixed header spacing */
}

@media (max-width: 640px) {
  body {
    padding-top: 70px;
  }
}

/* Scrollbar (webkit) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: white;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 999px;
}

/* Firefox scrollbar */
* {
  box-sizing: border-box;
  -webkit-box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) white;
}

/* ============================ */
/* ===== PRELOADER ============ */
/* ============================ */

/* Preloader fade out transition */
#preloader {
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#preloader.hide {
  opacity: 0;
  visibility: hidden;
}

/* Logo pulse animation */
@keyframes logoPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.9;
  }
}

.logo-pulse {
  animation: logoPulse 2s ease-in-out infinite;
  position: relative;
  z-index: 10;
}

/* Logo glow effect */
@keyframes logoGlow {
  0%, 100% {
    opacity: 0.3;
    transform: scale(0.95);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.1);
  }
}

.logo-glow {
  animation: logoGlow 2s ease-in-out infinite;
}

/* Loading spinner */
.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(200, 241, 105, 0.2);
  border-top: 4px solid var(--secondary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ============================ */
/* ===== SCROLL TOP BTN ======= */
/* ============================ */
#scrollTopBtn {
  transform: translateY(20px);
}

#scrollTopBtn.show {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateY(0);
}

#scrollTopBtn.show:hover {
  animation: pulseGlow 1.5s infinite;
}

/* ============================ */
/* ===== HEADER CTA BTN ======= */
/* ============================ */

/* Pulse animation for CTA button */
@keyframes ctaPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(200, 241, 105, 0.5);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(200, 241, 105, 0);
    transform: scale(1.05);
  }
}

/* Gentle float animation */
@keyframes gentleFloat {
  0%, 100% {
    transform: translateY(0px) scale(1);
  }
  50% {
    transform: translateY(-4px) scale(1.03);
  }
}

.cta-animated {
  animation: ctaPulse 1s ease-in-out infinite, gentleFloat 1.5s ease-in-out infinite;
}