.circuit-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  z-index: 9998;
}

#circuitBackground {
  background-color: rgba(0, 10, 20, 0.95);
  image-rendering: pixelated;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.widget-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  color: white;
  font-family: "Press Start 2P", system-ui;
}

.clock-widget {
  font-size: 4em;
  margin: auto;
}
.date-widget {
  font-size: 3em;
  margin: auto;
}

.cube-widget {
  align-self:flex-start;
  margin-left:1em;
  margin-bottom:1em;
}

.temp-widget {
  border: 2px solid #27b964;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  align-self: flex-end;
  margin-right:1em;
}

#weatherContainer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px;
  max-width: 400px;
  background-color: #2bca6d;
  font-size: 2em;
  background: rgba(0, 0, 0, 0.5);
  padding: 10px;
}

#currentTemp {
  font-size: 3rem;
  font-weight: bold;
  color: #FFF;
}

#hourlyTemps {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 255, 200, 0.3);
  padding: 10px;
  margin-top: 20px;
  box-shadow: 0 0 10px rgba(0, 255, 200, 0.2);
  display: flex;
  justify-content: space-around;
  width: 100%;
  flex-wrap: wrap;
  gap: 10px;
}

#hourlyTemps canvas {
  image-rendering: pixelated;
}

.hourlyItem {
  display: none;
}

.hourlyTime {
  font-size: 0.5rem;
  color:#FFF;
  font-weight: bold;
}

.hourlyTemp {
  font-size: 0.5rem;
  color: #FFF;
}

.cube {
  width: 100px;
  height: 100px;
  background: linear-gradient(to bottom right, #0f0, #090);
  transform-style: preserve-3d;
  animation: spin 5s infinite linear;
}

.cube:before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 10px #0f0;
  animation: flicker 3s infinite alternate;
}

@keyframes spin {
  from {
    transform: rotateX(0deg) rotateY(0deg);
  }
  to {
    transform: rotateX(360deg) rotateY(360deg);
  }
}

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

/* Tablet styles */
@media screen and (max-width: 768px) {
  .clock-widget {
    font-size: 3em;
    margin: 8% 0;
  }

  #currentTemp {
    font-size: 2.5rem;
  }

  .cube-widget {
    margin-left: 0.5em;
  }

  .temp-widget {
    margin-right: 0.5em;
  }

  #weatherContainer {
    max-width: 350px;
    padding: 15px;
  }
}

/* Mobile styles */
@media screen and (max-width: 480px) {
  .widget-container {
    justify-content: space-between;
    padding: 1em;
  }

  .clock-widget {
    font-size: 2em;
    margin: 5% 0;
  }

  #currentTemp {
    font-size: 2rem;
  }

  .cube-widget {
    margin-left: 0.25em;
  }

  .temp-widget {
    margin-right: 0.25em;
  }

  #weatherContainer {
    max-width: 300px;
    padding: 10px;
    font-size: 1.5em;
  }

  /* Adjust metrics display for mobile */
  canvas#circuitBackground {
    font-size: 12px;  /* Base font size for metrics */
  }

  .cube {
    width: 60px;
    height: 60px;
  }
}

/* Very small devices */
@media screen and (max-width: 320px) {
  .clock-widget {
    font-size: 1.5em;
    margin: 3% 0;
  }

  #currentTemp {
    font-size: 1.5rem;
  }

  #weatherContainer {
    max-width: 250px;
    padding: 8px;
    font-size: 1.2em;
  }

  .cube {
    width: 40px;
    height: 40px;
  }
}

/* Handle height-based layout issues */
@media screen and (max-height: 600px) {
  .widget-container {
    justify-content: space-around;
  }

  .clock-widget {
    margin: 0;
  }

  #weatherContainer {
    padding: 5px;
  }
}