@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #e0e7ff;
  --success: #10b981;
  --success-dark: #059669;
  --success-light: #ecfdf5;
  --info: #0ea5e9;
  --info-dark: #0284c7;
  --info-light: #f0f9ff;
  --warning: #f59e0b;
  --warning-dark: #d97706;
  --warning-light: #fffbeb;
  --error: #ef4444;
  --background: #f8fafc;
  --surface: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

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

body {
  background-color: var(--background);
  color: var(--text-main);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  padding: 2rem 1rem;
}

.dashboard-container {
  max-width: 1400px;
  margin: 0 auto;
}

header {
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

h1 {
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.025em;
}

.refresh-date {
  font-size: 0.875rem;
  color: var(--text-muted);
  background: var(--surface);
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

/* Info Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stat-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-main);
}

.stat-card.primary { border-left: 4px solid var(--primary); }
.stat-card.success { border-left: 4px solid var(--success); }
.stat-card.info { border-left: 4px solid var(--info); }
.stat-card.warning { border-left: 4px solid var(--warning); }
.stat-card.accent { border-left: 4px solid #a855f7; }

.stat-card.primary .stat-label { color: var(--primary-dark); }
.stat-card.success .stat-label { color: var(--success-dark); }
.stat-card.info .stat-label { color: var(--info-dark); }
.stat-card.warning .stat-label { color: var(--warning-dark); }

/* Controls */
.controls-section {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: 1rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: flex-end;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

select {
  appearance: none;
  background-color: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.625rem 2.5rem 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1.25rem;
  transition: all 0.2s;
}

select:focus {
  outline: none;
  border-color: var(--primary);
  ring: 2px solid var(--primary-light);
  background-color: var(--surface);
}

/* Graphs */
.graph-section {
  background: var(--surface);
  padding: 2rem;
  border-radius: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.graph-header {
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.graph-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.graph-filters {
  display: flex;
  gap: 1rem;
}

canvas {
  width: 100% !important;
  max-height: 450px;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.5s ease forwards;
}

/* Responsive */
@media (max-width: 768px) {
  .controls-section {
    flex-direction: column;
    align-items: stretch;
  }
  
  .graph-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}
