// ========================================
// 🎨 TOLLPARKING DASHBOARD STYLES
// ========================================

.tollparking-dashboard {
  padding: 24px;
  background: var(--background);
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

// ========================================
// 📱 HEADER
// ========================================

.dashboard-header {
  text-align: center;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--divider);
}

.dashboard-title {
  margin: 0 0 8px 0;
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;

  i {
    color: #FF6B6B;
    font-size: 28px;
  }
}

.dashboard-subtitle {
  margin: 0;
  font-size: 16px;
  color: var(--text-secondary);
  font-weight: 400;
}

// ========================================
// 🔄 LOADING STATE
// ========================================

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;

  .loading-spinner {
    margin-bottom: 16px;
    
    i {
      font-size: 48px;
      color: var(--idt-primary-color);
    }
  }

  p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 16px;
  }
}

// ========================================
// 📊 KPIS SECTION
// ========================================

.kpis-section {
  margin-bottom: 48px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--divider);

  h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;

    i {
      color: var(--idt-primary-color);
      font-size: 18px;
    }
  }

  .section-info {
    font-size: 14px;
    color: var(--text-secondary);
    font-style: italic;
  }
}

.kpis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;

  &:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
  }

  &.kpi-primary { border-left: 4px solid var(--idt-primary-color); }
  &.kpi-success { border-left: 4px solid #27AE60; }
  &.kpi-warning { border-left: 4px solid #F39C12; }
  &.kpi-danger { border-left: 4px solid #E74C3C; }
  &.kpi-info { border-left: 4px solid #3498DB; }
}

.kpi-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(var(--idt-primary-rgb), 0.1), rgba(var(--idt-primary-rgb), 0.2));
  flex-shrink: 0;

  i {
    font-size: 24px;
    color: var(--idt-primary-color);
  }
}

.kpi-content {
  flex: 1;

  .kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1;
  }

  .kpi-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
  }

  .kpi-description {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.3;
  }
}

// ========================================
// 🏆 TOP VEHICLES SECTION
// ========================================

.top-vehicles-section {
  margin-bottom: 48px;
}

.top-vehicles-chart {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 16px;
  overflow: hidden;
}

.vehicle-bar {
  display: flex;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--divider);
  transition: background-color 0.2s ease;

  &:last-child {
    border-bottom: none;
  }

  &:hover {
    background: var(--hover-bg);
  }
}

.vehicle-info {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.vehicle-rank {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #FF6B6B, #FF5252);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.vehicle-details {
  flex: 1;
  min-width: 0;

  .vehicle-plate {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
  }

  .vehicle-stats {
    font-size: 12px;
    color: var(--text-secondary);
  }
}

.vehicle-value {
  text-align: right;
  min-width: 140px;
  position: relative;

  .value-amount {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
  }

  .value-bar {
    height: 6px;
    background: linear-gradient(90deg, #FF6B6B, #FF5252);
    border-radius: 3px;
    transition: width 0.8s ease;
  }
}

// ========================================
// 📈 MONTHLY EVOLUTION SECTION
// ========================================

.monthly-evolution-section {
  margin-bottom: 48px;
}

.monthly-chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.month-bar {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 16px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;

  &:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  }
}

.month-header {
  text-align: center;
  margin-bottom: 20px;

  .month-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    text-transform: capitalize;
  }

  .month-value {
    font-size: 24px;
    font-weight: 700;
    color: #27AE60;
  }
}

.month-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;

  .metric {
    text-align: center;
    padding: 12px;
    background: var(--hover-bg);
    border-radius: 8px;

    .metric-label {
      display: block;
      font-size: 11px;
      color: var(--text-secondary);
      margin-bottom: 4px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .metric-value {
      font-size: 14px;
      font-weight: 600;
      color: var(--text-primary);
    }
  }
}

