/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Dashboard styles */
.dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.dashboard-title {
  text-align: center;
  margin-bottom: 40px;
}

.year-summary,
.latest-reading {
  margin-bottom: 30px;
}

.section-title {
  margin-bottom: 20px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.metric-card {
  color: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.metric-card--current-charge {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.metric-card--exported {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.metric-card--imported-battery {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.metric-card--imported-grid {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.metric-card--charge-green {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.metric-card--exported-orange {
  background: linear-gradient(135deg, #fc4a1a 0%, #f7b733 100%);
}

.metric-card--imported-purple {
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
}

.metric-card--imported-red {
  background: linear-gradient(135deg, #ee0979 0%, #ff6a00 100%);
}

.metric-label {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 10px;
}

.metric-value {
  font-size: 36px;
  font-weight: bold;
  margin-bottom: 5px;
}

.metric-unit {
  font-size: 14px;
  opacity: 0.8;
}

.no-data {
  background: #fff3cd;
  color: #856404;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #ffeaa7;
}

.no-data p {
  margin: 0;
}

.burndown-chart {
  margin-bottom: 30px;
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.burndown-chart .chart-wrapper {
  position: relative;
  height: 350px;
}

@media (max-width: 600px) {
  .burndown-chart {
    padding: 12px;
  }

  .burndown-chart .chart-wrapper {
    height: 320px;
  }

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

/* Readings section */
.readings-section {
  margin-bottom: 30px;
}

.readings-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0;
}

.readings-tab {
  padding: 10px 20px;
  text-decoration: none;
  color: #64748b;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
}

.readings-tab:hover {
  color: #334155;
  border-bottom-color: #cbd5e1;
}

.readings-tab--active {
  color: #667eea;
  border-bottom-color: #667eea;
}

.readings-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.readings-table th,
.readings-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.readings-table th {
  background: #f8fafc;
  font-weight: 600;
  color: #475569;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.readings-table td {
  color: #334155;
}

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

.readings-table tbody tr:last-child td {
  border-bottom: none;
}

.text-right {
  text-align: right !important;
}

.readings-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
}

.pagination-spacer {
  flex: 1;
}

.pagination-link {
  padding: 8px 16px;
  background: #667eea;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
}

.pagination-link:hover {
  background: #5a6fd6;
}

@media (max-width: 600px) {
  .readings-table th,
  .readings-table td {
    padding: 8px 10px;
    font-size: 13px;
  }

  .readings-tabs {
    gap: 0;
  }

  .readings-tab {
    padding: 8px 12px;
    font-size: 14px;
  }
}
