/* Import Google Fonts: Rajdhani (700), Exo 2 (600), Inter (400, 500) */
@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@600&family=Inter:wght@400;500&family=Rajdhani:wght@700&display=swap');

:root {
  /* Brand Colors */
  --color-primary: #2E8B2E;    /* Circuit Green */
  --color-navy: #1E2A4A;       /* Navy Blue */
  --color-teal: #1A6B5A;       /* Deep Teal */
  --color-forest: #1A5C1A;     /* Forest Green */
  --color-grey: #8A9099;       /* Slate Grey */
  --color-light-green: #E8F5E8;
  --color-white: #FFFFFF;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  /* Firefox Custom Scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--color-primary) var(--color-navy);
}

/* WebKit Custom Scrollbar */
::-webkit-scrollbar {
  width: 16px;
  height: 16px;
}
::-webkit-scrollbar-track {
  background: var(--color-navy);
}
::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-forest);
}

body {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  line-height: 1.8; /* Increased for better readability */
  color: var(--color-navy);
  background-color: var(--color-white);
  padding-top: 140px; /* Accounts for fixed header + top bar */
}

@media (min-width: 1280px) {
  body {
    padding-top: 160px; /* Increased padding to prevent overlap */
  }
}

/* Modern Navigation Styles */
.header-glass {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
  border-radius: 12px; /* Soft Rect shape */
  margin: 10px auto;
  width: calc(100% - 32px);
  max-width: 1400px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-scrolled {
  margin: 4px auto;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.1);
  padding-top: 2px;
  padding-bottom: 2px;
}

.top-bar-hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

/* Button Refinements */
.btn-primary-solid {
  background-color: var(--color-primary) !important;
  color: var(--color-white) !important;
  border: none !important;
}

.btn-primary-solid:hover {
  background-color: var(--color-forest) !important;
}


h1, h2 {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em; /* Tighter letter-spacing */
}
h1 {
  font-size: 2.25rem; /* Up-scaling slightly, responsive classes will override but good baseline */
}
h2 {
  font-size: 1.875rem;
}

h3, h4, .nav-item, button, .btn {
  font-family: 'Exo 2', sans-serif;
  font-weight: 600;
}
h3 {
  letter-spacing: -0.01em;
}

p, label {
  font-family: 'Inter', sans-serif;
}

/* Base floating WhatsApp button styles */
.whatsapp-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background-color: #25D366;
  color: #FFF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  text-decoration: none;
  animation: pulse-whatsapp 2s infinite;
  transition: transform 0.3s ease;
  will-change: transform;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  color: #FFF;
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 100px; /* Elevated to clear WhatsApp button */
  right: 20px;   /* Consistent with WhatsApp side */
  width: 50px;
  height: 50px;
  background-color: var(--color-navy);
  color: var(--color-white);
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 9998;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  will-change: transform, opacity;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-3px);
  background-color: var(--color-primary);
}

@keyframes pulse-whatsapp {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
  }
}

/* Custom Styles for Hero & Animations */
.bg-circuit {
  background-color: var(--color-navy);
  background-image: 
    linear-gradient(rgba(46, 139, 46, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46, 139, 46, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: 0 0;
  animation: grid-move 20s linear infinite;
  position: relative;
}
@keyframes grid-move {
  0% { background-position: 0 0; }
  100% { background-position: 40px 40px; }
}

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

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

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

.animate-slide-up-delay-1 { opacity: 0; animation: slide-up 0.8s ease-out 0.3s forwards; }
.animate-slide-up-delay-2 { opacity: 0; animation: slide-up 0.8s ease-out 0.5s forwards; }
.animate-slide-up-delay-3 { opacity: 0; animation: slide-up 0.8s ease-out 0.7s forwards; }

@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

.pulse-dot-indicator {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #25D366;
  animation: pulse-dot 2s infinite;
  will-change: transform, box-shadow;
}

/* Page load transition */
.fade-in-body {
  opacity: 0;
  animation: fadeInBody 0.3s ease-in forwards;
}

@keyframes fadeInBody {
  to { opacity: 1; }
}

/* Glow and accent on the "Why Choose NES" card (last div inside hero) */
#hero .bg-\[\#2D4A6B\] {
  box-shadow: 0 0 30px rgba(46, 139, 46, 0.2);
  position: relative;
}
#hero .bg-\[\#2D4A6B\]::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 150px;
  height: 6px;
  background-color: var(--color-primary);
  transform: skewX(-45deg) translateX(10px);
}

/* Service Cards Customizations */
.service-card {
  position: relative;
  overflow: hidden;
  border-top: 4px solid transparent !important;
  transition: all 0.4s ease;
}
.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('data:image/svg+xml;utf8,<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path d="M10 10 L30 30 L50 30 L70 10 M20 50 L40 50 L60 70 M80 40 L80 60" stroke="rgba(46,139,46,0.05)" stroke-width="1.5" fill="none"/></svg>');
  background-size: 80px 80px;
  background-repeat: repeat;
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}
.service-card > * {
  position: relative;
  z-index: 1;
}
.service-card:hover {
  border-top-color: var(--color-primary) !important;
  box-shadow: 0 10px 30px rgba(46, 139, 46, 0.15);
  transform: translateY(-5px);
}

