/* =========================================
   Solar Savings – Core Stage & Base Glow
   ========================================= */

#solar-stage {
  position: relative;
  z-index: 0;
  margin-top: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 32px;

  /* Variables for Idea 1 */
  --panel-transition-duration: 420ms;
  --panel-pop-duration: 320ms;
  --show-sun-idea1: none; /* toggle to inline-block if you want the sun accent */
  
  /* Variables for Idea 2 */
  --beam-count: 12;
  --counter-duration: 5;
  --counter-interval: 1000;
  --show-sun-idea2: none; /* toggle to inline-block to show */
  
  /* Variables for Idea 3 */
  --card-enter-duration: 450ms;
  --card-opacity-duration: 300ms;
  --sun-rise-duration: 1800ms;
  --sun-rise-delay: 250ms;
}

/* Soft solar glow behind the counter */
#solar-stage::before {
  content: '';
  position: absolute;
  inset: -40px;
  background:
    radial-gradient(
      circle at center,
      rgba(255, 215, 100, 0.25),
      rgba(255, 215, 100, 0) 70%
    );
  z-index: -1;
  pointer-events: none;
  opacity: 0; /* default hidden */
}

#solar-stage.active::before {
  opacity: 1; /* activated glow */
}

/* Extra space ONLY for Sunrise */
#solar-stage.idea3 {
    /* Force the container to have actual height so siblings are pushed down naturally */
    min-height: 250px; 
    margin-bottom: 32px; /* Reset to standard margin */
}

/* =========================================
   Module: Idea 1 – Floating Panel (Static Total)
   ========================================= */

.solar-panel {
  display: flex;
  justify-content: center;
  margin-top: 40px;
  opacity: 0;
  transform: translateY(40px) scale(0.9);
  transition:
    opacity var(--panel-transition-duration, 420ms) ease-out,
    transform var(--panel-transition-duration, 420ms) cubic-bezier(0.2, 0.8, 0.2, 1);
}

