/* CryptoVoltGrid - Optimized Styles */
/* Critical CSS is inlined in HTML, this file contains non-critical styles */

/* Mobile Menu Styles */
#mobileMenu {
  transition: all 0.3s ease-in-out;
  max-height: 0;
  overflow: hidden;
}

#mobileMenu:not(.hidden) {
  max-height: 500px;
}

/* Crypto Token Animation */
.crypto-token {
  animation: float 6s ease-in-out infinite;
  will-change: transform;
  backface-visibility: hidden;
}

.crypto-token:nth-child(2n) { animation-delay: -1s; }
.crypto-token:nth-child(3n) { animation-delay: -2s; }
.crypto-token:nth-child(4n) { animation-delay: -3s; }
.crypto-token:nth-child(5n) { animation-delay: -4s; }

@keyframes float {
  0%, 100% { transform: translate3d(0, 0px, 0) scale(1); }
  25% { transform: translate3d(0, -8px, 0) scale(1.05); }
  50% { transform: translate3d(0, -4px, 0) scale(1.02); }
  75% { transform: translate3d(0, -12px, 0) scale(1.08); }
}

/* Cookie Consent Styles */
.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.95);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 1px solid #334155;
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 0.3s ease-in-out;
  padding: 1rem;
}

.cookie-consent.show {
  transform: translateY(0);
}

.cookie-settings-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease-in-out;
}

.cookie-settings-modal.show {
  opacity: 1;
  visibility: visible;
}

.cookie-settings-content {
  background: #1e293b;
  border-radius: 0.75rem;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s ease-in-out;
}

.cookie-settings-modal.show .cookie-settings-content {
  transform: scale(1);
}

/* Performance optimizations */
.feature-card,
.step-card,
.calculator-card {
  contain: layout style paint;
}

/* Reduce layout shifts */
.hero-section {
  min-height: 100vh;
  contain: layout;
}

/* Optimize images */
img {
  max-width: 100%;
  height: auto;
  loading: lazy;
}

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

/* Grid layout optimizations */
.grid-layout {
  display: grid;
  gap: 1rem;
  contain: layout;
}

/* Form optimizations */
.form-group {
  contain: layout style;
}

/* Button optimizations */
.glow-btn {
  contain: layout style paint;
  transform: translateZ(0); /* Force hardware acceleration */
}

/* Text rendering optimizations */
body {
  text-rendering: optimizeSpeed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scrolling optimizations */
.scroll-container {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Reduce paint complexity */
.complex-bg {
  will-change: transform;
  transform: translateZ(0);
}

/* Optimize table rendering */
.data-table {
  table-layout: fixed;
  contain: layout style;
}

/* Loading states */
.loading-skeleton {
  background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Responsive optimizations */
@media (max-width: 768px) {
  .mobile-optimize {
    contain: layout style;
  }
  
  /* Reduce complexity on mobile */
  .crypto-token {
    animation: none;
  }
  
  /* Simplify gradients on mobile */
  .gradient {
    background: #0f172a;
  }
}

/* Print styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .glow-btn {
    box-shadow: none;
    border: 2px solid currentColor;
  }
}

/* Dark mode optimizations */
@media (prefers-color-scheme: dark) {
  /* Already optimized for dark mode */
}

/* Focus management */
.focus-visible {
  outline: 2px solid #06b6d4;
  outline-offset: 2px;
}

/* Intersection observer optimizations */
.lazy-load {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.lazy-load.loaded {
  opacity: 1;
  transform: translateY(0);
}

/* Critical resource hints */
.preload-hint {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* Optimize font loading */
@font-face {
  font-family: 'Inter';
  font-display: swap;
  src: local('Inter');
}

/* Container queries support */
@supports (container-type: inline-size) {
  .responsive-container {
    container-type: inline-size;
  }
}

/* Modern CSS features */
@supports (backdrop-filter: blur(10px)) {
  .modern-blur {
    backdrop-filter: blur(10px);
  }
}

/* Accessibility improvements */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Performance monitoring */
.perf-mark {
  contain: strict;
  content-visibility: auto;
}
