.sensor-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 1rem;
  color: #fff;
  text-align: center;
  position: relative;
}

.sensor-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.sensor-spinner {
  width: 30px;
  height: 30px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.sensor-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.sensor-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.sensor-name {
  font-size: 1.1rem;
  font-weight: 500;
  opacity: 0.9;
}

.sensor-status {
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-weight: 500;
}

.sensor-status.online {
  background: #4CAF50;
  color: #fff;
}

.sensor-status.offline {
  background: #f44336;
  color: #fff;
}

.sensor-value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.3rem;
  margin: 1rem 0;
}

.sensor-value .value {
  font-size: 2.5rem;
  font-weight: bold;
  line-height: 1;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.sensor-value .unit {
  font-size: 1.2rem;
  opacity: 0.8;
  font-weight: 300;
}

.sensor-timestamp {
  font-size: 0.9rem;
  opacity: 0.7;
  margin-top: 0.5rem;
}

.sensor-chart {
  margin-top: 1rem;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

.sensor-chart canvas {
  max-width: 100%;
  height: auto;
}

.sensor-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  color: #ff6b6b;
}

.sensor-error-icon {
  font-size: 2rem;
}

/* Alert styling */
.sensor-value .value.alert-warning {
  color: #FFC107;
  animation: pulse-warning 2s infinite;
}

.sensor-value .value.alert-critical {
  color: #f44336;
  animation: pulse-critical 1s infinite;
}

@keyframes pulse-warning {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes pulse-critical {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Sensor type specific styling */
.sensor-temperature .sensor-value .value {
  color: #FF9800;
}

.sensor-humidity .sensor-value .value {
  color: #2196F3;
}

.sensor-pressure .sensor-value .value {
  color: #9C27B0;
}

.sensor-battery .sensor-value .value {
  color: #4CAF50;
}

.sensor-generic .sensor-value .value {
  color: #fff;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .sensor-value .value {
    font-size: 2rem;
  }
  
  .sensor-value .unit {
    font-size: 1rem;
  }
  
  .sensor-name {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .sensor-value .value {
    font-size: 1.5rem;
  }
  
  .sensor-value .unit {
    font-size: 0.9rem;
  }
  
  .sensor-widget {
    padding: 0.5rem;
  }
}