/* ============================================
   IVONS DESIGN SYSTEM — Global Design Tokens
   ============================================

   This file is the single source of truth for the Ivons design system.
   It must be loaded on EVERY page of the platform.

   Usage in WordPress:
   - Load via child theme functions.php
   - Can also be imported in Elementor custom CSS

   Portability:
   - All tokens map to design-tokens.json for mobile app development
   - Changing a token here changes the entire platform instantly

   ============================================ */

/* ============================================
   1. DESIGN TOKENS (CSS Custom Properties)
   ============================================
   These tokens are the foundation. Every style in the platform
   references these variables — never use raw values directly.
   ============================================ */

:root {
  /* --- Primary — Teal --- */
  --iv-primary-900: #0F766E;
  --iv-primary-700: #14B8A6;
  --iv-primary-500: #2DD4BF;
  --iv-primary-300: #5EEAD4;
  --iv-primary-200: #99F6E4;
  --iv-primary-100: #F0FDFA;
  --iv-primary-50: #CCFBF1;

  /* --- Accent — Violet --- */
  --iv-accent-700: #7C3AED;
  --iv-accent-600: #8B5CF6;
  --iv-accent-500: #A78BFA;
  --iv-accent-300: #C4B5FD;
  --iv-accent-100: #F5F3FF;
  --iv-accent-50: #FAF5FF;
  --iv-accent-200: #DDD6FE;

  /* --- Gold (Ratings & Badges) --- */
  --iv-gold: #D4A853;
  --iv-gold-light: #F59E0B;
  --iv-gold-bg: #FEF3C7;

  /* --- Neutrals --- */
  --iv-text-primary: #1E293B;
  --iv-text-secondary: #475569;
  --iv-text-light: #9CA3AF;
  --iv-border: #E5E7EB;
  --iv-border-light: #F1F5F9;
  --iv-bg-page: #F8FAFC;
  --iv-bg-white: #FFFFFF;
  --iv-bg-warm: #FAFAF7;

  /* --- Gradients --- */
  --iv-gradient-primary: linear-gradient(135deg, #0F766E, #14B8A6);
  --iv-gradient-accent: linear-gradient(135deg, #7C3AED, #8B5CF6);
  --iv-gradient-hero: linear-gradient(135deg, #0F766E, #7C3AED);
  --iv-gradient-hero-bg: linear-gradient(160deg, #0F766E 0%, #0D9488 40%, #14B8A6 100%);
  --iv-gradient-warm-bg: linear-gradient(160deg, #F0FDFA 0%, #FFFFFF 40%, #F5F3FF 100%);

  /* --- Shadows --- */
  --iv-shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --iv-shadow-light: 0 1px 4px rgba(0,0,0,0.04);
  --iv-shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --iv-shadow-medium: 0 4px 12px rgba(0,0,0,0.07);
  --iv-shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --iv-shadow-primary: 0 4px 14px rgba(15,118,110,0.3);
  --iv-shadow-accent: 0 4px 14px rgba(124,58,237,0.3);
  --iv-shadow-primary-hover: 0 8px 24px rgba(15,118,110,0.15);

  /* --- Clay & Glass Shadows --- */
  --iv-shadow-clay: 0 4px 16px rgba(0,0,0,0.06), inset 0 -2px 6px rgba(0,0,0,0.02);
  --iv-shadow-clay-hover: 0 12px 32px rgba(0,0,0,0.1), inset 0 -2px 6px rgba(0,0,0,0.02);
  --iv-shadow-cta: 0 4px 20px rgba(0,0,0,0.15);
  --iv-shadow-cta-hover: 0 8px 28px rgba(0,0,0,0.2);
  --iv-shadow-glass: 0 8px 32px rgba(0,0,0,0.08);
  --iv-shadow-glow-primary: 0 0 40px rgba(15,118,110,0.15);
  --iv-shadow-glow-accent: 0 0 40px rgba(124,58,237,0.15);

  /* --- Glass Effect --- */
  --iv-glass-bg: rgba(255,255,255,0.72);
  --iv-glass-border: 1px solid rgba(255,255,255,0.4);
  --iv-glass-blur: blur(16px);

  /* --- Typography --- */
  --iv-font-ar: 'Tajawal', sans-serif;
  --iv-font-en: 'Inter', sans-serif;

  /* Font sizes — Enhanced */
  --iv-text-hero: 56px;
  --iv-text-h2: 36px;
  --iv-text-h3: 22px;
  --iv-text-h4: 16px;
  --iv-text-h5: 14px;
  --iv-text-body: 17px;
  --iv-text-small: 14px;
  --iv-text-xs: 12px;
  --iv-text-tag: 10px;
  --iv-text-number: 36px;

  /* Font weights */
  --iv-weight-regular: 400;
  --iv-weight-medium: 500;
  --iv-weight-semibold: 600;
  --iv-weight-bold: 700;
  --iv-weight-extrabold: 800;

  /* --- Spacing (4px grid) --- */
  --iv-space-1: 4px;
  --iv-space-2: 8px;
  --iv-space-3: 12px;
  --iv-space-4: 16px;
  --iv-space-5: 20px;
  --iv-space-6: 24px;
  --iv-space-8: 32px;
  --iv-space-10: 40px;
  --iv-space-12: 48px;
  --iv-space-16: 64px;
  --iv-space-20: 80px;

  /* --- Border Radius — Claymorphism-inspired --- */
  --iv-radius-sm: 6px;
  --iv-radius-md: 8px;
  --iv-radius-lg: 12px;
  --iv-radius-xl: 16px;
  --iv-radius-2xl: 20px;
  --iv-radius-3xl: 24px;
  --iv-radius-pill: 50px;
  --iv-radius-full: 50%;

  /* --- Container --- */
  --iv-container-max: 1200px;
  --iv-container-px: 24px;
  --iv-section-py: 80px;

  /* --- Line heights --- */
  --iv-leading-hero: 1.2;
  --iv-leading-tight: 1.3;

  /* --- Transitions --- */
  --iv-transition-fast: 200ms ease-out;
  --iv-transition-normal: 300ms ease-out;
  --iv-transition-slow: 600ms ease-out;
  --iv-cubic-bounce: cubic-bezier(0.175, 0.885, 0.32, 1.275);

  /* --- Z-index --- */
  --iv-z-dropdown: 100;
  --iv-z-sticky: 1000;
  --iv-z-modal: 1100;
  --iv-z-toast: 1200;
}

/* ============================================
   2. BASE STYLES
   ============================================ */

/* Font Split: Latin characters use Inter, Arabic uses Tajawal
   This solves RTL font rendering issues where Latin text
   appears in Arabic font. See: MDN unicode-bidi docs */
@font-face {
  font-family: 'IvonsArabic';
  src: local('Tajawal');
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F, U+202A-202E;
  font-weight: 100 900;
  font-style: normal;
}

@font-face {
  font-family: 'IvonsArabic';
  src: local('Tajawal');
  unicode-range: U+0000-024F, U+1E00-1EFF, U+2000-200B, U+2010-206F, U+20A0-20CF, U+2100-214F, U+2190-21FF, U+2200-22FF, U+2300-23FF, U+25A0-25FF, U+2600-26FF, U+2700-27BF, U+2B00-2BFF, U+3000-303F, U+F000-FFFF;
  font-weight: 100 900;
  font-style: normal;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--iv-font-ar), 'IvonsArabic', var(--iv-font-en), sans-serif !important;
  color: var(--iv-text-primary);
  background: var(--iv-bg-white);
  line-height: 1.7;
  font-size: var(--iv-text-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  direction: rtl;
}

/* Remove the inherit rule that forced Arabic font on Latin chars */
/* * { font-family: inherit; } — REMOVED to fix Latin text rendering */

/* English text fallback */
.en-text {
  font-family: var(--iv-font-en) !important;
  direction: ltr;
}

/* Links */
a {
  text-decoration: none;
  color: inherit;
}

/* Images */
img {
  max-width: 100%;
  display: block;
}

/* Lists */
ul, ol {
  list-style: none;
}

/* Buttons */
button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--iv-font-ar);
}

/* Container */
.iv-container {
  max-width: var(--iv-container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--iv-container-px);
  padding-right: var(--iv-container-px);
}

/* ============================================
   3. TYPOGRAPHY
   ============================================ */

.iv-gradient-text {
  background: var(--iv-gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.iv-section-label {
  display: inline-block;
  font-size: var(--iv-text-xs);
  font-weight: var(--iv-weight-semibold);
  color: var(--iv-primary-900);
  background: var(--iv-primary-100);
  padding: var(--iv-space-1) 14px;
  border-radius: var(--iv-radius-pill);
  letter-spacing: 0.5px;
  margin-bottom: var(--iv-space-3);
}

.iv-section-title {
  font-size: var(--iv-text-h2);
  font-weight: var(--iv-weight-extrabold);
  line-height: 1.4;
  color: var(--iv-text-primary);
  margin-bottom: var(--iv-space-3);
}

.iv-section-desc {
  font-size: var(--iv-text-body);
  color: var(--iv-text-secondary);
  line-height: 1.8;
  max-width: 640px;
}

/* ============================================
   4. BUTTONS
   ============================================ */

.iv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--iv-space-2);
  padding: 12px 28px;
  border-radius: var(--iv-radius-lg);
  font-family: var(--iv-font-ar);
  font-size: var(--iv-text-small);
  font-weight: var(--iv-weight-semibold);
  transition: all var(--iv-transition-fast);
  white-space: nowrap;
}

.iv-btn-primary {
  background: var(--iv-primary-900);
  color: white;
  box-shadow: var(--iv-shadow-primary);
}
.iv-btn-primary:hover {
  background: #0D6B63;
  box-shadow: 0 6px 20px rgba(15,118,110,0.4);
  transform: translateY(-1px);
}
.iv-btn-primary:active { transform: scale(0.98); }

.iv-btn-accent {
  background: var(--iv-gradient-accent);
  color: white;
  box-shadow: var(--iv-shadow-accent);
}
.iv-btn-accent:hover {
  background: linear-gradient(135deg, #6D28D9, var(--iv-accent-700));
  box-shadow: 0 6px 20px rgba(124,58,237,0.4);
  transform: translateY(-1px);
}
.iv-btn-accent:active { transform: scale(0.98); }

.iv-btn-outline {
  border: 1.5px solid var(--iv-border);
  color: var(--iv-text-secondary);
  background: white;
}
.iv-btn-outline:hover {
  border-color: var(--iv-primary-900);
  color: var(--iv-primary-900);
  background: var(--iv-primary-100);
}

.iv-btn-ghost {
  color: var(--iv-primary-900);
  font-weight: var(--iv-weight-semibold);
  padding: 8px 0;
}
.iv-btn-ghost:hover { color: var(--iv-primary-700); }
.iv-btn-ghost::after {
  content: ' ←';
  transition: transform var(--iv-transition-fast);
  display: inline-block;
}
.iv-btn-ghost:hover::after { transform: translateX(-4px); }

/* ============================================
   5. CARDS
   ============================================ */

.iv-card {
  background: var(--iv-bg-white);
  border: 1px solid var(--iv-border-light);
  border-radius: var(--iv-radius-xl);
  padding: var(--iv-space-6);
  transition: all var(--iv-transition-normal);
  position: relative;
  overflow: hidden;
}

.iv-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--iv-shadow-primary-hover);
  border-color: transparent;
}

/* ============================================
   6. FORM ELEMENTS
   ============================================ */

.iv-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--iv-border);
  border-radius: var(--iv-radius-lg);
  font-family: var(--iv-font-ar);
  font-size: var(--iv-text-small);
  color: var(--iv-text-primary);
  background: var(--iv-bg-page);
  transition: all var(--iv-transition-fast);
  outline: none;
}

