/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&family=Cairo:wght@300;400;500;600;700;800&display=swap');

/* Design Tokens & Custom Variables */
:root {
  /* Colors */
  --primary: #c5a880;           /* Warm Premium Gold Accent */
  --primary-hover: #b5976f;     /* Gold hover */
  --primary-light: #f7f4ee;     /* Soft gold tint background */
  --dark-navy: #1e1e1e;         /* Corporate Dark Grey */
  --dark-slate: #121212;        /* High-contrast Typography Off-Black */
  --light-bg: #f5f5f5;          /* Very light grey background */
  --section-bg: #eaeaea;        /* Alternate grey background */
  --white: #ffffff;
  --gray-text: #64748b;         /* Slate 500 secondary text */
  --border-color: #cbd5e1;      /* Slate 300 borders */
  --border-light: #e2e8f0;      /* Slate 200 light borders */
  
  /* Fonts */
  --font-en-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-en-display: 'Outfit', sans-serif;
  --font-ar: 'Cairo', sans-serif;
  
  /* Current Active Fonts (will update on language change) */
  --font-body: var(--font-en-body);
  --font-display: var(--font-en-display);
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-premium: 0 20px 25px -5px rgba(15, 55, 90, 0.08), 0 10px 10px -5px rgba(15, 55, 90, 0.03);
  
  /* Transitions */
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Dimensions */
  --header-height: 80px;
  --border-radius: 12px;
  --max-width: 1280px;
}

/* RTL Override Variables */
html[dir="rtl"] {
  --font-body: var(--font-ar);
  --font-display: var(--font-ar);
}

/* Global Resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  background-color: var(--white);
  color: var(--dark-slate);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  color: var(--dark-navy);
}

h1 {
  font-size: 2.75rem;
  font-weight: 800;
}

h2 {
  font-size: 2.25rem;
  position: relative;
  padding-bottom: 12px;
  margin-bottom: 2rem;
}

/* Premium bottom border accent for headings */
h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  inset-inline-start: 0;
  width: 60px;
  height: 4px;
  background-color: var(--primary);
  border-radius: 2px;
}

/* Centered heading helper */
.text-center h2::after {
  inset-inline-start: 50%;
  transform: translateX(-50%);
}
html[dir="rtl"] .text-center h2::after {
  transform: translateX(50%);
}

h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

p {
  color: var(--gray-text);
  margin-bottom: 1.25rem;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-fast);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul {
  list-style: none;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 80px 0;
}

.section-alt {
  background-color: var(--light-bg);
  padding: 80px 0;
}

.grid {
  display: grid;
  gap: 2rem;
}

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

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* Flex Utilities */
.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Button & Action Typography */
button, input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
}

/* Text alignment dynamic helpers using CSS Logical Properties */
.text-start {
  text-align: start;
}

.text-center {
  text-align: center;
}

.text-end {
  text-align: end;
}

/* Badge tags for pages */
.badge {
  display: inline-block;
  padding: 6px 14px;
  background-color: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: 50px;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Background Gradients */
.gradient-overlay {
  position: relative;
}

.gradient-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(15, 55, 90, 0.9) 0%, rgba(15, 23, 42, 0.7) 100%);
  z-index: 1;
}

/* Micro-animations */
@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(140, 179, 57, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 15px rgba(140, 179, 57, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(140, 179, 57, 0); }
}

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

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

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

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

/* Form Styling Core */
.form-group {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-weight: 600;
  color: var(--dark-navy);
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.form-control {
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  outline: none;
  transition: var(--transition-fast);
  background-color: var(--white);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(140, 179, 57, 0.15);
}

/* Accessibility skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--primary);
  color: white;
  padding: 8px;
  z-index: 100;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  h1 { font-size: 2.25rem; }
  h2 { font-size: 1.85rem; }
  .section { padding: 60px 0; }
}

@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.65rem; }
  .section { padding: 50px 0; }
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}
