/**
 * ========================================
 * Quanta Design System v2.0 - "Soft & Creamy"
 * ========================================
 * Inspired by Abwaab.com's Modern Arabic EdTech Aesthetic
 * 
 * Philosophy:
 * - Warm, paper-like backgrounds (no harsh whites)
 * - Soft, diffused shadows for floating elements
 * - Generous whitespace for breathing room
 * - Rounded, friendly shapes
 * - Beautiful Arabic typography
 * ========================================
 */

/* ==================== CSS Variables - The "Soft & Creamy" Palette ==================== */
:root {
  /* ====== BACKGROUND COLORS - The "Warm Paper" Feel ====== */
  --bg-cream: #FDFBF7;           /* Premium Off-White - Main background */
  --bg-cream-soft: #FAF8F5;      /* Slightly warmer variant */
  --bg-cream-warm: #F7F5F0;      /* Warmer for sections */
  --bg-surface: #FFFFFF;          /* Pure white for cards (contrast) */
  --bg-surface-hover: #FEFEFE;    /* Card hover state */
  
  /* ====== PRIMARY BRAND - Soft Teal (Trust & Modernity) ====== */
  --primary-50: #F0FDFA;
  --primary-100: #CCFBF1;
  --primary-200: #99F6E4;
  --primary-300: #5EEAD4;
  --primary-400: #2DD4BF;
  --primary-500: #14B8A6;         /* Main Brand Color - Soft Teal */
  --primary-600: #0D9488;
  --primary-700: #0F766E;
  --primary-800: #115E59;
  --primary-900: #134E4A;

  /* ====== ACCENT - Warm Coral (Energy & Action) ====== */
  --accent-50: #FFF7ED;
  --accent-100: #FFEDD5;
  --accent-200: #FED7AA;
  --accent-300: #FDBA74;
  --accent-400: #FB923C;
  --accent-500: #F97316;          /* Accent Color - Warm Orange */
  --accent-600: #EA580C;
  --accent-700: #C2410C;

  /* ====== TEXT COLORS - Soft & Readable (No Pure Black) ====== */
  --text-heading: #1F2937;        /* Dark Slate - Headings */
  --text-body: #4B5563;           /* Soft Grey - Body text */
  --text-muted: #6B7280;          /* Muted - Secondary text */
  --text-placeholder: #9CA3AF;    /* Placeholder text */
  --text-inverse: #FFFFFF;        /* White text on dark backgrounds */

  /* ====== STATUS COLORS - Soft Variants ====== */
  --success: #10B981;
  --success-soft: rgba(16, 185, 129, 0.1);
  --warning: #F59E0B;
  --warning-soft: rgba(245, 158, 11, 0.1);
  --error: #EF4444;
  --error-soft: rgba(239, 68, 68, 0.1);
  --info: #3B82F6;
  --info-soft: rgba(59, 130, 246, 0.1);

  /* ====== TYPOGRAPHY - Beautiful Arabic ====== */
  --font-family: 'Almarai', 'Cairo', 'Tajawal', sans-serif;
  --font-family-heading: 'Almarai', sans-serif;
  
  /* Font Sizes - Harmonious Scale */
  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.875rem;     /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.25rem;      /* 20px */
  --text-2xl: 1.5rem;      /* 24px */
  --text-3xl: 1.875rem;    /* 30px */
  --text-4xl: 2.25rem;     /* 36px */
  --text-5xl: 3rem;        /* 48px */

  /* Font Weights */
  --font-light: 300;
  --font-regular: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  /* Line Heights - Comfortable Reading */
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.75;
  --leading-loose: 2;

  /* ====== SPACING - Generous Whitespace ====== */
  --space-1: 0.25rem;      /* 4px */
  --space-2: 0.5rem;       /* 8px */
  --space-3: 0.75rem;      /* 12px */
  --space-4: 1rem;         /* 16px */
  --space-5: 1.25rem;      /* 20px */
  --space-6: 1.5rem;       /* 24px */
  --space-8: 2rem;         /* 32px */
  --space-10: 2.5rem;      /* 40px */
  --space-12: 3rem;        /* 48px */
  --space-16: 4rem;        /* 64px */
  --space-20: 5rem;        /* 80px */
  --space-24: 6rem;        /* 96px */

  /* ====== BORDER RADIUS - Friendly Roundness ====== */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-3xl: 32px;
  --radius-full: 9999px;

  /* ====== SHADOWS - Soft Elevation (Floating Effect) ====== */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04), 
               0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06), 
               0 2px 4px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.08), 
               0 4px 8px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.10), 
               0 8px 16px rgba(0, 0, 0, 0.05);
  --shadow-2xl: 0 24px 64px rgba(0, 0, 0, 0.12),
                0 12px 24px rgba(0, 0, 0, 0.06);
  
  /* Colored Shadows */
  --shadow-primary: 0 8px 24px rgba(20, 184, 166, 0.25);
  --shadow-accent: 0 8px 24px rgba(249, 115, 22, 0.25);

  /* ====== BORDERS ====== */
  --border-light: #F3F4F6;
  --border-default: #E5E7EB;
  --border-dark: #D1D5DB;

  /* ====== TRANSITIONS - Smooth & Natural ====== */
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-in-out: cubic-bezier(0.645, 0.045, 0.355, 1);
  --transition-fast: 150ms var(--ease-out);
  --transition-normal: 250ms var(--ease-out);
  --transition-slow: 400ms var(--ease-out);

  /* ====== Z-INDEX Scale ====== */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-tooltip: 700;
}

