/* DPS Dashboard Styles */

/* Brand Colors */
:root {
  --white: #FFFFFF;
  --light-blue-off-white: #E0ECF6;
  --yellow: #FFDD62;
  --light-blue: #56B7E6;
  --darker-blue: #0D6CB9;
  --orange: #F16038;
  --gray: #5A6267;
  --dark-blue-navy: #012169;
  --dark-gray: #363534;
  --black: #000000;
}

/* Skip Link for Keyboard Navigation */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--darker-blue);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 1000;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 6px;
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

/* Screen Reader Only Class */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sr-only-focusable:focus {
  position: static;
  width: auto;
  height: auto;
  padding: 8px;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  background: var(--darker-blue);
  color: white;
  border-radius: 4px;
  z-index: 1000;
}

/* Dashboard Cards */
.dashboard-card {
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  border: 1px solid var(--light-blue-off-white);
  background-color: var(--white);
  transition: transform 0.2s, box-shadow 0.2s;
  height: 100%;
}

.dashboard-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.dashboard-card .card-header {
  background-color: var(--light-blue-off-white);
  border-bottom: 1px solid var(--light-blue-off-white);
  padding: 16px 20px;
}

.dashboard-card .card-header h6 {
  font-weight: 600;
  color: var(--dark-blue-navy);
  font-size: 16px;
  margin: 0;
}

.dashboard-card .card-body {
  padding: 20px;
}

/* Metric Display */
.metric-display {
  text-align: center;
  margin-bottom: 20px;
}

.main-number {
  font-size: 36px;
  font-weight: 700;
  color: var(--darker-blue);
  line-height: 1;
  margin-bottom: 8px;
}

.metric-label {
  font-size: 14px;
  color: var(--gray);
  font-weight: 500;
}

.highlight-text {
  color: var(--darker-blue);
  font-weight: 600;
  font-size: 14px;
}

.highlight-number {
  color: var(--darker-blue);
  font-weight: 700;
  font-size: 18px;
}

/* Chart Containers */
.chart-container {
  position: relative;
  margin: 20px 0;
}

.donut-chart-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 10px 0 0;
}

.donut-center {
  position: absolute;
  text-align: center;
  z-index: 10;
}

.center-number {
  font-size: 24px;
  font-weight: 700;
  color: var(--darker-blue);
  line-height: 1;
  margin-bottom: 4px;
}

.center-label {
  font-size: 12px;
  color: var(--gray);
  font-weight: 500;
  width: 100px;
}

/* Color Dots for Legends */
.color-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
}

.color-dot.prosecutors {
  background-color: var(--darker-blue);
}

.color-dot.defense {
  background-color: var(--orange);
}

.color-dot.lab-users {
  background-color: var(--light-blue);
}

.color-dot.admins {
  background-color: var(--dark-blue-navy);
}

.color-dot.pending-0-7 {
  background-color: var(--darker-blue);
}

.color-dot.pending-8-30 {
  background-color: var(--dark-blue-navy);
}

.color-dot.pending-over-30 {
  background-color: var(--orange);
}

/* Color Bars for LIMS */
.color-bar {
  display: inline-block;
  width: 16px;
  height: 8px;
  border-radius: 2px;
  margin-right: 8px;
}

.color-bar.justice-trax {
  background-color: var(--darker-blue);
}

.color-bar.starlims {
  background-color: var(--gray);
}

.color-bar.forensic-advantage {
  background-color: var(--light-blue);
}

.color-bar.other-legacy {
  background-color: var(--dark-gray);
}

/* User Breakdown */
.user-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 15px;
}

.user-item {
  display: flex;
  align-items: center;
  font-size: 13px;
  color: var(--gray);
}

.user-item span:last-child,
.pending-item span:last-child {
  width: calc(100% - 20px);
  display: flex;
  justify-content: space-between;
}

.user-item span:last-child em,
.pending-item span:last-child em {
  font-style: normal;
  font-weight: 700;
}

/* LIMS Progress Bars */
.lims-progress-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 15px;
}

.lims-progress-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 32px;
  position: relative;
}

.lims-label {
  font-size: 13px;
  color: #fff !important;
  font-weight: 500;
  min-width: 120px;
  flex-shrink: 0;
  flex: 0 0 calc(100% - 80px);
  max-width: calc(100% - 80px);
  position: relative;
  padding: 0 10px;
  background-color: transparent !important;
  z-index:  10;
}

