/* Dashboard Container */
.dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Flash Messages */
.flash-notice {
  background-color: #34a853;
  color: white;
  padding: 15px;
  border-radius: 5px;
  margin-bottom: 20px;
  text-align: center;
  font-weight: 500;
}

.flash-alert {
  background-color: #ea4335;
  color: white;
  padding: 15px;
  border-radius: 5px;
  margin-bottom: 20px;
  text-align: center;
  font-weight: 500;
}

/* Header */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e0e0e0;
}

.dashboard-header h1 {
  margin: 0;
  font-size: 2rem;
  color: #333;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Notification Button */
.notification-button {
  padding: 10px 20px;
  background-color: #1a73e8;
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s;
}

.notification-button:hover {
  background-color: #1557b0;
}

.notification-button.enabled {
  background-color: #34a853;
}

.notification-button.enabled:hover {
  background-color: #2d8e47;
}

.notification-button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

/* Logout Button */
.logout-button {
  padding: 10px 20px;
  background-color: #666;
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.3s;
  display: inline-block;
}

.logout-button:hover {
  background-color: #555;
}

/* Current Reading Card */
.current-reading {
  margin-bottom: 40px;
}

.reading-card {
  background: white;
  border-radius: 10px;
  padding: 30px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transition: box-shadow 0.3s;
}

.reading-card.high-co2 {
  border: 3px solid #ea4335;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 2px 10px rgba(234, 67, 53, 0.3);
  }
  50% {
    box-shadow: 0 2px 20px rgba(234, 67, 53, 0.6);
  }
}

/* Alert Banner */
.alert-banner {
  background-color: #ea4335;
  color: white;
  padding: 15px;
  border-radius: 5px;
  margin-bottom: 20px;
  text-align: center;
  font-weight: bold;
}

/* Metrics Display */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.metric {
  text-align: center;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 8px;
}

.metric-label {
  font-size: 0.9rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.metric-value {
  font-size: 3rem;
  font-weight: bold;
  color: #333;
  line-height: 1;
  margin-bottom: 5px;
}

.metric-unit {
  font-size: 1.2rem;
  color: #666;
}

/* CO2 Metric Specific */
.co2-metric {
  background-color: #e8f5e9;
}

.co2-metric.alert {
  background-color: #ffebee;
}

.co2-metric.alert .metric-value {
  color: #ea4335;
}

/* Temperature Metric */
.temperature-metric {
  background-color: #fff3e0;
}

/* Humidity Metric */
.humidity-metric {
  background-color: #e3f2fd;
}

/* Reading Timestamp */
.reading-timestamp {
  text-align: center;
  color: #666;
  font-size: 0.9rem;
  font-style: italic;
}

/* Recent Readings Section */
.recent-readings {
  margin-top: 40px;
}

.recent-readings h2 {
  font-size: 1.5rem;
  color: #333;
  margin-bottom: 20px;
}

/* Readings Table */
.readings-table-wrapper {
  overflow-x: auto;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.readings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.readings-table thead {
  background-color: #f8f9fa;
}

.readings-table th {
  padding: 15px;
  text-align: left;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
}

.readings-table td {
  padding: 15px;
  border-top: 1px solid #e0e0e0;
}

.readings-table tbody tr:hover {
  background-color: #f8f9fa;
}

.high-co2-row {
  background-color: #ffebee;
}

.high-co2-row:hover {
  background-color: #ffcdd2;
}

.alert-value {
  color: #ea4335;
  font-weight: bold;
}

.alert-indicator {
  margin-left: 5px;
}

/* No Data Message */
.no-data {
  text-align: center;
  padding: 40px;
  color: #666;
}

.no-data p {
  margin: 10px 0;
}

.muted {
  font-size: 0.9rem;
  color: #999;
}

/* Responsive Design */
@media (max-width: 768px) {
  .dashboard-header {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
  }

  .dashboard-header h1 {
    font-size: 1.5rem;
  }

  .header-actions {
    flex-direction: column;
  }

  .metrics {
    grid-template-columns: 1fr;
  }

  .metric-value {
    font-size: 2.5rem;
  }

  .readings-table {
    font-size: 0.8rem;
  }

  .readings-table th,
  .readings-table td {
    padding: 10px;
  }
}
