/* ===== SEO & PERFORMANCE OPTIMIZATION CSS =====
 * Optimized for Google PageSpeed and Core Web Vitals
 */

/* ===== CRITICAL CSS FOR LCP OPTIMIZATION ===== */

/* Font optimization */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ===== IMAGE OPTIMIZATION FOR LCP ===== */
img {
  loading: lazy;
  decoding: async;
  max-width: 100%;
  height: auto;
}

/* Critical above-the-fold images should load immediately */
.hero img,
.logo img,
.navbar img,
.carousel img {
  loading: eager !important;
}

/* Image placeholders to prevent CLS */
.img-container {
  position: relative;
  overflow: hidden;
}

.img-container::before {
  content: '';
  display: block;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.img-container img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== PERFORMANCE OPTIMIZED ANIMATIONS ===== */
.animate-fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform;
}

.animate-fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== HERO SECTION OPTIMIZATION ===== */
.seo-hero {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  position: relative;
  contain: layout style paint;
}

.seo-hero .hero-content {
  position: relative;
  z-index: 2;
  color: white;
  text-align: center;
}

.seo-hero h1 {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  line-height: 1.2;
}

.seo-hero .lead {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.95;
}

/* ===== OPTIMIZED CARDS ===== */
.seo-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  will-change: transform;
  contain: layout style paint;
  overflow: hidden;
}

.seo-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.seo-card .card-img-top {
  height: 200px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.seo-card:hover .card-img-top {
  transform: scale(1.05);
}

/* ===== NAVIGATION OPTIMIZATION ===== */
.seo-navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  will-change: background-color;
  contain: layout style paint;
}

.seo-navbar.scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

/* ===== BUTTON OPTIMIZATIONS ===== */
.seo-btn {
  border: none;
  border-radius: 30px;
  padding: 14px 32px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, box-shadow;
  contain: layout style paint;
  position: relative;
  overflow: hidden;
}

.seo-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.6s ease;
}

.seo-btn:hover::before {
  left: 100%;
}

.seo-btn-primary {
  background: linear-gradient(45deg, #667eea, #764ba2);
  color: white;
}

.seo-btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

/* ===== TESTIMONIALS OPTIMIZATION ===== */
.seo-testimonial {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(15px);
  border-radius: 20px;
  padding: 2.5rem;
  margin: 1rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  transition: transform 0.4s ease;
  will-change: transform;
  contain: layout style paint;
  position: relative;
}

.seo-testimonial::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: 20px;
  font-size: 4rem;
  color: #667eea;
  opacity: 0.3;
  font-family: Georgia, serif;
}

.seo-testimonial:hover {
  transform: translateY(-8px);
}

.seo-testimonial .avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* ===== MOBILE RESPONSIVENESS ===== */
@media (max-width: 768px) {
  .seo-hero h1 {
    font-size: 2.5rem;
  }
  
  .seo-hero .lead {
    font-size: 1.1rem;
  }
  
  .seo-card {
    margin-bottom: 1.5rem;
  }
  
  .seo-testimonial {
    padding: 1.5rem;
    margin: 0.5rem;
  }
  
  /* Reduce motion for users who prefer it */
  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }
}

/* ===== ACCESSIBILITY ENHANCEMENTS ===== */
.seo-btn:focus,
.seo-card:focus,
input:focus,
textarea:focus {
  outline: 3px solid #667eea;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .seo-card {
    border: 2px solid #000;
  }
  
  .seo-btn-primary {
    background: #000;
    color: #fff;
    border: 2px solid #fff;
  }
}

/* ===== LOADING STATES ===== */
.loading-placeholder {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading-shimmer 1.5s infinite;
  border-radius: 8px;
}

.loading-placeholder.text {
  height: 1.2em;
  margin-bottom: 0.5em;
}

.loading-placeholder.title {
  height: 2em;
  margin-bottom: 1em;
}

.loading-placeholder.image {
  height: 200px;
  margin-bottom: 1rem;
}

@keyframes loading-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== PRINT STYLES ===== */
@media print {
  .seo-navbar,
  .seo-btn,
  .carousel-control-prev,
  .carousel-control-next,
  .social-media {
    display: none !important;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.4;
    color: #000;
    background: #fff;
  }
  
  .seo-hero {
    background: #fff;
    color: #000;
    min-height: auto;
    padding: 2rem 0;
  }
  
  .seo-card {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}