:root {
  --live-nav-height: 72px;
  --live-footer-height: 60px;
}

@media (max-width: 768px) {
  :root {
    --live-nav-height: auto;
  }

  body {
    overflow-y: auto !important;
  }
}

.live-viewport {
  min-height: calc(100vh - var(--live-nav-height) - var(--live-footer-height));
  display: flex;
  flex-direction: column;
  background: linear-gradient(to bottom, #f0fdf4, #e0f2fe);
}

@media (max-width: 768px) {
  .live-viewport {
    min-height: auto;
  }
}

@supports (height: 100svh) {
  .live-viewport {
    min-height: calc(100svh - var(--live-nav-height) - var(--live-footer-height));
  }

  @media (max-width: 768px) {
    .live-viewport {
      min-height: auto;
    }
  }
}

@supports (height: 100dvh) {
  .live-viewport {
    min-height: calc(100dvh - var(--live-nav-height) - var(--live-footer-height));
  }

  @media (max-width: 768px) {
    .live-viewport {
      min-height: auto;
    }
  }
}

.live-main-content {
  flex: 1 1 auto;
  display: flex;
  align-items: stretch;
  position: relative;
}

@media (max-width: 768px) {
  .live-main-content {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

.live-columns {
  display: flex;
  gap: clamp(1rem, 2.5vw, 2rem);
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: clamp(1rem, 2.5vw, 2rem) clamp(0.75rem, 2vw, 1.5rem);
  position: relative;
  z-index: 1;
}

@media (max-width: 768px) {
  .live-columns {
    flex-direction: column;
    padding: 1rem 0.75rem;
    gap: 1rem;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .live-columns {
    flex-direction: column;
    gap: 1.5rem;
  }
}

.live-col-emission {
  flex: 0 0 auto;
  width: 100%;
}

@media (min-width: 1025px) {
  .live-col-emission {
    flex: 1 1 45%;
    max-width: 520px;
  }
}

.live-col-advice {
  flex: 1 1 auto;
  min-width: 0;
}

.emission-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(34, 197, 94, 0.95), rgba(16, 185, 129, 0.92), rgba(5, 150, 105, 0.94));
  border-radius: 2rem;
  padding: clamp(1.25rem, 2.5vw, 2rem);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  color: white;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

@media (max-width: 640px) {
  .emission-card {
    border-radius: 1.5rem;
    padding: 1.25rem;
  }
}

.emission-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, transparent, rgba(255, 255, 255, 0.08), transparent 60deg, transparent 120deg, rgba(255, 255, 255, 0.08), transparent 180deg, transparent 240deg, rgba(255, 255, 255, 0.08), transparent 300deg, transparent);
  animation: rotate-conic 10s linear infinite;
  pointer-events: none;
}

@keyframes rotate-conic {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.floating-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  animation: float-particle 8s ease-in-out infinite;
}

.particle:nth-child(1) {
  width: 5px;
  height: 5px;
  top: 15%;
  left: 12%;
  animation-delay: 0s;
}

.particle:nth-child(2) {
  width: 7px;
  height: 7px;
  top: 55%;
  left: 75%;
  animation-delay: 2.5s;
}

.particle:nth-child(3) {
  width: 4px;
  height: 4px;
  top: 35%;
  left: 55%;
  animation-delay: 5s;
}

.particle:nth-child(4) {
  width: 6px;
  height: 6px;
  top: 75%;
  left: 25%;
  animation-delay: 1.5s;
}

.particle:nth-child(5) {
  width: 5px;
  height: 5px;
  top: 12%;
  left: 65%;
  animation-delay: 4s;
}

@keyframes float-particle {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
    opacity: 0.4;
  }

  50% {
    transform: translateY(-25px) rotate(180deg);
    opacity: 0.9;
  }
}

.emission-header {
  position: relative;
  z-index: 2;
}

.emission-value {
  font-size: clamp(3rem, 8vw, 4.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
}

.change-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

.gci-bar-container {
  position: relative;
  width: 100%;
  height: 2rem;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 9999px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) inset;
}

.gci-bar-fill {
  height: 100%;
  color: var(--gci-color, #047857);
  background-color: currentColor;
  border-radius: 9999px;
  box-shadow: 0 10px 24px -12px currentColor;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1), color 0.5s ease;
  position: relative;
}

.gci-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shimmer 2.5s infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }

  100% {
    left: 100%;
  }
}

.gci-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  color: rgba(0, 0, 0, 0.8);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
  pointer-events: none;
}

