/* Custom CSS for Greempact Website */

/* Theme transition */
html {
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Theme toggle animation */
.theme-icon-sun,
.theme-icon-moon,
.theme-icon-sun-mobile,
.theme-icon-moon-mobile {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.theme-icon-sun:not(.hidden),
.theme-icon-sun-mobile:not(.hidden) {
  animation: rotateIn 0.5s ease;
}

.theme-icon-moon:not(.hidden),
.theme-icon-moon-mobile:not(.hidden) {
  animation: rotateIn 0.5s ease;
}

@keyframes rotateIn {
  from {
    transform: rotate(-180deg);
    opacity: 0;
  }
  to {
    transform: rotate(0deg);
    opacity: 1;
  }
}

/* Custom animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes countUp {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes grid-move {
  0% { 
    transform: translate(0, 0); 
  }
  100% { 
    transform: translate(60px, 60px); 
  }
}

/* Utility classes for animations */
.animate-fadeInUp {
  animation: fadeInUp 0.6s ease-out forwards;
  opacity: 0;
}

.animate-countUp {
  animation: countUp 0.3s ease-out forwards;
}

.animate-grid-move {
  animation: grid-move 20s linear infinite;
}

/* Custom scrollbar styles (if needed) */
.custom-scrollbar::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: hsl(var(--background));
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background-color: hsl(var(--muted-foreground));
  border-radius: 10px;
  border: 2px solid hsl(var(--background));
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background-color: #BEF02F;
}

/* Form input focus states */
.form-input:focus {
  outline: none;
  border-color: #BEF02F;
  box-shadow: 0 0 0 3px rgba(190, 240, 47, 0.2);
}

/* Card hover effects */
.card-hover {
  transition: all 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, #BEF02F 0%, #00B3EB 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Loading animation for forms */
.loading-spinner {
  border: 2px solid #f3f3f3;
  border-top: 2px solid #BEF02F;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Mobile menu enhancements */
#mobile-menu-sheet {
  z-index: 100;
}

#mobile-menu-panel {
  z-index: 101;
}

/* Smooth transitions for mobile menu */
.mobile-nav-link {
  position: relative;
  transition: all 0.2s ease;
}

.mobile-nav-link:hover {
  transform: translateX(4px);
}

/* Mobile menu overlay */
#mobile-menu-overlay {
  transition: opacity 0.3s ease;
}

/* Prevent body scroll when mobile menu is open */
body.overflow-hidden {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

/* Mobile menu animations */
#mobile-menu-panel {
  will-change: transform;
}

#mobile-menu-panel.translate-x-0 {
  transform: translateX(0);
}

#mobile-menu-panel.translate-x-full {
  transform: translateX(100%);
}

/* Hamburger to X animation */
.hamburger-icon,
.close-icon {
  transition: transform 0.2s ease;
}

/* Enhanced mobile nav link styling */
.mobile-nav-link:active {
  transform: translateX(2px);
  background-color: rgba(190, 240, 47, 0.1);
}

/* Responsive utilities */
@media (max-width: 768px) {
  .mobile-menu-open {
    overflow: hidden;
  }
  
  /* Prevent body scroll when mobile menu is open */
  body:has(#mobile-menu-sheet:not(.hidden)) {
    overflow: hidden;
  }
}

/* Header enhancements */
header {
  transition: box-shadow 0.3s ease;
}

header:hover {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dark header:hover {
  box-shadow: 0 1px 3px rgba(255, 255, 255, 0.1);
}

/* Language switcher active state */
button[data-active="true"] {
  position: relative;
}

button[data-active="true"]::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background-color: #BEF02F;
  border-radius: 50%;
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #BEF02F;
  outline-offset: 2px;
  border-radius: 4px;
}

.dark a:focus-visible,
.dark button:focus-visible {
  outline-color: #BEF02F;
}

/* Mobile menu slide transition */
#mobile-menu-sheet > div:last-child {
  will-change: transform;
}

/* Smooth anchor scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Skip to content link for accessibility */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: #BEF02F;
  color: #000000;
  padding: 8px;
  text-decoration: none;
  border-radius: 0 0 4px 0;
  font-weight: bold;
  z-index: 100;
}

.skip-to-content:focus {
  top: 0;
}

/* Scroll-triggered animations */
.scroll-fade-in {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.scroll-fade-in.visible {
  opacity: 1;
}

.scroll-scale-in {
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.6s ease;
}

.scroll-scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

.scroll-slide-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.scroll-slide-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animation for child elements */
[data-stagger] {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
}

[data-stagger].visible {
  opacity: 1;
  transform: translateY(0);
}

/* Enhanced card hover with mouse position */
.card-hover {
  position: relative;
  overflow: hidden;
}

.card-hover::before {
  content: '';
  position: absolute;
  top: var(--mouse-y, 50%);
  left: var(--mouse-x, 50%);
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(190, 240, 47, 0.1) 0%, transparent 70%);
  transition: width 0.6s ease, height 0.6s ease;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.card-hover:hover::before {
  width: 300px;
  height: 300px;
}

/* CO2 counter animation */
.co2-counter {
  position: relative;
}

.co2-counter.animate-pulse {
  animation: pulse-glow 2s ease-in-out;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(190, 240, 47, 0);
  }
  50% {
    box-shadow: 0 0 20px 10px rgba(190, 240, 47, 0.3);
  }
}

/* Parallax section - DISABLED to fix floating form issue */
/* #home {
  will-change: transform;
  transition: transform 0.1s ease-out;
} */

/* Disable animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  #home {
    transform: none !important;
  }
}

/* Hero section containment - FIXED */
#home {
  position: relative;
}

/* Form positioning fix */
#free-analysis {
  position: static !important;
  transform: none !important;
}

/* Hero title highlight fix */
.text-brand-green {
  color: #BEF02F !important;
  -webkit-text-fill-color: #BEF02F !important;
}