/* ==================== BASE STYLES ==================== */
html {
  direction: rtl;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-size: var(--text-base);
  font-weight: var(--font-regular);
  line-height: var(--leading-relaxed);
  color: var(--text-body);
  background-color: var(--bg-cream);
}

/* Headings - Beautiful Arabic Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-heading);
  font-weight: var(--font-bold);
  color: var(--text-heading);
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

/* Paragraph styling */
p {
  color: var(--text-body);
  line-height: var(--leading-relaxed);
}

/* Links */
a {
  color: var(--primary-600);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

/* Selection */
::selection {
  background: var(--primary-200);
  color: var(--primary-900);
}

/* ==================== COMPONENT STYLES ==================== */

/* ====== BUTTONS - Pill-shaped & Soft ====== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-family);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  line-height: 1;
  border: none;
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all var(--transition-normal);
  white-space: nowrap;
  min-height: 48px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  color: var(--text-inverse);
  box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(20, 184, 166, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-heading);
  border: 2px solid var(--border-default);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--bg-cream-warm);
  border-color: var(--primary-300);
  color: var(--primary-700);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent-500), var(--accent-600));
  color: var(--text-inverse);
  box-shadow: var(--shadow-accent);
}

.btn-accent:hover {
  background: linear-gradient(135deg, var(--accent-600), var(--accent-700));
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(249, 115, 22, 0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--primary-600);
}

.btn-ghost:hover {
  background: var(--primary-50);
}

/* Button Sizes */
.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  min-height: 36px;
  border-radius: var(--radius-lg);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-lg);
  min-height: 56px;
  border-radius: var(--radius-2xl);
}

/* ====== CARDS - Floating on Cream Background ====== */
.card {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
  transition: all var(--transition-normal);
}

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

.card-interactive:hover {
  border-color: var(--primary-200);
}

.card-flat {
  box-shadow: none;
  border: 1px solid var(--border-default);
}

.card-flat:hover {
  box-shadow: var(--shadow-md);
  transform: none;
}

/* ====== INPUTS - Soft & Rounded ====== */
.input {
  width: 100%;
  padding: var(--space-4);
  font-family: var(--font-family);
  font-size: var(--text-base);
  color: var(--text-heading);
  background: var(--bg-surface);
  border: 2px solid var(--border-default);
  border-radius: var(--radius-lg);
  transition: all var(--transition-normal);
}

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

.input:hover {
  border-color: var(--border-dark);
}

.input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 4px var(--primary-50);
}

.input-error {
  border-color: var(--error);
}

.input-error:focus {
  box-shadow: 0 0 0 4px var(--error-soft);
}

/* ====== BADGES - Soft Pills ====== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  border-radius: var(--radius-full);
}

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

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

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

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

/* ====== SECTION BACKGROUNDS ====== */
.bg-cream { background-color: var(--bg-cream); }
.bg-cream-warm { background-color: var(--bg-cream-warm); }
.bg-surface { background-color: var(--bg-surface); }

.bg-gradient-soft {
  background: linear-gradient(180deg, var(--bg-cream) 0%, var(--bg-cream-warm) 100%);
}

.bg-gradient-hero {
  background: linear-gradient(135deg, var(--bg-cream) 0%, var(--primary-50) 50%, var(--bg-cream-warm) 100%);
}

/* ==================== UTILITY CLASSES ==================== */

/* Text Colors */
.text-heading { color: var(--text-heading); }
.text-body { color: var(--text-body); }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary-600); }
.text-accent { color: var(--accent-500); }

/* Shadows */
.shadow-soft { box-shadow: var(--shadow-md); }
.shadow-float { box-shadow: var(--shadow-lg); }
.shadow-elevated { box-shadow: var(--shadow-xl); }

/* Spacing helpers */
.section-padding {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}

.container-padding {
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

/* ==================== ANIMATIONS ==================== */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@keyframes pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slide-up {
  from { 
    opacity: 0;
    transform: translateY(20px);
  }
  to { 
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-float { animation: float 6s ease-in-out infinite; }
.animate-pulse-soft { animation: pulse-soft 3s ease-in-out infinite; }
.animate-fade-in { animation: fade-in 0.3s ease-out; }
.animate-slide-up { animation: slide-up 0.4s ease-out; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  :root {
    --text-4xl: 2rem;
    --text-3xl: 1.5rem;
    --text-2xl: 1.25rem;
    --space-16: 3rem;
    --space-20: 4rem;
  }
  
  .section-padding {
    padding-top: var(--space-12);
    padding-bottom: var(--space-12);
  }
}

/* ==================== LINE CLAMP ==================== */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==================== SCROLLBAR ==================== */
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

/* Beautiful Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-cream-warm);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-300);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-400);
}