.iv-input:focus {
  border-color: var(--iv-primary-900);
  box-shadow: 0 0 0 3px rgba(15,118,110,0.1);
  background: white;
}

.iv-input::placeholder {
  color: var(--iv-text-light);
}

/* ============================================
   7. BADGES & TAGS
   ============================================ */

.iv-badge {
  display: inline-block;
  font-size: var(--iv-text-tag);
  font-weight: var(--iv-weight-semibold);
  padding: 3px 10px;
  border-radius: var(--iv-radius-sm);
}

.iv-badge-primary {
  background: var(--iv-primary-100);
  color: var(--iv-primary-900);
}

.iv-badge-accent {
  background: var(--iv-accent-100);
  color: var(--iv-accent-700);
}

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

.iv-pill {
  display: inline-block;
  font-size: var(--iv-text-tag);
  font-weight: var(--iv-weight-medium);
  padding: 4px 14px;
  border-radius: var(--iv-radius-pill);
  letter-spacing: 0.5px;
}

/* ============================================
   8. SECTION LAYOUTS
   ============================================ */

.iv-section {
  padding: var(--iv-section-py) 0;
  position: relative;
}

.iv-section-white { background: var(--iv-bg-white); }
.iv-section-gray { background: var(--iv-bg-page); }
.iv-section-warm { background: var(--iv-bg-warm); }
.iv-section-teal { background: var(--iv-gradient-primary); color: white; }