.progress-bar-container {
  flex: 1;
  height: 32px;
  background-color: #b0bcc6;
  border-radius: 6px;
  overflow: hidden;
  position: absolute;
  left: 0;
  top: 0;
  width: calc(100% - 60px);
}

.progress-bar {
  height: 100%;
  border-radius: 6px;
  transition: width 0.3s ease;
}

.lims-count {
  font-size: 13px;
  color: var(--dark-blue-navy);
  font-weight: 600;
  min-width: 60px;
  text-align: right;
  flex-shrink: 0;
}

/* Pending Breakdown */
.pending-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 15px;
}

.pending-item {
  display: flex;
  align-items: center;
  font-size: 13px;
  color: var(--gray);
}

.pending-summary {
  margin-top: 15px;
  text-align: center;
}

/* Session Stats */
.session-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 15px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  
  padding: 8px 16px;
  flex: 0 0 50%;
  max-width: 50%;
}

/* Vertical separators between grid items */
.session-stats .stat-item:nth-child(2n) {
  border-left: 1px solid var(--light-blue-off-white);
}

.session-stats .stat-item:not(:last-child) {
  flex-direction: column;
}

.session-stats .stat-item:last-child {
  flex: 0 0 100%;
  max-width: 100%;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--light-blue-off-white);
}

.stat-label {
  font-size: 13px;
  color: var(--gray);
  font-weight: 500;
}

.stat-value {
  font-size: 13px;
  color: var(--dark-blue-navy);
  font-weight: 600;
}

/* Notifications */
.notifications-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dashboard-card .notification-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  position: relative;
  border-radius: 8px;
  background-color: var(--light-blue-off-white);
  transition: background-color 0.2s;
}

.notification-item:hover {
  background-color: #d0e0f0;
}

.notification-icon {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
}

.notification-icon.red {
  background-color: #dc3545;
}

.notification-icon.yellow {
  background-color: var(--yellow);
}

.notification-icon.orange {
  background-color: var(--orange);
}

.notification-icon.blue {
  background-color: var(--light-blue);
}

.notification-content {
  flex: 1;
  position: relative;
}

.dashboard-card .notification-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--dark-blue-navy);
  margin-bottom: 4px;
  padding-right: 110px;
}

.dashboard-card .notification-desc {
  font-size: 13px;
  color: var(--gray);
}

.dashboard-card .notification-actions {
  display: flex;
  gap: 12px;
  position: absolute;
  right: 0;
  top: 0;
}

.action-link {
  font-size: 12px;
  color: var(--darker-blue);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
  padding: 2px 4px;
  border-radius: 3px;
}

.action-link:hover {
  color: var(--dark-blue-navy);
  text-decoration: underline;
  background-color: rgba(13, 108, 185, 0.1);
}

.action-link:focus {
  outline: 2px solid var(--darker-blue);
  outline-offset: 2px;
  color: var(--dark-blue-navy);
  text-decoration: underline;
}

/* Locked Users */
.locked-stats {
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}

/* Each stat cell */
.locked-stats .stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-direction: column;
  margin-bottom: 0;
  padding: 8px 16px;
}

/* Vertical separators between the first two items */
.locked-stats .stat-row:nth-child(-n+2) {
  border-right: 1px solid var(--light-blue-off-white);
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 13px;
  color: var(--gray);
  font-weight: 500;
}

.stat-value {
  font-size: 13px;
  color: var(--dark-blue-navy);
  font-weight: 600;
}

.locked-users-table {
  margin-top: 15px;
}

.locked-users-table .table {
  font-size: 12px;
  margin: 0;
}

.locked-users-table th {
  background-color: var(--light-blue-off-white);
  color: var(--dark-blue-navy);
  font-weight: 600;
  border: none;
  padding: 8px 12px;
  font-size: 12px;
}

.locked-users-table td {
  padding: 8px 12px;
  border: none;
  border-bottom: 1px solid var(--light-blue-off-white);
  color: var(--gray);
}

/* System Health */
.system-status {
  text-align: center;
  margin-bottom: 20px;
}

.status-indicator {
  display: inline-block;
  padding: 8px 24px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 14px;
}

.status-indicator.good {
  background-color: #b8d9c4; /* darker version of #d4edda */
  color: #155724;
  border: 1px solid #9bc3a8; /* even darker border */
}

