/* styles.css */

/* ************************************************* */
/* *** การตั้งค่าความสูงกราฟแบบ Responsive *** */
#powerChartCanvas {
    height: 200px !important; 
}

@media (min-width: 480px) {
    #powerChartCanvas {
        height: 250px !important;
    }
}

@media (min-width: 780px) {
    #powerChartCanvas {
        height: 300px !important;
    }
}

@media (min-width: 1024px) {
    #powerChartCanvas {
        height: 350px !important;
    }
}

@media (min-width: 1280px) {
    #powerChartCanvas {
        height: 400px !important;
    }
}
/* ************************************************* */

/* Keyframe Animations */
@keyframes pulse-light {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.05); opacity: 1; }
}

@keyframes flicker {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

@keyframes battery-charge {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(1.05); }
}

@keyframes current-flow {
  0% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -20; }
}

/* Animation สำหรับ Aura Effect */
@keyframes flame-aura {
  0% { box-shadow: 0 0 10px rgba(255, 165, 0, 0.5), 0 0 20px rgba(255, 69, 0, 0.3); }
  50% { box-shadow: 0 0 15px rgba(255, 165, 0, 0.8), 0 0 30px rgba(255, 69, 0, 0.5); }
  100% { box-shadow: 0 0 10px rgba(255, 165, 0, 0.5), 0 0 20px rgba(255, 69, 0, 0.3); }
}

/* Custom Utility Classes based on Keyframes */
.animate-pulse-light { animation: pulse-light 1.5s infinite ease-in-out; }
.animate-flicker { animation: flicker 0.5s infinite step-end; }
.animate-battery-charge { animation: battery-charge 2s infinite ease-in-out; }
.animate-current-flow { animation: current-flow 1s linear infinite; }
.animate-flame-aura { animation: flame-aura 2s infinite ease-in-out; } 

/* Custom SVG/Icon/Flow Styles */
.current-path {
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-dasharray: 10 5;
}

/* Planet Icon Styles (Logo) - Responsive */
.planet-icon {
  position: relative;
  width: 32px;
  height: 32px;
}

@media (min-width: 480px) {
  .planet-icon {
    width: 36px;
    height: 36px;
  }
}

@media (min-width: 780px) {
  .planet-icon {
    width: 42px;
    height: 42px;
  }
}

@media (min-width: 1024px) {
  .planet-icon {
    width: 48px;
    height: 48px;
  }
}

.planet-core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFD700, #FFA500); 
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.7);
  z-index: 1;
}

@media (min-width: 480px) {
  .planet-core {
    width: 22px;
    height: 22px;
  }
}

@media (min-width: 780px) {
  .planet-core {
    width: 26px;
    height: 26px;
  }
}

@media (min-width: 1024px) {
  .planet-core {
    width: 32px;
    height: 32px;
  }
}

.planet-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-15deg);
  width: 40px;
  height: 7px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  z-index: 0;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

@media (min-width: 480px) {
  .planet-ring {
    width: 45px;
    height: 8px;
  }
}

@media (min-width: 780px) {
  .planet-ring {
    width: 52px;
    height: 9px;
  }
}

@media (min-width: 1024px) {
  .planet-ring {
    width: 60px;
    height: 10px;
  }
}

.planet-dot {
    position: absolute;
    top: 20%;
    left: 20%;
    width: 4px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    z-index: 2;
}

@media (min-width: 780px) {
  .planet-dot {
    width: 5px;
    height: 5px;
  }
}

@media (min-width: 1024px) {
  .planet-dot {
    width: 6px;
    height: 6px;
  }
}

.planet-dot:nth-child(2) {
    top: 60%;
    left: 70%;
    width: 5px;
    height: 5px;
}

@media (min-width: 780px) {
  .planet-dot:nth-child(2) {
    width: 6px;
    height: 6px;
  }
}

@media (min-width: 1024px) {
  .planet-dot:nth-child(2) {
    width: 8px;
    height: 8px;
  }
}

/* Thermometer fill style */
#thermometer-liquid {
    transform-origin: bottom;
    transition: all 0.5s ease-out;
}

/* Flame effect for temperature - Positioning and visibility - Responsive */
.flame-container {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 50px; 
    height: 50px;
    transform: translate(0%, 20%); 
    opacity: 0; 
    transition: opacity 0.5s ease-in-out;
    z-index: 5; 
    pointer-events: none; 
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 480px) {
  .flame-container {
    width: 55px;
    height: 55px;
  }
}

@media (min-width: 780px) {
  .flame-container {
    width: 60px;
    height: 60px;
  }
}

@media (min-width: 768px) {
  .flame-container {
    width: 70px;
    height: 70px;
  }
}

@media (min-width: 1024px) {
  .flame-container {
    width: 80px;
    height: 80px;
  }
}

.flame-container.active {
    opacity: 1;
}

/* Style for the GIF image */
.flame-gif {
    width: 100%;
    height: 100%;
    object-fit: contain; 
}

/* Aura Effect Styles - Responsive */
.flame-aura-effect {
    position: absolute;
    inset: 0; 
    border-radius: 16px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    z-index: 4; 
}

@media (min-width: 780px) {
  .flame-aura-effect {
    border-radius: 24px;
  }
}

@media (min-width: 1024px) {
  .flame-aura-effect {
    border-radius: 32px;
  }
}

.flame-aura-effect.active {
    opacity: 1;
}