/* G2 Middle East - Design System CSS */
/* Based on design-system.json specification */

/* ============================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================ */

:root {
  /* Colors - Primary */
  --color-navy: #111827;
  --color-background: #F9FAFB;
  --color-text: #111111;
  
  /* Colors - Secondary */
  --color-blue: #2563EB;
  --color-blue-hover: #1D4ED8;
  --color-blue-light: #EFF6FF;
  --color-warm-gray: #6B7280;
  
  /* Colors - Accent */
  --color-gold: #D4AF37;
  
  /* Colors - Neutrals */
  --color-white: #FFFFFF;
  --color-gray-light: #E5E7EB;
  --color-gray-dark: #374151;
  
  /* Colors - States */
  --color-success: #059669;
  --color-warning: #D97706;
  --color-error: #DC2626;
  --color-info: #0EA5E9;
  
  /* Typography - Font Families */
  --font-primary: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-secondary: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  
  /* Spacing */
  --space-none: 0px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 72px;
  --space-section: 96px;
  
  /* Border Radius */
  --radius-none: 0px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 12px;
  --radius-pill: 9999px;
  
  /* Shadows */
  --shadow-none: none;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 10px 25px rgba(15, 23, 42, 0.12);
  
  /* Layout */
  --content-max-width: 1200px;
  --header-height: 72px;
  --section-padding-y: 96px;
  --section-padding-x: 16px;
}

/* ============================================
   GLOBAL RESET & BASE STYLES
   ============================================ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 400;
  color: var(--color-text);
  background-color: var(--color-background);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, .h1 {
  font-size: 3.0rem;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--color-navy);
}

h2, .h2 {
  font-size: 2.2rem;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-navy);
}

h3, .h3 {
  font-size: 1.5rem;
  line-height: 1.3;
  font-weight: 500;
  color: var(--color-navy);
}

h4, .h4 {
  font-size: 1.25rem;
  line-height: 1.4;
  font-weight: 500;
  color: var(--color-navy);
}

p, .body {
  font-size: 1.0rem;
  line-height: 1.6;
  font-weight: 400;
  color: var(--color-text);
}

.small {
  font-size: 0.875rem;
  line-height: 1.5;
  font-weight: 400;
}

.meta {
  font-size: 0.75rem;
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-warm-gray);
}

/* Responsive Typography */
@media (max-width: 768px) {
  h1, .h1 { font-size: 2.25rem; }
  h2, .h2 { font-size: 1.75rem; }
  h3, .h3 { font-size: 1.25rem; }
}

/* ============================================
   LAYOUT UTILITIES
   ============================================ */

.container {
  width: 100%;
  max-width: var(--content-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--section-padding-x);
  padding-right: var(--section-padding-x);
}

.section {
  padding-top: var(--section-padding-y);
  padding-bottom: var(--section-padding-y);
}

/* ============================================
   HEADER COMPONENT
   ============================================ */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: var(--color-white);
  border-bottom: 1px solid var(--color-gray-light);
  z-index: 1000;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.header-logo {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-navy);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.header-nav {
  display: flex;
  gap: var(--space-xl);
  align-items: center;
}

.header-link {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--color-navy);
  text-decoration: none;
  transition: color 0.2s ease;
  position: relative;
}

.header-link:hover {
  color: var(--color-blue);
}

.header-link.active::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--color-blue);
}

/* Mobile Menu */
.mobile-menu-button {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--color-navy);
  cursor: pointer;
}

@media (max-width: 768px) {
  .header-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background-color: var(--color-white);
    flex-direction: column;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--color-gray-light);
    gap: var(--space-md);
  }
  
  .header-nav.mobile-open {
    display: flex;
  }
  
  .mobile-menu-button {
    display: block;
  }
}

/* ============================================
   BUTTON COMPONENT
   ============================================ */

.btn {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--font-primary);
  text-decoration: none;
  text-align: center;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 12px 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--color-blue);
  color: var(--color-white);
  border-color: var(--color-blue);
}

.btn-primary:hover {
  background-color: var(--color-blue-hover);
  border-color: var(--color-blue-hover);
}

.btn-secondary {
  background-color: var(--color-white);
  color: var(--color-blue);
  border-color: var(--color-blue);
}

.btn-secondary:hover {
  background-color: var(--color-blue-light);
}

.btn-ghost {
  background-color: transparent;
  color: var(--color-blue);
  border-color: transparent;
}

.btn-ghost:hover {
  background-color: var(--color-blue-light);
}

/* ============================================
   HERO COMPONENT
   ============================================ */

