/* Import Montserrat font */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

/**
 * EMERGENCY FONTAWESOME FIXES - MAXIMUM PRIORITY
 * Must be loaded first to prevent Montserrat override
 */
[class*="fa-"], .fa, .fas, .far, .fab, .fal, .fad, .fass, .fasr, .fatl, .fath {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "Font Awesome 5 Free", "Font Awesome 5 Brands" !important;
    font-weight: 900 !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    line-height: 1 !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    display: inline-block !important;
}

/* Brand icons specific */
[class*="fab fa-"], .fab {
    font-family: "Font Awesome 6 Brands", "Font Awesome 5 Brands" !important;
    font-weight: 400 !important;
}

/* Regular icons */
[class*="far fa-"], .far {
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free" !important;
    font-weight: 400 !important;
}

/* Solid icons */
[class*="fas fa-"], .fas {
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free" !important;
    font-weight: 900 !important;
}

/**
 * Original FontAwesome rules (keeping as backup)
 */
.fa, .fas, .far, .fab, .fal, .fad, .fass, .fasr, .fatl, .fath {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "Font Awesome 5 Free", "Font Awesome 5 Brands" !important;
    font-weight: 900;
    font-display: swap;
    line-height: 1;
}

.fab {
    font-family: "Font Awesome 6 Brands", "Font Awesome 5 Brands" !important;
    font-weight: 400;
}

.far {
    font-weight: 400;
}

/* Ensure icons have proper sizing and spacing */
.fa, .fas, .far, .fab {
    display: inline-block;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* MONTSERRAT LOADING - Highly targeted to avoid FontAwesome */
body:not([class*="fa-"]), 
h1:not([class*="fa-"]), h2:not([class*="fa-"]), h3:not([class*="fa-"]), h4:not([class*="fa-"]), h5:not([class*="fa-"]), h6:not([class*="fa-"]),
p:not([class*="fa-"]), 
span:not([class*="fa-"]):not(.fa):not(.fas):not(.far):not(.fab), 
div:not([class*="fa-"]):not(.fa):not(.fas):not(.far):not(.fab),
.btn, .navbar, .card, .form-control {
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif !important;
}

/* Specific overrides for key elements */
.houtini-hero,
.houtini-features, 
.houtini-audience,
.houtini-install-config-content,
.houtini-footer-content {
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif !important;
}

/* =============================================================================
   HOUTINI BASE STYLES
   Typography, resets, and foundational utilities
   ============================================================================= */

/* ===== TYPOGRAPHY FOUNDATION ===== */
body {
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif !important;
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  font-size: var(--houtini-font-size-base);
  color: var(--houtini-text-primary);
  background-color: var(--houtini-bg-primary);
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: var(--houtini-transition-fast);
}

/* ===== HEADINGS ===== */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: 'Montserrat', sans-serif !important;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--houtini-text-primary);
  margin-top: 0;
  margin-bottom: 1rem;
}

h1, .h1 { 
  font-size: var(--houtini-font-size-5xl); 
  font-weight: var(--houtini-font-weight-bold); 
  line-height: var(--houtini-hero-line-height);
}
h2, .h2 { 
  font-size: var(--houtini-font-size-4xl); 
}
h3, .h3 { 
  font-size: var(--houtini-font-size-3xl); 
}
h4, .h4 { 
  font-size: var(--houtini-font-size-2xl); 
}
h5, .h5 { 
  font-size: var(--houtini-font-size-xl); 
}
h6, .h6 { 
  font-size: var(--houtini-font-size-lg); 
}

/* ===== HERO TYPOGRAPHY ===== */
.houtini-hero-title {
  font-size: var(--houtini-hero-title);
  font-weight: var(--houtini-font-weight-bold);
  line-height: var(--houtini-hero-line-height);
  letter-spacing: var(--houtini-heading-tracking);
  margin: 0;
}

.houtini-hero-subtitle {
  font-size: var(--houtini-hero-subtitle);
  font-weight: var(--houtini-font-weight-medium);
  line-height: 1.4;
  color: var(--houtini-text-secondary);
  margin: 16px 0 24px 0;
}

.houtini-section-title {
  font-size: var(--houtini-section-title);
  font-weight: var(--houtini-font-weight-bold);
  line-height: var(--houtini-line-height-tight);
  text-align: center;
  margin-bottom: 16px;
}

/* ===== BODY TEXT ===== */
p {
  line-height: var(--houtini-line-height-relaxed);
  margin-bottom: 1rem;
  color: var(--houtini-text-primary);
}

.lead {
  font-size: var(--houtini-font-size-xl);
  line-height: var(--houtini-line-height-normal);
  color: var(--houtini-text-secondary);
  font-weight: var(--houtini-font-weight-normal);
  margin-bottom: 2rem;
}

.text-secondary {
  color: var(--houtini-text-secondary);
}

.text-muted {
  color: var(--houtini-text-muted);
}

/* ===== CODE & MONOSPACE ===== */
code, kbd, samp, pre {
  font-family: var(--houtini-font-mono);
}

code {
  background: rgba(0, 102, 255, 0.1);
  color: var(--houtini-primary);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.875em;
  font-weight: 500;
}

pre {
  background: var(--houtini-bg-white);
  border: 1px solid var(--houtini-gray-200);
  border-radius: var(--houtini-radius-sm);
  padding: 1.5rem;
  margin: 1.5rem 0;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.6;
}

pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}

/* ===== LINKS ===== */
a {
  color: var(--houtini-primary);
  text-decoration: none;
  transition: var(--houtini-transition-normal);
}

a:hover {
  color: var(--houtini-secondary);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

a:focus {
  outline: 2px solid var(--houtini-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ===== LISTS ===== */
ul, ol {
  margin-bottom: 1rem;
  padding-left: 2rem;
}

li {
  margin-bottom: 0.5rem;
  line-height: var(--houtini-line-height-relaxed);
}

/* ===== UTILITY CLASSES ===== */
.houtini-font-mono { 
  font-family: var(--houtini-font-mono); 
}

/* Text sizes */
.houtini-text-xs { 
  font-size: var(--houtini-font-size-xs); 
}
.houtini-text-sm { 
  font-size: var(--houtini-font-size-sm); 
}
.houtini-text-lg { 
  font-size: var(--houtini-font-size-lg); 
}
.houtini-text-xl { 
  font-size: var(--houtini-font-size-xl); 
}
.houtini-text-2xl { 
  font-size: var(--houtini-font-size-2xl); 
}

/* Font weights */
.houtini-font-normal { 
  font-weight: var(--houtini-font-weight-normal); 
}
.houtini-font-medium { 
  font-weight: var(--houtini-font-weight-medium); 
}
.houtini-font-semibold { 
  font-weight: var(--houtini-font-weight-semibold); 
}
.houtini-font-bold { 
  font-weight: var(--houtini-font-weight-bold); 
}

/* Line heights */
.houtini-leading-tight { 
  line-height: var(--houtini-line-height-tight); 
}
.houtini-leading-normal { 
  line-height: var(--houtini-line-height-normal); 
}
.houtini-leading-relaxed { 
  line-height: var(--houtini-line-height-relaxed); 
}

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

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

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

/* ===== SPACING UTILITIES ===== */
.houtini-spacing-xs { margin: var(--houtini-spacing-xs); }
.houtini-spacing-sm { margin: var(--houtini-spacing-sm); }
.houtini-spacing-md { margin: var(--houtini-spacing-md); }
.houtini-spacing-lg { margin: var(--houtini-spacing-lg); }
.houtini-spacing-xl { margin: var(--houtini-spacing-xl); }

.houtini-mt-xs { margin-top: var(--houtini-spacing-xs); }
.houtini-mt-sm { margin-top: var(--houtini-spacing-sm); }
.houtini-mt-md { margin-top: var(--houtini-spacing-md); }
.houtini-mt-lg { margin-top: var(--houtini-spacing-lg); }
.houtini-mt-xl { margin-top: var(--houtini-spacing-xl); }

.houtini-mb-xs { margin-bottom: var(--houtini-spacing-xs); }
.houtini-mb-sm { margin-bottom: var(--houtini-spacing-sm); }
.houtini-mb-md { margin-bottom: var(--houtini-spacing-md); }
.houtini-mb-lg { margin-bottom: var(--houtini-spacing-lg); }
.houtini-mb-xl { margin-bottom: var(--houtini-spacing-xl); }

/* ===== GLOBAL TRANSITIONS ===== */
a, button, .btn, .card, .navbar {
  transition: all 0.3s ease;
}

/* ===== SHADOW UTILITIES ===== */
.shadow-sm { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.shadow-md { box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07); }
.shadow-lg { box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1); }
.shadow-xl { box-shadow: 0 20px 25px rgba(0, 0, 0, 0.1); }

/* Enhanced selection colors */
::selection {
  background: rgba(0, 102, 255, 0.2);
  color: #0066FF;
}

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

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

/* Skip to content link for screen readers */
.houtini-skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--houtini-primary);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 9999;
}

.houtini-skip-link:focus {
  top: 6px;
}

/* ===== SELECTION STYLES ===== */
::selection {
  background: rgba(0, 102, 255, 0.2);
  color: var(--houtini-text-primary);
}

::-moz-selection {
  background: rgba(0, 102, 255, 0.2);
  color: var(--houtini-text-primary);
}

/* ===== SMOOTH SCROLLING ===== */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ===== GLOBAL SEPARATOR LINES ===== */
.houtini-separator-line {
  width: min(400px, 80vw);
  height: 1px;
  background: linear-gradient(90deg, 
    transparent 0%,
    rgba(0, 102, 255, 0.2) 25%,
    rgba(0, 204, 136, 0.3) 50%,
    rgba(0, 102, 255, 0.2) 75%,
    transparent 100%
  );
  margin: 0 auto;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

/* =============================================================================
   FONTAWESOME ICON SUPPORT - Proper font family handling
   ============================================================================= */
.fa, .fas, .far, .fab, .fal, .fad, .fass, .fasr, .fatl, .fath {
  font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "Font Awesome 5 Free", "Font Awesome 5 Brands" !important;
  font-style: normal !important;
  font-variant: normal !important;
  text-rendering: auto !important;
  -webkit-font-smoothing: antialiased !important;
}

/* Brand icons */
.fab {
  font-family: "Font Awesome 6 Brands", "Font Awesome 5 Brands" !important;
  font-weight: 400 !important;
}

/* Solid icons */
.fas {
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free" !important;
  font-weight: 900 !important;
}

/* Regular icons */
.far {
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free" !important;
  font-weight: 400 !important;
}

.houtini-separator-line:hover {
  opacity: 1;
}