.month-progress {
  height: 4px;
  background: linear-gradient(90deg, #4ECDC4, #44A08D);
  border-radius: 2px;
  transition: width 0.8s ease;
}

// ========================================
// 🥧 TYPE DISTRIBUTION SECTION
// ========================================

.type-distribution-section {
  margin-bottom: 48px;
}

.type-chart {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 16px;
  overflow: hidden;
}

.type-item {
  display: flex;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--divider);
  transition: background-color 0.2s ease;

  &:last-child {
    border-bottom: none;
  }

  &:hover {
    background: var(--hover-bg);
  }
}

.type-info {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.type-color {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  flex-shrink: 0;
}

.type-details {
  .type-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
  }

  .type-stats {
    font-size: 12px;
    color: var(--text-secondary);
  }
}

.type-value {
  text-align: right;
  min-width: 140px;
  position: relative;

  .value-amount {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
  }

  .type-bar {
    height: 6px;
    border-radius: 3px;
    transition: width 0.8s ease;
  }
}

// ========================================
// 📋 SUMMARY SECTION
// ========================================

.summary-section {
  margin-bottom: 48px;
}

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

.summary-card {
  background: linear-gradient(135deg, var(--surface), var(--hover-bg));
  border: 1px solid var(--divider);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  transition: all 0.3s ease;

  &:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  }

  .summary-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .summary-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
  }

  .summary-description {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
  }
}

// ========================================
// 🚫 EMPTY STATES
// ========================================

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-secondary);

  i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
  }

  p {
    margin: 0;
    font-size: 14px;
  }
}

.empty-dashboard {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 40px;
  text-align: center;

  .empty-icon {
    margin-bottom: 32px;

    i {
      font-size: 80px;
      color: var(--text-secondary);
      opacity: 0.3;
    }
  }

  h3 {
    margin: 0 0 16px 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
  }

  p {
    margin: 0 0 8px 0;
    color: var(--text-secondary);
    font-size: 16px;
    max-width: 400px;
    line-height: 1.5;

    &:last-child {
      margin-bottom: 0;
    }
  }
}

// ========================================
// 📱 RESPONSIVE DESIGN
// ========================================

@media (max-width: 1200px) {
  .kpis-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
  
  .monthly-chart {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .tollparking-dashboard {
    padding: 16px;
  }

  .dashboard-title {
    font-size: 24px;
    flex-direction: column;
    gap: 8px;
  }

  .kpis-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .kpi-card {
    padding: 20px;
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;

    h3 {
      font-size: 18px;
    }
  }

  .vehicle-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
  }

  .vehicle-info {
    width: 100%;
  }

  .vehicle-value {
    width: 100%;
    text-align: left;
  }

  .type-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
  }

  .type-value {
    width: 100%;
    text-align: left;
  }

  .month-metrics {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .summary-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .tollparking-dashboard {
    padding: 12px;
  }

  .dashboard-header {
    margin-bottom: 24px;
  }

  .dashboard-title {
    font-size: 20px;
  }

  .dashboard-subtitle {
    font-size: 14px;
  }

  .kpi-card {
    padding: 16px;
  }

  .kpi-icon {
    width: 48px;
    height: 48px;

    i {
      font-size: 20px;
    }
  }

  .kpi-value {
    font-size: 24px !important;
  }

  .section-header h3 {
    font-size: 16px;
  }

  .month-bar {
    padding: 16px;
  }

  .summary-card {
    padding: 16px;
  }
}

// ========================================
// 🌙 DARK MODE ADJUSTMENTS
// ========================================

@media (prefers-color-scheme: dark) {
  .vehicle-rank {
    background: linear-gradient(135deg, #FF5252, #F44336);
  }

  .month-progress {
    background: linear-gradient(90deg, #26A69A, #00796B);
  }

  .kpi-icon {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.1));
  }

  .summary-card {
    background: linear-gradient(135deg, var(--surface), rgba(255, 255, 255, 0.02));
  }
}
