:root {
  --primary: #126aef;
  --secondary: #52CF8C;
  --danger: #EE4848;
  --dark: #2A2C2D;
  --light: #F8F8F8;
  --gray: #EAECEF;
  --text: #333333;
}

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

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  text-align: center;
  background-color: #f5f5f5;
  padding: 20px;
  margin: 0;
}

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

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0 20px;
  border-bottom: 1px solid var(--gray);
  margin-bottom: 20px;
}

h1 {
  font-size: 2rem;
  color: var(--dark);
}

h2 {
  margin: 8px;
}

p {
  color: #363636;
  font-size: 16px;
  font-style: normal;
  font-weight: 300;
}

#header-text {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.status-indicator {
  display: flex;
  align-items: center;
}

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

.connected {
  color: var(--secondary);
}

.disconnected {
  color: var(--danger);
}

#connectionStatus {
  font-size: 14px;
  padding: 5px 10px;
  border-radius: 4px;
}

#connectionStatus.connected {
  color: #52CF8C;
}

#connectionStatus.disconnected {
  color: #EE4848;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.stat-card {
  background-color: white;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  text-align: center;
}

.stat-label {
  font-size: 0.9rem;
  color: #777;
  margin-bottom: 5px;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--dark);
}

.chart-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0;
}

.view-toggle {
  display: flex;
  border: 1px solid var(--gray);
  border-radius: 6px;
  overflow: hidden;
}

.toggle-btn {
  background-color: white;
  border: none;
  padding: 8px 15px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.toggle-btn.active {
  background-color: var(--primary);
  color: white;
}

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

.arrow-btn {
  background-color: white;
  border: 1px solid var(--gray);
  border-radius: 4px;
  width: 30px;
  height: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
}

.arrow-btn:hover {
  background-color: var(--gray);
}

#periodLabel {
  font-size: 0.9rem;
  font-weight: 500;
  min-width: 120px;
  text-align: center;
}

.chart-container {
  margin: auto;
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  justify-items: left;
  height: 400px;
}

#proximityChart, #frequencyChart {
  display: none;
}

.note-display {
  background: white;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-top: 20px;
  text-align: center;
}

.note-label {
  font-size: 0.9rem;
  color: #777;
  margin-bottom: 5px;
}

.note-value {
  font-size: 28px;
  font-weight: bold;
  color: #126aef;
  margin: 10px 0;
}

.frequency-value {
  font-size: 18px;
  color: #6E6E6E;
  align-self: flex-end;
}

footer {
  margin-top: 30px;
  text-align: center;
  font-size: 0.8rem;
  color: #777;
  padding: 20px 0;
  border-top: 1px solid var(--gray);
}

.dashboard {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 20px;
  padding-bottom: 20px;
  flex-wrap: wrap;
}

.status-box {
  background: white;
  padding: 10px 20px 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  font-size: 20px;
  font-weight: bold;
  text-align: left;
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
}

.status-box span {
  color: #52CF8C;
  font-size: 24px;
}

.toggle-buttons {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.toggle-buttons button {
  padding: 10px;
  margin: 5px;
  border: none;
  background-color: #ddd;
  cursor: pointer;
  border-radius: 4px;
}

.toggle-buttons button.active {
  background-color: #bbb;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 10px;
  gap: 10px;
}

.pagination button {
  padding: 10px;
  border: none;
  background-color: #ddd;
  cursor: pointer;
  border-radius: 4px;
}

.pagination button:hover {
  background-color: #ccc;
}

#boxes {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 16px;
  flex-wrap: wrap;
  width: 100%;
  margin: auto;
}

.pigeon-status-text {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-weight: 400;
  font-size: 18px;
  align-items: center;
}

.pigeon-status-text span {
  font-weight: bold;
  font-size: 20px;
  color: #363636;
}

.box-header {
  border-bottom: 1px solid #DCDCDC;
  color: #6E6E6E;
  padding-bottom: 16px;
  font-weight: 300;
}

#pigeon-tracker {
  color: #363636;
  font-size: 24px;
  font-weight: 700;
}

.note-container {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 10px;
}

canvas {
  max-height: 300px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .chart-controls {
    flex-direction: column;
    gap: 10px;
  }
  
  .stats-container {
    grid-template-columns: 1fr;
  }
}