.system-metrics {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.metric-label {
  font-size: 13px;
  color: var(--gray);
  font-weight: 500;
}

.metric-value {
  font-size: 13px;
  color: var(--dark-blue-navy);
  font-weight: 600;
}

/* Button Links */
.btn-link {
  color: var(--darker-blue);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.2s;
  padding: 2px 4px;
  border-radius: 3px;
}

.btn-link:hover {
  color: var(--dark-blue-navy);
  text-decoration: underline;
}

.btn-link:focus {
  outline: 2px solid var(--darker-blue);
  outline-offset: 2px;
  color: var(--dark-blue-navy);
  text-decoration: underline;
}

.dashboard-card .text-muted {
  text-align: center;
  display: block;
  margin-bottom: 5px;
}

.dashboard-card .metric-footer {
  text-align: center;
}

/* Enhanced Focus States for Accessibility */
.btn:focus,
.nav-link:focus,
.user-menu-btn:focus,
.action-btn:focus {
  outline: 2px solid var(--darker-blue);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px rgba(13, 108, 185, 0.2);
}

/* Improved Color Contrast for Better Accessibility */
.dashboard-card .text-muted {
  color: #6c757d !important; /* Better contrast than original gray */
}

.metric-label,
.stat-label,
.user-item,
.pending-item {
  color: #495057 !important; /* Better contrast than original gray */
}

/* Responsive Design */
@media (max-width: 1200px) {
  .dashboard-card .card-body {
    padding: 16px;
  }
  
  .main-number {
    font-size: 28px;
  }
  
  .center-number {
    font-size: 20px;
  }
}

@media (max-width: 768px) {
  .dashboard-card {
    margin-bottom: 20px;
  }
  
  .stat-item,
  .stat-row,
  .metric-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  /* Stack session stats and use horizontal separators on mobile */
  .session-stats {
    display: flex;
    flex-direction: column;
  }

  .session-stats .stat-item {
    padding: 10px 0;
    border-right: 0;
    border-bottom: 1px solid var(--light-blue-off-white);
  }

  .session-stats .stat-item:last-child {
    border-bottom: 0;
  }
  
  .notification-item {
    flex-direction: column;
    gap: 8px;
  }
  
  .notification-actions {
    justify-content: flex-start;
  }
}

/* Chart Customization */
.chart-container canvas {
  max-height: 120px;
}

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

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

/* Animation for hover effects */
.dashboard-card,
.notification-item,
.action-link {
  transition: all 0.2s ease;
}

/* Focus states for accessibility */
.btn-link:focus,
.action-link:focus {
  outline: 2px solid var(--darker-blue);
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .dashboard-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid var(--gray);
  }
  
  .dashboard-card:hover {
    transform: none;
  }
  
  .skip-link {
    display: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .dashboard-card {
    border: 2px solid var(--dark-blue-navy);
  }
  
  .btn-link,
  .action-link {
    text-decoration: underline;
  }
  
  .color-dot {
    border: 1px solid var(--black);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .dashboard-card,
  .notification-item,
  .action-link,
  .btn-link {
    transition: none;
  }
  
  .dashboard-card:hover {
    transform: none;
  }
}

/* Mobile: stack rows and use horizontal separators */
@media (max-width: 768px) {
  .locked-stats {
    display: flex;
    flex-direction: column;
  }
  
  .locked-stats .stat-row {
    padding: 10px 0;
    border-right: 0;
    border-bottom: 1px solid var(--light-blue-off-white);
  }
  
  .locked-stats .stat-row:last-child {
    border-bottom: 0;
  }
}

/* Notification item background based on severity icon */
.notifications-list .notification-item:has(.notification-icon.red) {
  background-color: #fdecee; /* lighter version of #dc3545 */
}

.notifications-list .notification-item:has(.notification-icon.red):hover {
  background-color: #f8d7da; /* hover state slightly darker than base */
}

/* Notification item background for yellow severity */
.notifications-list .notification-item:has(.notification-icon.yellow) {
  background-color: #FFF9E6; /* lighter version of #FFDD62 */
}

.notifications-list .notification-item:has(.notification-icon.yellow):hover {
  background-color: #FFF3BF; /* hover state slightly darker than base */
}

/* Notification item background for orange severity */
.notifications-list .notification-item:has(.notification-icon.orange) {
  background-color: #FFF0EA; /* even lighter version of #F16038 */
}

.notifications-list .notification-item:has(.notification-icon.orange):hover {
  background-color: #FFE3D9; /* hover state slightly darker than new base */
}

/* Notification item background for blue severity */
.notifications-list .notification-item:has(.notification-icon.blue) {
  background-color: #E6F4FA; /* lighter version of #56B7E6 */
}

.notifications-list .notification-item:has(.notification-icon.blue):hover {
  background-color: #D1E9F5; /* hover state slightly darker than base */
}