.iv-section-header {
  text-align: center;
  margin-bottom: var(--iv-space-12);
}

.iv-section-header-start {
  margin-bottom: var(--iv-space-12);
}

/* ============================================
   9. ICON CONTAINERS
   ============================================ */

.iv-icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.iv-icon-box-sm {
  width: 28px;
  height: 28px;
  border-radius: var(--iv-radius-md);
  font-size: 13px;
}

.iv-icon-box-md {
  width: 40px;
  height: 40px;
  border-radius: var(--iv-radius-lg);
  font-size: 18px;
}

.iv-icon-box-lg {
  width: 52px;
  height: 52px;
  border-radius: var(--iv-radius-xl);
  font-size: 24px;
}

.iv-icon-box-xl {
  width: 64px;
  height: 64px;
  border-radius: var(--iv-radius-2xl);
  font-size: 28px;
}

/* Icon box color variants */
.iv-icon-box-primary { background: var(--iv-gradient-primary); }
.iv-icon-box-accent { background: var(--iv-gradient-accent); }
.iv-icon-box-gold { background: linear-gradient(135deg, var(--iv-gold), var(--iv-gold-light)); }
.iv-icon-box-dark { background: linear-gradient(135deg, var(--iv-text-primary), #475569); }
.iv-icon-box-mixed { background: linear-gradient(135deg, var(--iv-primary-900), var(--iv-accent-700)); }

/* ============================================
   10. RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  :root {
    --iv-section-py: 64px;
    --iv-text-hero: 40px;
    --iv-text-h2: 28px;
  }
}

@media (max-width: 768px) {
  :root {
    --iv-section-py: 56px;
    --iv-text-hero: 36px;
    --iv-text-h2: 26px;
    --iv-container-px: 16px;
  }
}

@media (max-width: 480px) {
  :root {
    --iv-text-hero: 28px;
    --iv-text-h2: 22px;
  }
}

/* ============================================
   13. REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ============================================
   11. ANIMATIONS
   ============================================ */

/* Scroll reveal — sections fade in as they enter viewport */
@keyframes iv-fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes iv-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes iv-slideDown {
  from { opacity: 0; transform: translateY(-100%); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes auroraShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ============================================
   11b. SCROLL REVEAL (data-reveal)
   ============================================ */

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

[data-reveal-delay="1"] { transition-delay: 100ms; }
[data-reveal-delay="2"] { transition-delay: 200ms; }
[data-reveal-delay="3"] { transition-delay: 300ms; }
[data-reveal-delay="4"] { transition-delay: 400ms; }
[data-reveal-delay="5"] { transition-delay: 500ms; }

/* ============================================
   11c. WAVE DIVIDERS
   ============================================ */

.wave-divider {
  position: relative;
  z-index: 1;
  line-height: 0;
  margin-top: -2px;
}

.wave-divider svg {
  display: block;
  width: 100%;
  height: 60px;
}

/* ============================================
   12. UTILITY CLASSES
   ============================================ */

.iv-text-center { text-align: center; }
.iv-text-start { text-align: right; } /* RTL start */
.iv-text-end { text-align: left; } /* RTL end */

.iv-mb-0 { margin-bottom: 0; }
.iv-mb-1 { margin-bottom: var(--iv-space-1); }
.iv-mb-2 { margin-bottom: var(--iv-space-2); }
.iv-mb-3 { margin-bottom: var(--iv-space-3); }
.iv-mb-4 { margin-bottom: var(--iv-space-4); }
.iv-mb-6 { margin-bottom: var(--iv-space-6); }
.iv-mb-8 { margin-bottom: var(--iv-space-8); }

.iv-mt-0 { margin-top: 0; }
.iv-mt-2 { margin-top: var(--iv-space-2); }
.iv-mt-3 { margin-top: var(--iv-space-3); }
.iv-mt-4 { margin-top: var(--iv-space-4); }
.iv-mt-6 { margin-top: var(--iv-space-6); }

.iv-hidden { display: none; }
.iv-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* ============================================
   13. PRINT STYLES
   ============================================ */

@media print {
  .iv-top-bar,
  .iv-header,
  .iv-footer,
  .iv-mega-menu,
  .iv-btn {
    display: none !important;
  }

  body {
    font-size: 12pt;
    color: black;
    background: white;
  }
}