/* Stats Bar */
.bg-\[\#1E2A4A\].border-b-4.border-\[\#2E8B2E\] {
  background: linear-gradient(270deg, var(--color-navy), #151D36, #2D4A6B);
  background-size: 600% 600%;
  animation: bg-pan-slow 15s ease infinite;
}
@keyframes bg-pan-slow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.stat-counter {
  position: relative;
  display: inline-block;
}
.stat-counter::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 10%;
  width: 80%;
  height: 3px;
  background-color: var(--color-primary);
  border-radius: 2px;
}

/* Testimonial Cards */
.bg-\[\#E8F5E8\] .bg-white.p-8.rounded-xl {
  background: linear-gradient(135deg, var(--color-white) 0%, rgba(232, 245, 232, 0.6) 100%);
  position: relative;
  overflow: hidden;
  z-index: 1;
}
.bg-\[\#E8F5E8\] .bg-white.p-8.rounded-xl::before {
  content: "\f10d";
  font-family: inherit;
  font-weight: 900;
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 100px;
  color: var(--color-primary);
  opacity: 0.05;
  z-index: -1;
  transform: rotate(-10deg);
}

/* Section Headings */
h2 {
  position: relative;
  display: inline-block;
}
h2::before, h2::after {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background-color: var(--color-primary);
  border-radius: 50%;
  opacity: 0.8;
}
h2::before { left: -16px; }
h2::after { right: -16px; }

.heading-line {
  padding-bottom: 8px; /* Space for the underline */
  background-image: linear-gradient(var(--color-primary), var(--color-primary));
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: 0% 3px;
  transition: background-size 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}
.heading-line.animate-line {
  background-size: 80% 3px;
}

/* Button Animations */
.btn-primary-solid {
  position: relative;
  overflow: hidden;
  z-index: 1;
}
.btn-primary-solid::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0) 100%);
  transform: skewX(-25deg);
  transition: left 0.5s ease;
  z-index: -1;
}
.btn-primary-solid:hover::before {
  left: 150%;
}

.btn.border-2.border-white {
  position: relative;
  overflow: hidden;
  z-index: 1;
}
.btn.border-2.border-white::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: var(--color-white);
  z-index: -1;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s ease;
}
.btn.border-2.border-white:hover {
  color: var(--color-navy) !important;
}
.btn.border-2.border-white:hover::before {
  transform: scaleX(1);
  transform-origin: left;
}

/* Footer Touches */
footer.bg-\[\#1E2A4A\] {
  position: relative;
}
footer.bg-\[\#1E2A4A\]::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
  z-index: 0;
}
footer .fa-brands {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
footer a.w-10.h-10:hover {
  animation: pulse-ring 1s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
}
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(46, 139, 46, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(46, 139, 46, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 139, 46, 0); }
}

/* Header Logo Enhancements */
#main-logo-img {
  transition: filter 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
a:hover #main-logo-img {
  filter: drop-shadow(0 4px 12px rgba(46, 139, 46, 0.35)) brightness(1.05);
  transform: scale(1.03) translateY(-1px);
}

/* Sticky CTA Bar Styles */
#sticky-cta-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #1E2A4A;
    border-top: 2px solid #2E8B2E;
    z-index: 9998;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.3);
    transform: translateY(100%);
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    height: 56px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

#sticky-cta-bar.show {
    transform: translateY(0);
}

body.cta-active {
    padding-bottom: 56px;
}

/* Pulsing Dot */
.pulsing-dot {
    width: 16px;
    height: 16px;
    background-color: #2E8B2E;
    border-radius: 50%;
    display: inline-block;
    position: relative;
    margin-right: 8px;
}

.pulsing-dot::after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-color: #2E8B2E;
    border-radius: 50%;
    animation: cta-pulse 2s infinite;
}

@keyframes cta-pulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(3.5); opacity: 0; }
}

/* Floating button offsets when CTA is active */
body.cta-active .whatsapp-float {
    bottom: 76px !important;
}
body.cta-active .back-to-top {
    bottom: 156px !important;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    #sticky-cta-bar { height: 52px; }
    body.cta-active { padding-bottom: 52px; }
    body.cta-active .whatsapp-float { bottom: 72px !important; }
    body.cta-active .back-to-top { bottom: 142px !important; }
}

/* Print CSS */
@media print {
  header, footer, .whatsapp-float, .back-to-top, .cta-banner, #mobile-nav, button { 
    display: none !important; 
  }
  body { 
    font-size: 12pt; 
    color: #000; 
    background-color: #fff;
    padding-top: 0;
  }
  * {
    color: #000 !important;
    background: transparent !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 90%;
    color: #333 !important;
  }
  .container {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}
