/* Custom CSS for BYD Analytics Dashboard */

:root {
  --primary-color: #4e73df;
  --success-color: #1cc88a;
  --info-color: #36b9cc;
  --warning-color: #f6c23e;
  --danger-color: #e74a3b;
  --secondary-color: #858796;
  --light-color: #f8f9fc;
  --dark-color: #5a5c69;
}

body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  background-color: #f8f9fc;
  color: #5a5c69;
}

/* Navigation */
.navbar-brand {
  font-size: 1.5rem;
}

.navbar-nav .nav-link.active {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 0.375rem;
}

/* Main Content */
.main-content {
  margin-top: 76px; /* Height of fixed navbar */
  padding: 20px 0;
  min-height: calc(100vh - 76px);
}

/* Page Headers */
.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e3e6f0;
}

.page-header h1 {
  color: var(--dark-color);
  font-weight: 600;
}

/* Cards */
.card {
  border: none;
  box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
  border-radius: 0.35rem;
}

.card-header {
  background-color: #f8f9fc;
  border-bottom: 1px solid #e3e6f0;
}

/* Metric Cards */
.border-left-primary {
  border-left: 0.25rem solid var(--primary-color) !important;
}

.border-left-success {
  border-left: 0.25rem solid var(--success-color) !important;
}

.border-left-info {
  border-left: 0.25rem solid var(--info-color) !important;
}

.border-left-warning {
  border-left: 0.25rem solid var(--warning-color) !important;
}

.text-xs {
  font-size: 0.7rem;
}

.font-weight-bold {
  font-weight: 700 !important;
}

.text-gray-800 {
  color: #5a5c69 !important;
}

.text-gray-300 {
  color: #dddfeb !important;
}

/* Tables */
.table {
  font-size: 0.9rem;
}

.table th {
  border-top: none;
  font-weight: 600;
  color: var(--dark-color);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table-hover tbody tr:hover {
  background-color: rgba(78, 115, 223, 0.05);
}

/* Badges */
.badge {
  font-size: 0.75rem;
  font-weight: 600;
}

/* Buttons */
.btn {
  font-weight: 600;
  border-radius: 0.35rem;
}

.btn-sm {
  font-size: 0.8rem;
}

/* Progress bars */
.progress {
  border-radius: 10rem;
}

/* Pagination */
.pagination {
  margin: 0;
}

.page-link {
  border: none;
  color: var(--primary-color);
  font-weight: 600;
}

.page-item.active .page-link {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

/* Charts */
.chart-area {
  position: relative;
  height: 300px;
}

/* Latest Leads */
.latest-leads {
  max-height: 400px;
  overflow-y: auto;
}

.lead-item {
  padding: 10px 0;
  border-bottom: 1px solid #e3e6f0;
}

.lead-item:last-child {
  border-bottom: none;
}

.lead-avatar div {
  font-size: 0.8rem;
  font-weight: 600;
}

.lead-email {
  font-size: 0.9rem;
}

.lead-meta {
  font-size: 0.8rem;
}

/* Vehicle Stats */
.vehicle-stat {
  padding: 10px 0;
  border-bottom: 1px solid #e3e6f0;
}

.vehicle-stat:last-child {
  border-bottom: none;
}

.vehicle-rank div {
  font-size: 1rem;
  font-weight: 700;
}

.vehicle-name {
  font-size: 0.9rem;
}

.vehicle-meta {
  font-size: 0.8rem;
}

/* Filters */
.form-label {
  font-weight: 600;
  color: var(--dark-color);
  font-size: 0.9rem;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .main-content {
    margin-top: 70px;
    padding: 15px 0;
  }
  
  .page-header h1 {
    font-size: 1.5rem;
  }
  
  .card-body {
    padding: 1rem;
  }
  
  .table-responsive {
    font-size: 0.8rem;
  }
  
  .chart-area {
    height: 250px;
  }
}

/* Utilities */
.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.shadow-sm {
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.rounded-lg {
  border-radius: 0.5rem !important;
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
  /* Can be implemented later if needed */
}

/* Print styles */
@media print {
  .navbar,
  .btn,
  .pagination {
    display: none !important;
  }
  
  .main-content {
    margin-top: 0;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #dee2e6;
  }
}