/* CSS Variables for theming */
:root {
  --primary: #1F7A8C;
  --secondary: #0B3C49;
  --accent: #8CC63F;
}

/* Smooth scroll and performance optimizations */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent), var(--primary));
  border-radius: 10px;
}

/* Particle background */
.particles-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}

.particle {
  position: absolute;
  background: rgba(140, 198, 63, 0.1);
  border-radius: 50%;
  animation: float 15s infinite linear;
}

/* Advanced animations */
@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(40px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Section animations */
section {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease;
}

section.visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger-animation > * {
  opacity: 0;
  transform: translateY(20px);
}

/* Card hover effects with 3D transform */
.hover-card {
  transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  transform-style: preserve-3d;
  perspective: 1000px;
}

.hover-card:hover {
  transform: translateY(-15px) rotateX(5deg) rotateY(5deg);
  box-shadow: 
    0 25px 50px -12px rgba(31, 122, 140, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Gradient backgrounds with animation */
.hero-bg {
  background: linear-gradient(-45deg, 
    rgba(224, 247, 250, 0.95) 0%,
    rgba(247, 251, 251, 0.95) 25%,
    rgba(140, 198, 63, 0.05) 50%,
    rgba(31, 122, 140, 0.05) 75%,
    rgba(224, 247, 250, 0.95) 100%);
  background-size: 400% 400%;
  animation: gradientX 15s ease infinite;
  position: relative;
  overflow: hidden;
}

/* Glass morphism effect */
.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-dark {
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Shimmer text effect */
.shimmer-text {
  background: linear-gradient(90deg, 
    var(--primary) 0%, 
    var(--accent) 25%, 
    var(--primary) 50%, 
    var(--accent) 75%, 
    var(--primary) 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: textShimmer 3s infinite;
}

/* Morphing blob */
.morphing-blob {
  animation: morph 10s ease-in-out infinite;
  background: linear-gradient(45deg, var(--primary), var(--accent));
  filter: blur(40px);
  opacity: 0.2;
}

/* Performance optimizations */
.will-change {
  will-change: transform, opacity;
}

/* Loading animation */
@keyframes loaderSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loader {
  border: 3px solid #f3f4f6;
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: loaderSpin 1s linear infinite;
}

/* Parallax effect */
.parallax {
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

/* Gradient border */
.gradient-border {
  position: relative;
  background: white;
  border-radius: 1rem;
}

.gradient-border::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, var(--primary), var(--accent), var(--primary));
  border-radius: 1.1rem;
  z-index: -1;
  animation: gradientX 3s ease infinite;
  background-size: 300% 300%;
}

/* Typewriter effect */
.typewriter {
  overflow: hidden;
  border-right: .15em solid var(--accent);
  white-space: nowrap;
  margin: 0 auto;
  animation: 
    typing 3.5s steps(40, end),
    blink-caret .75s step-end infinite;
}

@keyframes typing {
  from { width: 0 }
  to { width: 100% }
}

@keyframes blink-caret {
  from, to { border-color: transparent }
  50% { border-color: var(--accent); }
}

/* Floating action button */
.fab {
  box-shadow: 0 10px 25px rgba(31, 122, 140, 0.3);
  transition: all 0.3s ease;
}

.fab:hover {
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 15px 30px rgba(31, 122, 140, 0.4);
}

/* --- Header / Mobile Menu Styles --- */
.mobile-nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    position: relative;
}

.mobile-nav-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
    margin: 0 4px;
    flex-shrink: 0;
}

.mobile-nav-circle.active {
    background: rgba(140, 198, 63, 0.3);
    box-shadow: 0 0 0 2px rgba(140, 198, 63, 0.5);
}

.mobile-nav-circle:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}

.mobile-nav-icon {
    font-size: 18px;
    transition: all 0.3s ease;
}

.mobile-nav-circle.active .mobile-nav-icon {
    transform: scale(1.2);
}

.mobile-nav-tooltip {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(11, 60, 73, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
}

.mobile-nav-circle:hover .mobile-nav-tooltip {
    opacity: 1;
    visibility: visible;
    bottom: -25px;
}

.mobile-portals-container {
    position: relative;
}

.mobile-portals-menu {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    width: 180px;
    background: rgba(31, 122, 140, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 100;
    margin-bottom: 15px;
}

.mobile-portals-container.active .mobile-portals-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
}

.portal-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 12px;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.portal-item:last-child {
    margin-bottom: 0;
}

.portal-item:hover {
    background: rgba(140, 198, 63, 0.2);
}

.portal-icon {
    font-size: 16px;
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.portal-text {
    font-size: 12px;
    font-weight: 500;
}

.mobile-contact-cta {
    background: linear-gradient(to right, #8CC63F, #7BB435);
    color: #0B3C49;
    padding: 10px 16px;
    border-radius: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(140, 198, 63, 0.3);
    flex-shrink: 0;
    margin-left: 8px;
    font-size: 12px;
}

.mobile-contact-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(140, 198, 63, 0.4);
}

/* Logo animation */
.logo-container:hover .logo-img {
    transform: scale(1.1) rotate(5deg);
}

.logo-img {
    transition: transform 0.5s ease;
}

/* Navigation divider */
.nav-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 8px;
    flex-shrink: 0;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Mobile-specific adjustments */
@media (max-width: 640px) {
    .mobile-nav-circle {
        width: 40px;
        height: 40px;
        margin: 0 2px;
    }
    
    .mobile-nav-icon {
        font-size: 16px;
    }
    
    .mobile-contact-cta {
        padding: 8px 12px;
        font-size: 11px;
    }
}
