/* Statistics page specific styles */
.filters-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  background-color: white;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  align-items: flex-end;
}

.filter-group {
  flex: 1;
  min-width: 200px;
}

.filter-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text);
  font-size: 0.875rem;
}

.filter-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: white;
  font-size: 0.875rem;
  transition: all 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
}

.filter-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

#apply-filters {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  height: 42px;
}

#apply-filters:hover {
  background-color: var(--primary-dark);
  transform: translateY(-1px);
}

#apply-filters i {
  font-size: 1rem;
}

/* Improve the visibility of custom period inputs */
.custom-period {
  flex: 1;
  min-width: 200px;
  transition: all 0.3s ease;
}

.custom-period input[type="date"] {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: all 0.2s;
}

.custom-period input[type="date"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  outline: none;
}

.stats-overview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stats-overview .stat-card {
  background-color: white;
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  text-align: center;
}

.stats-overview .stat-card h3 {
  font-size: 1rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.stats-overview .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

.charts-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.chart-wrapper {
  background-color: white;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.chart-wrapper h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--dark);
}

canvas {
  width: 100% !important;
  height: 300px !important;
}

.no-data-message {
  background-color: white;
  border-radius: var(--radius-lg);
  padding: 3rem;
  box-shadow: var(--shadow);
  text-align: center;
  margin: 2rem 0;
}

.no-data-content {
  max-width: 500px;
  margin: 0 auto;
}

.no-data-content i {
  font-size: 3rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

.no-data-content h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--dark);
}

.no-data-content p {
  color: var(--text-light);
  line-height: 1.6;
}

/* Dark mode styles */
.dark-mode .filters-container,
.dark-mode .stats-overview .stat-card,
.dark-mode .chart-wrapper,
.dark-mode .no-data-message {
  background-color: var(--dark);
}

.dark-mode .filter-group label {
  color: #e2e8f0;
}

.dark-mode .filter-group select {
  background-color: var(--dark);
  border-color: #475569;
  color: #e2e8f0;
}

.dark-mode .filter-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.dark-mode .stats-overview .stat-card h3 {
  color: #94a3b8;
}

.dark-mode .stats-overview .stat-value {
  color: var(--primary-light);
}

.dark-mode .chart-wrapper h2,
.dark-mode .no-data-content h3 {
  color: #e2e8f0;
}

.dark-mode .no-data-content p {
  color: #94a3b8;
}

/* Dark mode styles for date inputs */
.dark-mode .custom-period input[type="date"] {
  background-color: var(--dark);
  border-color: #475569;
  color: #e2e8f0;
}

.dark-mode .custom-period input[type="date"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Responsive styles */
@media (max-width: 768px) {
  .charts-container {
    grid-template-columns: 1fr;
  }

  .filters-container {
    flex-direction: column;
    gap: 1rem;
  }

  .filter-group {
    width: 100%;
  }

  .btn-primary {
    width: 100%;
    justify-content: center;
  }

  canvas {
    height: 250px !important;
  }
}

/* Add a debug section for troubleshooting */
.debug-section {
  margin-top: 2rem;
  padding: 1rem;
  background-color: #f8fafc;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-family: monospace;
  font-size: 0.875rem;
  display: none;
}

.dark-mode .debug-section {
  background-color: #1e293b;
  border-color: #475569;
  color: #e2e8f0;
}

.habit-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.habit-stat-card {
  background-color: var(--secondary);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.habit-stat-card h3 {
  color: var(--primary);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* Dark mode adjustments */
.dark-mode .habit-stat-card {
  background-color: var(--dark);
}

.dark-mode .habit-stat-card h3 {
  color: var(--primary-light);
}

