/* 99FX Brand Identity - Global Design System */

:root {
  /* Primary Brand Colors - Modern Blue Palette */
  --brand-primary: #0066FF;
  --brand-primary-dark: #1557b0;
  --brand-primary-light: #4285f4;
  --brand-secondary: #00D4AA;
  --brand-accent: #FFD700;
  --brand-danger: #EF4444;
  --brand-warning: #F59E0B;
  --brand-info: #00bcd4;
  
  /* Legacy Support - Compatibility Variables */
  --primary-color: #0066FF;
  --primary-dark: #1557b0;
  --primary-light: #4285f4;
  --gradient-primary: linear-gradient(135deg, #0066FF 0%, #00D4AA 100%);
  
  /* Neutral Colors - Professional Gray Scale */
  --neutral-white: #ffffff;
  --neutral-50: #fafafa;
  --neutral-100: #f5f5f5;
  --neutral-200: #e5e5e5;
  --neutral-300: #d4d4d4;
  --neutral-400: #a3a3a3;
  --neutral-500: #737373;
  --neutral-600: #525252;
  --neutral-700: #404040;
  --neutral-800: #262626;
  --neutral-900: #171717;
  --neutral-black: #000000;
  
  /* Dark Theme Colors */
  --dark-bg-primary: #0f1419;
  --dark-bg-secondary: #1a2332;
  --dark-bg-tertiary: #243447;
  --dark-surface: #2d3748;
  --dark-border: #4a5568;
  
  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-arabic: 'Tajawal', 'Cairo', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  
  /* Font Sizes - Responsive Scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-6xl: 3.75rem;
  --text-7xl: 4.5rem;
  
  /* Spacing System */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;
  
  /* Border Radius */
  --radius-sm: 0.125rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;
  --radius-3xl: 1.5rem;
  --radius-full: 9999px;
  
  /* Shadows - Layered System */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Z-index Scale */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
  --z-toast: 1080;
  
  /* New variables for the blog section */
  --brand-dark: #0A0A0A;
  --brand-light: #F8FAFC;
  --brand-gray: #64748B;
  --brand-success: #10B981;
}

/* Global Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-primary);
  font-weight: 400;
  line-height: 1.6;
  color: var(--neutral-700);
  background-color: var(--neutral-white);
  overflow-x: hidden;
}

/* Arabic Text Support */
[dir="rtl"] {
  font-family: var(--font-arabic);
}

/* Typography System */
.text-display-1 {
  font-size: var(--text-7xl);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.text-display-2 {
  font-size: var(--text-6xl);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.text-heading-1 {
  font-size: var(--text-5xl);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.text-heading-2 {
  font-size: var(--text-4xl);
  font-weight: 600;
  line-height: 1.3;
}

.text-heading-3 {
  font-size: var(--text-3xl);
  font-weight: 600;
  line-height: 1.3;
}

.text-heading-4 {
  font-size: var(--text-2xl);
  font-weight: 500;
  line-height: 1.4;
}

.text-body-large {
  font-size: var(--text-xl);
  line-height: 1.6;
}

.text-body {
  font-size: var(--text-base);
  line-height: 1.6;
}

.text-body-small {
  font-size: var(--text-sm);
  line-height: 1.5;
}

.text-caption {
  font-size: var(--text-xs);
  line-height: 1.4;
  color: var(--neutral-500);
}

/* Button System - Enterprise Grade */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-base);
  font-weight: 500;
  line-height: 1;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  user-select: none;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-light) 100%);
  color: var(--neutral-white);
  box-shadow: var(--shadow-sm);
  border: none;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left var(--transition-slow);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--brand-primary-dark) 0%, var(--brand-primary) 100%);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.btn-primary:hover:not(:disabled)::before {
  left: 100%;
}

.btn-secondary {
  background-color: transparent;
  color: var(--brand-primary);
  border: 2px solid var(--brand-primary);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--brand-primary);
  color: var(--neutral-white);
  transform: translateY(-1px);
}

.btn-outline {
  background-color: transparent;
  color: var(--neutral-700);
  border: 1px solid var(--neutral-300);
}

.btn-outline:hover:not(:disabled) {
  background-color: var(--neutral-50);
  border-color: var(--neutral-400);
}

.btn-ghost {
  background-color: transparent;
  color: var(--neutral-700);
  border: none;
}

.btn-ghost:hover:not(:disabled) {
  background-color: var(--neutral-100);
}

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

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

.btn-xl {
  padding: var(--space-5) var(--space-10);
  font-size: var(--text-xl);
  border-radius: var(--radius-2xl);
}

/* Card System */
.card {
  background-color: var(--neutral-white);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  overflow: hidden;
}

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

.card-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--neutral-200);
  background-color: var(--neutral-50);
}

.card-body {
  padding: var(--space-6);
}

.card-footer {
  padding: var(--space-6);
  border-top: 1px solid var(--neutral-200);
  background-color: var(--neutral-50);
}

/* Glass Morphism Effect */
.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

.glass-dark {
  background: rgba(15, 20, 25, 0.8);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Gradient Backgrounds */
.gradient-primary {
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-light) 100%);
}

.gradient-secondary {
  background: linear-gradient(135deg, var(--brand-secondary) 0%, #48cc5c 100%);
}

.gradient-hero {
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-light) 50%, var(--brand-secondary) 100%);
}