.solar-panel.enter {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.solar-panel-inner {
  background: linear-gradient(135deg, #ffffff, #fff9e6);
  border-radius: 16px;
  padding: 26px 36px;
  text-align: center;
  border: 2px solid #ffe08a;
  box-shadow:
    0 12px 26px rgba(0, 0, 0, 0.08),
    0 0 0 4px rgba(255, 220, 120, 0.18);
}

.solar-panel-amount {
  font-size: 2.6rem;
  font-weight: 600;
  color: #333;
  line-height: 1;
}

.solar-panel-amount.settled {
  animation: panel-pop var(--panel-pop-duration, 320ms) ease-out;
}

.solar-panel-caption {
  margin-top: 10px;
  font-size: 0.95rem;
  color: #666;
  font-family: system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Apple Color Emoji", "Segoe UI Emoji",
    "Noto Color Emoji", sans-serif;
}

@keyframes panel-pop {
  0%   { transform: scale(1); }
  60%  { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .solar-panel,
  .solar-panel.enter {
    transition: none;
    transform: none;
  }
  .solar-panel-amount.settled {
    animation: none;
  }
}

/* Optional sun accent toggle for Idea 1 */
.solar-panel-caption .solar-sun {
  display: var(--show-sun-idea1, none);
  width: 22px;
  height: 22px;
  margin-left: 0.5rem;
  vertical-align: middle;
  background: radial-gradient(circle at center, #ffd84d 45%, #ffb700 60%);
  border-radius: 50%;
  box-shadow:
    0 0 0 2px rgba(255, 183, 0, 0.35),
    0 0 6px rgba(255, 183, 0, 0.6);
}

/* Demo controls – shared */
.solar-idea-selector {
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.solar-idea-selector label {
  margin-right: 1.25rem;
  cursor: pointer;
}

#solar-demo-controls {
  margin-bottom: 1rem;
  display: flex;
  gap: 1.5rem;
  align-items: center;
  font-size: 0.95rem;
}

#solar-demo-controls label {
  cursor: pointer;
  user-select: none;
}

/* =========================================
   Idea 1 & 4 – Approval Symbols (CSS Stars)
   ========================================= */

.solar-approval {
  display: flex;
  justify-content: center;
  margin-top: 0.5rem;
  transition: opacity 0.5s ease;
}
/* The new class triggered by the JavaScript */
.solar-approval.fade-out {
  opacity: 0;
}

.solar-approval span {
  width: var(--approval-size, 2rem);
  height: var(--approval-size, 2rem);
  box-shadow: 0 0 4px rgba(0,0,0,0.3);
  background: linear-gradient(
    to bottom,
    #FFF2CC 0%,   /* soft highlight */
    #FFD700 50%,  /* bright gold */
    #E6B800 100%  /* deeper base */
  );
  clip-path: polygon(
    50% 0%,
    61% 35%,
    98% 35%,
    68% 57%,
    79% 91%,
    50% 70%,
    21% 91%,
    32% 57%,
    2% 35%,
    39% 35%
  );
  margin: 0 0.25rem;
  opacity: 0;
  transition: opacity 300ms ease;
}


.solar-approval span.show {
  opacity: 1;
}

/* Responsive tweaks */
@media (max-width: 600px) {
  #solar-stage { --approval-size: 1.5rem; }
}

@media (min-width: 1200px) {
  #solar-stage { --approval-size: 2.5rem; }
}

/* =========================================
   Module: Idea 2 – Animated Counter + Beams
   ========================================= */

.solar-counter {
  position: relative;
  display: inline-block;
  line-height: 1;
  z-index: 1;
  overflow: visible;
  font-size: 2.6rem;
  font-weight: 600;
  padding: 22px 34px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fffbe6, #ffffff);
  border: 2px solid #ffe08a;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.08),
    0 0 0 4px rgba(255, 220, 120, 0.15);
  color: #333;
  text-align: center;
  min-width: 260px;
}

.solar-caption {
  margin-top: 10px;
  font-size: 0.95rem;
  color: #666;
  text-align: center;
  font-family: system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Apple Color Emoji", "Segoe UI Emoji",
    "Noto Color Emoji", sans-serif;
}

/* Optional sun accent toggle for Idea 2 (independent) */
.solar-caption .solar-sun {
  display: var(--show-sun-idea2, none);
  width: 22px;
  height: 22px;
  margin-left: 0.5rem;
  vertical-align: middle;
  background: radial-gradient(circle at center, #ffd84d 45%, #ffb700 60%);
  border-radius: 50%;
  box-shadow:
    0 0 0 2px rgba(255, 183, 0, 0.35),
    0 0 6px rgba(255, 183, 0, 0.6);
}

.solar-settled {
  animation: solar-pop 320ms ease-out;
}

@keyframes solar-pop {
  0%   { transform: scale(1); }
  60%  { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .solar-settled { animation: none; }
}

/* Beams container anchored to the counter area */
.solar-beams {
  position: absolute;
  top: calc(50% - 72px);
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  z-index: 0;
  pointer-events: none;
}

.solar-beam {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin-top: -120px;
  width: 8px;
  height: 400px;
  background: linear-gradient(
    to top,
    rgba(255, 215, 100, 0),
    rgba(255, 215, 100, 0.9),
    rgba(255, 255, 100, 0.9),
    rgba(255, 215, 100, 0.3)
  );
  transform-origin: center center;
  opacity: 1;
}

.solar-beams.animate .solar-beam {
  animation: beam-grow 5s ease-out forwards;
}

@keyframes beam-grow {
  0%   { transform: rotate(var(--angle)) scaleY(0.2); opacity: 0; }
  20%  { transform: rotate(var(--angle)) scaleY(1.2); opacity: 1; }
  80%  { transform: rotate(var(--angle)) scaleY(1.2); opacity: 1; }
  100% { transform: rotate(var(--angle)) scaleY(1.2); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .solar-beams.animate .solar-beam {
    animation: none;
    opacity: 0.4;
  }
}

/* Responsive overrides (keep variables scoped to #solar-stage) */
@media (max-width: 1024px) {
  #solar-stage {
    --beam-count: 10;
    --counter-duration: 4;
  }
  .solar-counter {
    font-size: 2.2rem;
    padding: 18px 28px;
    min-width: 220px;
  }
  .solar-beams {
    width: 400px;
    height: 400px;
    top: calc(50% - (400px * 0.15));
  }
  .solar-beam {
    height: 280px;
    width: 6px;
    margin-top: calc(-0.33 * 280px);
  }
}

@media (max-width: 600px) {
  #solar-stage {
    --beam-count: 8;
    --counter-duration: 3.2;
    --counter-interval: 800;
  }
  .solar-counter {
    font-size: 1.8rem;
    padding: 14px 22px;
    min-width: 180px;
  }
  .solar-caption { font-size: 0.85rem; }
  .solar-beams {
    width: 260px;
    height: 260px;
    top: calc(50% - (260px * 0.15));
  }
  .solar-beam {
    height: 180px;
    width: 5px;
    margin-top: calc(-0.33 * 180px);
  }
}

/* =========================================
   Module: Idea 3 – Featured Total Card
   ========================================= */

/* Overlay */

.solar-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: transparent; /* changed from rgba(0, 0, 0, 0.04); */
  opacity: 0;
  transition: opacity var(--card-opacity-duration, 300ms) ease;
  z-index: 9999;
}

.solar-overlay.visible {
  opacity: 1;
}

/* Card positioning & entrance */

.solar-card {
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, 120px) scale(0.97);
  opacity: 0;
  transition:
    transform var(--card-enter-duration, 450ms)
      cubic-bezier(.2,.8,.2,1),
    opacity var(--card-opacity-duration, 300ms) ease;
}

.solar-card.dragging {
  cursor: grabbing;
}

.solar-card.enter {
  transform: translate(-50%, 0) scale(1);
  opacity: 1;
}

/* Card surface */

.solar-card-inner {
  background: linear-gradient(180deg, #fff9e6, #ffffff);
  border-radius: 18px;
  padding: 1.75rem 2.25rem;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
  text-align: center;
  max-width: 90vw;
}

/* Amount & caption */

.solar-card-amount {
  font-size: 2.4rem;
  font-weight: 600;
  color: #7a5c00;
  margin-bottom: 0.35rem;
}

.solar-card-caption {
  font-size: 0.95rem;
  color: #555;
}

/* =========================================
   Sunrise Accent
   ========================================= */

/* Horizon window: clips the sun only */
.solar-card-horizon {
  position: relative;
  width: 60px;
  height: 52px;           /* >= sun size */
  margin: 0 auto 0.85rem;
  overflow: hidden;       /* clip the sun */
}

/* Sun: rises from below horizon */
.solar-card-sun {
  position: relative;
  left: 50%;
  bottom: -18px;          /* initial partial exposure */
  width: 52px;
  height: 52px;
  transform: translateX(-50%);
  background: radial-gradient(circle, #ffd84d 45%, #ffb700 65%);
  border-radius: 50%;
  z-index: 1;
  animation: solar-sun-rise
    var(--sun-rise-duration, 1800ms)
    cubic-bezier(.25,.6,.25,1)
    var(--sun-rise-delay, 250ms)
    forwards;
}

/* Rim burst: attached to the card, not clipped */
.solar-card::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 52px;              /* align with sun center */
  width: 52px;
  height: 52px;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(1);
  /* golden glow gradient */
  background: radial-gradient(
    circle,
    rgba(255, 220, 120, 0.9) 0%, 
    rgba(255, 180, 0, 0.5) 45%, 
    rgba(255, 160, 0, 0) 80%  
  );
  opacity: 0;
  z-index: 10000;         /* above everything */
  pointer-events: none;
}

.solar-card.settled::after {
  animation: solar-rim-burst 1200ms ease-out forwards;
}

@keyframes solar-rim-burst {
  from {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(3);
  }
}

/* Sun rise + gentle shadow ramp */
@keyframes solar-sun-rise {
  from {
    bottom: -18px;
    box-shadow: 0 0 10px rgba(255, 200, 0, 0.35); /* softer glow at start */
    filter: brightness(1.0);                      /* fixed brightness */
  }
  to {
    bottom: 0;
    box-shadow: 0 0 18px rgba(255, 200, 0, 0.55); /* slightly stronger glow */
    filter: brightness(1.0);                      /* no pulsing */
  }
}


/* Bit for solar-controller.js to get two checkboxes to align */
#solar-table-controls {
    display: flex;
    flex-direction: column;
    gap: 8px; /* optional spacing */
	margin-top: 40px;
}

#solar-table-controls label {
	display: block;
    margin: 0; /* ensures perfect alignment */
}
