* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background-color: #f5f5f5;
  color: #333;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #ddd;
}

h1 {
  font-size: 1.8rem;
  font-weight: 600;
  color: #2c3e50;
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #ffc107;
  transition: background-color 0.3s;
}

.status.connected .status-dot {
  background-color: #28a745;
}

.status.disconnected .status-dot {
  background-color: #dc3545;
}

.status-text {
  font-size: 0.9rem;
  font-weight: 500;
}

main {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.sensor-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.sensor-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.sensor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.sensor-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2c3e50;
}

.sensor-topic {
  font-size: 0.75rem;
  color: #999;
  font-family: monospace;
}

.sensor-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: #3498db;
  margin-bottom: 16px;
}

.sensor-value .unit {
  font-size: 1.2rem;
  font-weight: 400;
  color: #666;
  margin-left: 4px;
}

.sensor-value.no-data {
  color: #999;
  font-size: 1.5rem;
}

/* Circular tank indicator */
.tank-container {
  display: flex;
  justify-content: center;
  padding: 10px 0;
}

.tank {
  position: relative;
  width: 120px;
  height: 120px;
  border: 4px solid #34495e;
  border-radius: 50%;
  background: #ecf0f1;
  overflow: hidden;
}

.tank-liquid {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(180deg, #3498db, #2980b9);
  transition: height 0.5s ease-out;
}

.tank-liquid.low {
  background: linear-gradient(180deg, #e74c3c, #c0392b);
}

.tank-liquid.medium {
  background: linear-gradient(180deg, #f39c12, #e67e22);
}

.tank-liquid.high {
  background: linear-gradient(180deg, #2ecc71, #27ae60);
}

.tank-reflection {
  position: absolute;
  top: 10%;
  left: 10%;
  width: 30%;
  height: 20%;
  background: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 100%);
  border-radius: 50%;
  pointer-events: none;
}

/* Wave animation */
.tank-liquid::before {
  content: '';
  position: absolute;
  top: -8px;
  left: -50%;
  width: 200%;
  height: 16px;
  background: radial-gradient(ellipse at center, transparent 0%, transparent 40%, currentColor 40%, currentColor 100%);
  background-size: 20px 16px;
  animation: wave 1.5s linear infinite;
  opacity: 0.5;
}

.tank-liquid.low::before {
  color: #e74c3c;
}

.tank-liquid.medium::before {
  color: #f39c12;
}

.tank-liquid.high::before {
  color: #2ecc71;
}

@keyframes wave {
  0% { transform: translateX(0); }
  100% { transform: translateX(20px); }
}

.timestamp {
  margin-top: 12px;
  font-size: 0.75rem;
  color: #999;
  text-align: right;
}

/* Loading state */
.loading {
  text-align: center;
  padding: 40px;
  color: #999;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  header {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .sensor-value {
    font-size: 2rem;
  }
}