.gradient-sunset {
  background: linear-gradient(135deg, #ff6b6b 0%, #ffa500 50%, #ffed4e 100%);
}

.gradient-ocean {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Animation System */
.animate-fade-in {
  animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-slide-up {
  animation: slideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-slide-down {
  animation: slideDown 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-slide-left {
  animation: slideLeft 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-slide-right {
  animation: slideRight 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-scale-in {
  animation: scaleIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-bounce-in {
  animation: bounceIn 1s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Keyframes */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideLeft {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideRight {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes bounceIn {
  0% { opacity: 0; transform: scale(0.3); }
  50% { opacity: 1; transform: scale(1.05); }
  70% { transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1); }
}

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

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

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Text Effects */
.text-gradient {
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-secondary {
  background: linear-gradient(135deg, var(--brand-secondary) 0%, #48cc5c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-glow {
  text-shadow: 0 0 20px rgba(26, 115, 232, 0.5);
}

/* Utility Classes */
.hover-lift:hover {
  transform: translateY(-8px);
  transition: transform var(--transition-normal);
}

.hover-scale:hover {
  transform: scale(1.05);
  transition: transform var(--transition-normal);
}

.hover-rotate:hover {
  transform: rotate(5deg);
  transition: transform var(--transition-normal);
}

.hover-glow:hover {
  box-shadow: 0 0 30px rgba(26, 115, 232, 0.3);
  transition: box-shadow var(--transition-normal);
}

/* Loading States */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Focus States - Accessibility */
.btn:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .text-display-1 { font-size: var(--text-5xl); }
  .text-display-2 { font-size: var(--text-4xl); }
  .text-heading-1 { font-size: var(--text-3xl); }
  .text-heading-2 { font-size: var(--text-2xl); }
  
  .btn { padding: var(--space-3) var(--space-5); }
  .btn-lg { padding: var(--space-3) var(--space-6); }
  .btn-xl { padding: var(--space-4) var(--space-8); }
  
  .card-body { padding: var(--space-4); }
}

@media (max-width: 480px) {
  .text-display-1 { font-size: var(--text-4xl); }
  .text-display-2 { font-size: var(--text-3xl); }
  .text-heading-1 { font-size: var(--text-2xl); }
  
  .btn { padding: var(--space-2) var(--space-4); font-size: var(--text-sm); }
}

/* Dark Theme Support */
@media (prefers-color-scheme: dark) {
  :root {
    --neutral-white: var(--dark-bg-primary);
    --neutral-50: var(--dark-bg-secondary);
    --neutral-100: var(--dark-bg-tertiary);
    --neutral-200: var(--dark-surface);
    --neutral-700: #e2e8f0;
    --neutral-800: #cbd5e1;
    --neutral-900: #f1f5f9;
  }
  
  body {
    background-color: var(--dark-bg-primary);
    color: #e2e8f0;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .btn-primary {
    border: 2px solid var(--neutral-black);
  }
  
  .card {
    border: 2px solid var(--neutral-400);
  }
}

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

/* Brand Typography */
.brand-heading {
  font-family: 'Inter', 'Cairo', sans-serif;
  font-weight: 700;
  line-height: 1.2;
}

.brand-text {
  font-family: 'Inter', 'Cairo', sans-serif;
  font-weight: 400;
  line-height: 1.6;
}

/* Brand Buttons */
.btn-brand-primary {
  background: var(--gradient-primary);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
}

.btn-brand-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 102, 255, 0.4);
}

.btn-brand-secondary {
  background: var(--gradient-secondary);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 212, 170, 0.3);
}

.btn-brand-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 212, 170, 0.4);
}

/* Brand Cards */
.brand-card {
  background: white;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.brand-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

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

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

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

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

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

@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Animation Classes */
.animate-float {
  animation: float 6s ease-in-out infinite;
}

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

.animate-gradient {
  background-size: 200% 200%;
  animation: gradient-shift 8s ease infinite;
}

.animate-slide-in-up {
  animation: slide-in-up 0.8s ease-out;
}

.animate-fade-in {
  animation: fade-in 1s ease-out;
}

.animate-scale-in {
  animation: scale-in 0.6s ease-out;
}

/* Text Gradient */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Hover Effects */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
}

.hover-glow {
  transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
  box-shadow: 0 0 30px rgba(0, 102, 255, 0.3);
}

/* Blog Specific Styles */
.blog-hero {
  background: linear-gradient(135deg, #0A0A0A 0%, #1F2937 50%, #0066FF 100%);
  position: relative;
  overflow: hidden;
}

.blog-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
}

.blog-card {
  background: white;
  border-radius: 24px;
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.blog-card:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
  border-color: rgba(0, 102, 255, 0.2);
}

.blog-card-image {
  position: relative;
  overflow: hidden;
}

.blog-card-image img {
  transition: transform 0.5s ease;
}

.blog-card:hover .blog-card-image img {
  transform: scale(1.1);
}

/* Line Clamp Utilities */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

/* Responsive Design */
@media (max-width: 768px) {
  .blog-hero {
    min-height: 70vh;
  }
  
  .blog-card:hover {
    transform: translateY(-6px) scale(1.01);
  }
  
  .animate-float {
    animation-duration: 4s;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .brand-card {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
  }
  
  .glass {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.1);
  }
}

/* Performance Optimizations */
.will-change-transform {
  will-change: transform;
}

.backface-hidden {
  backface-visibility: hidden;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .animate-float,
  .animate-pulse-glow,
  .animate-gradient,
  .animate-slide-in-up,
  .animate-fade-in,
  .animate-scale-in {
    animation: none;
  }
  
  .blog-card,
  .hover-lift,
  .btn-brand-primary,
  .btn-brand-secondary {
    transition: none;
  }
}

/* Focus States for Accessibility */
.focus-visible:focus {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .blog-hero,
  .animate-float,
  .glass,
  .glass-dark {
    background: white !important;
    color: black !important;
    box-shadow: none !important;
  }
} 