/* static/css/dashboard.css */
/* Dashboard-specific styles using unified color system */

/* Dashboard Layout */
.dashboard-container {
  padding-top: 16px;
  background-color: var(--bg-secondary);
  min-height: calc(100vh - 64px);
}

/* Quick Stats Grid */
.quick-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.stat-card.primary { border-left-color: var(--primary); background: linear-gradient(145deg, var(--bg-surface) 0%, var(--primary-50) 100%); }
.stat-card.success { border-left-color: var(--success-500); background: linear-gradient(145deg, var(--bg-surface) 0%, var(--success-50) 100%); }
.stat-card.warning { border-left-color: var(--warning-500); background: linear-gradient(145deg, var(--bg-surface) 0%, var(--warning-50) 100%); }
.stat-card.danger { border-left-color: var(--error-500); background: linear-gradient(145deg, var(--bg-surface) 0%, var(--error-50) 100%); }
.stat-card.info { border-left-color: var(--info-500); background: linear-gradient(145deg, var(--bg-surface) 0%, var(--info-50) 100%); }

.stat-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 2rem;
  opacity: 0.3;
  color: var(--text-secondary);
}

/* Activity Feed */
.activity-feed {
  max-height: 500px;
  overflow-y: auto;
}

.activity-item {
  padding: 16px;
  border-bottom: 1px solid var(--border-secondary);
  transition: background-color 0.2s ease;
}

.activity-item:hover {
  background-color: var(--bg-tertiary);
}

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

.activity-time {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-right: 12px;
}

.activity-icon.filing {
  background-color: var(--primary-50);
  color: var(--primary);
}

.activity-icon.alert {
  background-color: #fff3e0;
  color: var(--warning-500);
}

.activity-icon.watchlist {
  background-color: #e8f5e8;
  color: var(--success-500);
}

.activity-icon.search {
  background-color: var(--gray-100);
  color: var(--info-500);
}

/* Charts Container */
.chart-container {
  position: relative;
  height: 300px;
  margin-top: 16px;
  background-color: var(--bg-surface);
  border-radius: var(--border-radius-lg);
  padding: 16px;
}

.chart-container canvas {
  max-height: 300px;
}

/* Filing Status Widget */
.filing-status-widget {
  padding: 24px;
  background-color: var(--bg-surface);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-1);
}

.status-breakdown {
  display: flex;
  justify-content: space-around;
  margin-top: 16px;
}

.status-item {
  text-align: center;
  padding: 16px;
}

.status-count {
  font-size: 2rem;
  font-weight: 300;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.status-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Recent Filings Table */
.recent-filings-table {
  font-size: 0.875rem;
}

.recent-filings-table td {
  vertical-align: middle;
  padding: 12px 16px;
}

.filing-number-link {
  font-weight: 500;
  text-decoration: none;
  color: var(--primary);
  transition: color 0.2s ease;
}

.filing-number-link:hover {
  color: var(--primary-700);
  text-decoration: underline;
}

/* Portal Status Grid */
.portal-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 16px;
  padding: 16px;
}

.portal-status-item {
  text-align: center;
  padding: 16px;
  border-radius: var(--border-radius-lg);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-secondary);
  transition: all 0.2s ease;
}

.portal-status-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}

.portal-status-item.active {
  border-color: var(--success-500);
  background-color: #e8f5e8;
}

.portal-status-item.inactive {
  border-color: var(--error-500);
  background-color: #ffebee;
  opacity: 0.8;
}

.portal-state-code {
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.portal-state-name {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Quick Actions */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 32px 0;
}

.quick-action-btn {
  padding: 24px;
  text-align: center;
  border: 1px solid var(--border-primary);
  border-radius: var(--border-radius-lg);
  transition: all 0.2s ease;
  text-decoration: none;
  display: block;
  background-color: var(--bg-surface);
  color: var(--text-primary);
  position: relative;
  overflow: hidden;
}

.quick-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
  color: var(--text-primary);
  text-decoration: none;
}

.quick-action-btn i {
  font-size: 2.5rem;
  margin-bottom: 8px;
  display: block;
  color: var(--primary);
}

.quick-action-btn span {
  font-weight: 500;
  display: block;
  color: var(--text-primary);
}

/* Notification Badge */
.notification-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: var(--error-500);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 500;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(244, 67, 54, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(244, 67, 54, 0);
  }
}

/* Search Widget */
.dashboard-search {
  background-color: var(--bg-surface);
  padding: 24px;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-1);
  margin-bottom: 32px;
}

.dashboard-search .form-control {
  border-radius: 24px;
  padding-left: 48px;
  border: 1px solid var(--border-primary);
}

.dashboard-search .search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
}

/* Calendar Widget */
.calendar-widget {
  background-color: var(--bg-surface);
  border-radius: var(--border-radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-1);
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-primary);
}

.calendar-day:hover {
  background-color: var(--bg-tertiary);
}

.calendar-day.has-events {
  background-color: var(--primary-50);
  color: var(--primary);
  font-weight: 500;
}

.calendar-day.today {
  background-color: var(--primary);
  color: white;
  font-weight: 500;
}

/* Progress Bars */
.progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.progress-dashboard {
  height: 8px;
  border-radius: 4px;
  background-color: var(--bg-tertiary);
  overflow: visible;
}

.progress-dashboard .progress-bar {
  border-radius: 4px;
  position: relative;
  background-color: var(--primary);
  transition: width 0.3s ease;
}

/* Loading States */
.dashboard-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
}

.dashboard-loading .loading {
  width: 40px;
  height: 40px;
  border-width: 4px;
}

/* Data Update Animation */
.data-update {
  animation: dataUpdate 0.5s ease;
}

@keyframes dataUpdate {
  0% {
    background-color: var(--warning-500);
    opacity: 0.2;
  }
  100% {
    background-color: transparent;
    opacity: 1;
  }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .dashboard-container {
    padding-top: 8px;
  }
  
  .quick-stats {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .quick-actions {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .portal-status-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
  }
  
  .activity-feed {
    max-height: 300px;
  }
  
  .quick-action-btn {
    padding: 16px;
  }
  
  .quick-action-btn i {
    font-size: 2rem;
  }
  
  .dashboard-search {
    padding: 16px;
  }
}