.gen-mix-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.gen-box {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: 1rem;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gen-box:hover {
  transform: translateY(-2px) scale(1.02);
  background: rgba(255, 255, 255, 0.22);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  animation: pulse-glow 2s ease-in-out infinite alternate;
}

.status-badge.status-low {
  background: rgba(16, 185, 129, 0.3);
  color: #d1fae5;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
}

.status-badge.status-moderate {
  background: rgba(251, 191, 36, 0.3);
  color: #fef3c7;
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.6);
}

.status-badge.status-high {
  background: rgba(239, 68, 68, 0.3);
  color: #fee2e2;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
}

@keyframes pulse-glow {
  0% {
    box-shadow: 0 0 10px currentColor;
  }

  100% {
    box-shadow: 0 0 25px currentColor, 0 0 40px currentColor;
  }
}

.pulse-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
  animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(1.3);
  }
}

.advice-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  height: 100%;
}

.advice-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.92));
  border-radius: 1.5rem;
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
  border: 1px solid rgba(203, 213, 225, 0.5);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

@media (max-width: 640px) {
  .advice-card {
    border-radius: 1.25rem;
    padding: 1rem;
  }
}

.advice-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #10b981, #3b82f6, #8b5cf6);
  opacity: 0;
  transition: opacity 0.3s;
}

.advice-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.9) inset;
}

.advice-card:hover::before {
  opacity: 1;
}

.advice-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1e40af;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.metric-box {
  background: rgba(241, 245, 249, 0.6);
  border-radius: 0.75rem;
  padding: 0.875rem;
  border: 1px solid rgba(203, 213, 225, 0.4);
}

/* Gallery Styles */
.advice-gallery {
  position: relative;
}

.gallery-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

@media (max-width: 640px) {
  .gallery-nav {
    gap: 0.5rem;
    margin-bottom: 0.75rem;
  }
}

.gallery-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
  color: #4b5563;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  font-size: 0.875rem;
}

@media (max-width: 640px) {
  .gallery-btn {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
  }
}

.gallery-btn:hover {
  background: linear-gradient(135deg, #e5e7eb, #d1d5db);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.gallery-btn:active {
  transform: scale(0.95);
}

.gallery-btn.gallery-pause.playing i::before {
  content: "\f04d";
}

.gallery-counter {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #6b7280;
  min-width: 60px;
  justify-content: center;
}

@media (max-width: 640px) {
  .gallery-counter {
    font-size: 0.75rem;
    gap: 0.25rem;
    min-width: 50px;
  }
}

.current-slide {
  font-size: 1.125rem;
  color: #1f2937;
}

@media (max-width: 640px) {
  .current-slide {
    font-size: 1rem;
  }
}

.gallery-progress {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1.25rem;
}

@media (max-width: 640px) {
  .gallery-progress {
    gap: 0.375rem;
    margin-bottom: 1rem;
  }
}

.progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d1d5db;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}

@media (max-width: 640px) {
  .progress-dot {
    width: 6px;
    height: 6px;
  }
}

.progress-dot.active {
  width: 24px;
  border-radius: 4px;
  background: linear-gradient(90deg, #10b981, #3b82f6);
}

@media (max-width: 640px) {
  .progress-dot.active {
    width: 18px;
  }
}

.progress-dot.active::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: inherit;
  opacity: 0.3;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.3;
  }

  50% {
    transform: scale(1.5);
    opacity: 0;
  }
}

.gallery-slides {
  position: relative;
  min-height: 350px;
}

@media (max-width: 768px) {
  .gallery-slides {
    min-height: auto;
  }
}

@media (max-width: 640px) {
  .gallery-slides {
    min-height: auto;
  }
}

.gallery-slide {
  opacity: 0;
  transform: translateX(30px) scale(0.95);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

@media (min-width: 769px) {
  .gallery-slide {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
  }
}

@media (max-width: 768px) {
  .gallery-slide {
    display: none;
  }

  .gallery-slide.active {
    display: block;
  }
}

.gallery-slide.active {
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: auto;
}

.advice-illustration {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.advice-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.08));
}

.advice-icon-fallback {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.18) 0%, rgba(147, 197, 253, 0.12) 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1d4ed8;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.advice-icon-fallback i {
  font-size: 1rem;
}

.advice-content {
  flex: 1;
}

/* SVG Animations */
@keyframes battery-charge {
  0%,
  100% {
    opacity: 0.3;
  }

  50% {
    opacity: 1;
  }
}

@keyframes bolt-flash {
  0%,
  100% {
    opacity: 0.8;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

@keyframes load-draw {
  from {
    stroke-dashoffset: 400;
  }

  to {
    stroke-dashoffset: 0;
  }
}

@keyframes ring-rotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes star-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.15);
    opacity: 0.8;
  }
}