.hero {
  background-color: var(--color-background);
  padding-top: calc(var(--header-height) + var(--section-padding-y));
  padding-bottom: var(--section-padding-y);
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Hero with background image */
.hero-with-image {
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('https://images.unsplash.com/photo-1540575467063-178a50c2df87?w=1920&q=80');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: grayscale(100%);
  opacity: 0.15;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    180deg,
    var(--color-background) 0%,
    transparent 20%,
    transparent 80%,
    var(--color-background) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-title {
  font-size: 3.0rem;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--color-navy);
  margin-bottom: var(--space-lg);
}

.hero-subtitle {
  font-size: 1.0rem;
  line-height: 1.6;
  color: var(--color-warm-gray);
  max-width: 600px;
  margin: 0 auto var(--space-2xl);
}

.hero-cta {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .hero {
    padding-top: calc(var(--header-height) + var(--space-3xl));
    padding-bottom: var(--space-3xl);
  }
  
  .hero-with-image {
    min-height: 500px;
  }
  
  .hero-title {
    font-size: 2.25rem;
  }
  
  .hero-cta {
    flex-direction: column;
    align-items: center;
  }
  
  .hero-cta .btn {
    width: 100%;
    max-width: 300px;
  }
}

/* ============================================
   CARD COMPONENT
   ============================================ */

.card {
  background-color: var(--color-white);
  border: 1px solid var(--color-gray-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--space-lg);
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-blue);
}

.card-title {
  font-size: 1.5rem;
  line-height: 1.3;
  font-weight: 500;
  color: var(--color-navy);
  margin-bottom: var(--space-md);
}

.card-body {
  font-size: 1.0rem;
  line-height: 1.6;
  color: var(--color-warm-gray);
}

/* ============================================
   STATS STRIP COMPONENT
   ============================================ */

.stats-strip {
  background-color: var(--color-white);
  border-top: 1px solid var(--color-gray-light);
  border-bottom: 1px solid var(--color-gray-light);
  padding: var(--space-3xl) 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-2xl);
  text-align: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-number {
  font-size: 2.0rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--color-navy);
  margin-bottom: var(--space-sm);
}

.stat-label {
  font-size: 0.75rem;
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-warm-gray);
}

/* ============================================
   CTA BAND COMPONENT
   ============================================ */

.cta-band {
  background-color: var(--color-navy);
  color: var(--color-white);
  padding: var(--space-3xl) 0;
  text-align: center;
}

.cta-band-title {
  font-size: 1.5rem;
  line-height: 1.3;
  font-weight: 500;
  color: var(--color-white);
  margin-bottom: var(--space-md);
}

.cta-band-body {
  font-size: 1.0rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
  max-width: 600px;
  margin: 0 auto var(--space-xl);
}

/* ============================================
   FOOTER COMPONENT
   ============================================ */

.footer {
  background-color: var(--color-white);
  border-top: 1px solid var(--color-gray-light);
  padding: var(--space-3xl) 0 var(--space-xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

.footer-column h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-navy);
  margin-bottom: var(--space-md);
}

.footer-link {
  display: block;
  font-size: 0.875rem;
  color: var(--color-warm-gray);
  text-decoration: none;
  margin-bottom: var(--space-sm);
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--color-navy);
}

.footer-bottom {
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-gray-light);
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-warm-gray);
}

/* ============================================
   FORM COMPONENTS
   ============================================ */

.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-navy);
  margin-bottom: var(--space-sm);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  background-color: var(--color-white);
  border: 1px solid var(--color-gray-light);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  padding: 10px 12px;
  font-family: var(--font-primary);
  font-size: 1.0rem;
  transition: border-color 0.2s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-blue);
}

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

.form-helper {
  font-size: 0.875rem;
  color: var(--color-warm-gray);
  margin-top: var(--space-xs);
}

.form-error {
  font-size: 0.875rem;
  color: var(--color-error);
  margin-top: var(--space-xs);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

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

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

.text-navy { color: var(--color-navy); }
.text-blue { color: var(--color-blue); }
.text-warm-gray { color: var(--color-warm-gray); }
.text-gold { color: var(--color-gold); }

.bg-white { background-color: var(--color-white); }
.bg-background { background-color: var(--color-background); }
.bg-navy { background-color: var(--color-navy); }

.mt-0 { margin-top: 0; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }
.mt-3xl { margin-top: var(--space-3xl); }

.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }
.mb-3xl { margin-bottom: var(--space-3xl); }

/* ============================================
   GRID SYSTEM
   ============================================ */

.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: repeat(1, 1fr);
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

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

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 2px;
}
