/* Custom styles for weight tracker */

/* Dark Mode Configuration */
html.dark {
  color-scheme: dark;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.nav-link {
  color: #6b7280;
  border-bottom: 2px solid transparent;
}

.nav-link:hover {
  color: #111827;
  border-bottom-color: #3b82f6;
}

html.dark .nav-link {
  color: #d1d5db;
}

html.dark .nav-link:hover {
  color: #f3f4f6;
  border-bottom-color: #3b82f6;
}

.nav-link.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
}

.page {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

#stats-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  #stats-container {
    grid-template-columns: repeat(3, 1fr);
  }
}

.stat-card {
  color: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.2s ease;
}

html.dark .stat-card {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.stat-value {
  font-size: 28px;
  font-weight: bold;
  margin: 8px 0;
}

.stat-label {
  font-size: 12px;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  font-size: 13px;
  margin-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  padding-top: 12px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
}

.stat-row-label {
  opacity: 0.8;
}

.stat-row-value {
  font-weight: 600;
}

/* Status message styling */
#status-message {
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 16px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

#status-message.success {
  background-color: #d1fae5;
  color: #065f46;
  border-left: 4px solid #10b981;
}

html.dark #status-message.success {
  background-color: #064e3b;
  color: #d1fae5;
  border-left-color: #6ee7b7;
}

#status-message.error {
  background-color: #fee2e2;
  color: #991b1b;
  border-left: 4px solid #ef4444;
}

html.dark #status-message.error {
  background-color: #7f1d1d;
  color: #fecaca;
  border-left-color: #f87171;
}

/* Responsive */
@media (max-width: 640px) {
  .stat-card {
    padding: 16px;
  }

  .stat-value {
    font-size: 24px;
  }

  canvas {
    max-height: 300px !important;
  }
}

/* Chart responsive container */
.chart-container {
  position: relative;
  height: 400px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

@media (max-width: 1024px) {
  .chart-container {
    height: 350px;
  }
}

@media (max-width: 640px) {
  .chart-container {
    height: 300px;
  }
}