@keyframes float-particle {
  0%,
  100% {
    transform: translateY(0) translateX(0);
  }

  33% {
    transform: translateY(-10px) translateX(5px);
  }

  66% {
    transform: translateY(-5px) translateX(-5px);
  }
}

.battery-body {
  animation: battery-charge 2s ease-in-out infinite;
}

.battery-bolt {
  animation: bolt-flash 1.5s ease-in-out infinite;
  transform-origin: center;
}

.load-chart {
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: load-draw 2s ease-out forwards;
}

.load-point {
  animation: star-pulse 2s ease-in-out infinite;
}

.shift-arrow {
  animation: float-particle 3s ease-in-out infinite;
}

.opt-ring {
  transform-origin: center;
  animation: ring-rotate 8s linear infinite;
}

.opt-star {
  animation: star-pulse 2s ease-in-out infinite;
  transform-origin: center;
}

.float-particle {
  animation: float-particle 4s ease-in-out infinite;
}

.float-particle.p2 {
  animation-delay: 0.5s;
}

.float-particle.p3 {
  animation-delay: 1s;
}

/* Savings Section */
.savings-section {
  background: linear-gradient(135deg, rgba(240, 253, 244, 0.8), rgba(220, 252, 231, 0.6));
  border-radius: 0.875rem;
  padding: 0.875rem;
  margin-bottom: 0.875rem;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.savings-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

@media (max-width: 640px) {
  .savings-grid {
    grid-template-columns: 1fr;
    gap: 0.625rem;
  }
}

.savings-metric {
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
}

.savings-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.savings-details {
  flex: 1;
}

.savings-section h4 {
  font-size: 0.8125rem;
  margin-bottom: 0.625rem !important;
}

.savings-bar {
  width: 100%;
  height: 4px;
  background: rgba(209, 213, 219, 0.4);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 0.375rem;
}

.savings-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #059669);
  border-radius: 3px;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  animation: shimmer-opacity 2s ease-in-out infinite;
}

@keyframes shimmer-opacity {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.8;
  }
}

/* Metrics Detailed */
.metrics-detailed {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

@media (max-width: 640px) {
  .metrics-detailed {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .metrics-detailed {
    grid-template-columns: 1fr;
  }
}

.metric-detailed {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(249, 250, 251, 0.7));
  border-radius: 0.625rem;
  padding: 0.75rem;
  border: 1px solid rgba(209, 213, 219, 0.4);
  transition: all 0.3s;
}

.metric-detailed:hover {
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.metric-label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  margin-bottom: 0.375rem;
}

.metric-label i {
  font-size: 0.75rem;
}

.metric-value {
  font-size: 0.875rem;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.3;
}

/* CTA Schedule Button */
.cta-schedule-button {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
  border-radius: 16px;
  text-decoration: none;
  color: white;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  position: relative;
  overflow: hidden;
  margin-top: 1.5rem;
}

.cta-schedule-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.cta-schedule-button:hover::before {
  left: 100%;
}

.cta-schedule-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4), 0 0 30px rgba(59, 130, 246, 0.3);
}

.cta-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  opacity: 0.9;
}

.cta-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cta-main {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

.cta-sub {
  font-size: 0.875rem;
  opacity: 0.9;
  font-weight: 400;
}

.cta-arrow {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  opacity: 0.8;
  transition: transform 0.3s ease;
}

.cta-schedule-button:hover .cta-arrow {
  transform: translateX(4px);
}

/* Loader Styles */
.live-loader {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.live-loader-icon {
  width: 5rem;
  height: 5rem;
}

.breathing {
  animation: breathing 2s ease-in-out infinite;
}

/* Loading Animation */
@keyframes breathing {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

@media (max-width: 640px) {
  .emission-value {
    font-size: 2.5rem;
  }

  .gen-mix-grid {
    grid-template-columns: 1fr;
  }

  .live-columns {
    padding: 1rem 0.75rem;
  }

  .advice-illustration {
    width: 36px;
    height: 36px;
  }

  .cta-schedule-button {
    padding: 1rem 1.25rem;
  }

  .cta-main {
    font-size: 0.9rem;
  }

  .cta-sub {
    font-size: 0.8rem;
  }

  .savings-metric {
    gap: 0.5rem;
  }

  .savings-icon {
    width: 32px;
    height: 32px;
    font-size: 0.875rem;
  }
}

@media (max-width: 480px) {
  .cta-schedule-button {
    flex-direction: column;
    text-align: center;
    padding: 1rem;
    gap: 0.75rem;
  }

  .cta-text {
    align-items: center;
  }

  .cta-arrow {
    transform: rotate(90deg);
  }

  .cta-schedule-button:hover .cta-arrow {
    transform: rotate(90deg) translateX(4px);
  }
}
