/*
Shared Styles for MPI Library Dashboard
Author: Thomas Gerdes | License: MIT
Version: 2.0.0 | Last updated: August 2025
*/

.quarto-container {
  max-width: 1400px !important;
}

body {
  margin: 0 20px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
}

a {
  color: #006c66 !important;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #004d47 !important;
  text-decoration: underline;
}

a:focus {
  outline: 2px solid #006c66;
  outline-offset: 2px;
}

.sidebar nav a,
.toc a,
.toc-left a,
nav[role="doc-toc"] a,
#TOC a,
.quarto-sidebar-nav a {
  color: #006c66 !important;
}

.sidebar nav a:hover,
.toc a:hover,
.toc-left a:hover,
nav[role="doc-toc"] a:hover,
#TOC a:hover,
.quarto-sidebar-nav a:hover {
  color: #004d47 !important;
}

.navbar a,
.navbar-nav a,
.page-footer a,
header a,
footer a {
  color: inherit !important;
}

.navbar a:hover,
.navbar-nav a:hover,
.page-footer a:hover,
header a:hover,
footer a:hover {
  color: inherit !important;
}

.navbar,
.navbar-default,
.quarto-navigation,
.quarto-navbar,
nav.navbar,
header .navbar,
body > header,
.quarto-title-banner {
  background-color: #006c66 !important; 
}

.navbar-expand-lg,
.navbar-dark,
.bg-primary {
  background-color: #006c66 !important;
}

.dashboard-nav {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  margin: 20px 0;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dashboard-nav a {
  display: inline-block;
  padding: 10px 20px;
  margin: 0 5px;
  background: #007bff;
  color: white;
  text-decoration: none;
  border-radius: 5px;
  transition: all 0.2s ease;
  font-weight: 500;
}

.dashboard-nav a:hover {
  background: #0056b3;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.dashboard-nav a.active {
  background: #28a745;
}

.dashboard-nav a:focus {
  outline: 2px solid #000;
  outline-offset: 2px;
}

.info-box-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin: 30px 0;
}

.info-box {
  background: linear-gradient(135deg, #f8f9fa 0%, #e6f3f2 100%);
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  flex: 1 1 200px;
  min-width: 200px;
  max-width: 280px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border-left: 4px solid #006c66;
}

.info-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.info-box-value {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 5px;
  line-height: 1.2;
}

.info-box-label {
  font-size: 13px;
  color: #666;
  margin-top: 5px;
  font-weight: 500;
}

.info-box {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  flex: 1 1 200px;
  min-width: 200px;
  max-width: 280px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.info-box.blue { 
  border-left: 4px solid #007bff; 
  background: linear-gradient(135deg, #f8f9fa 0%, #e3f2fd 100%);
}
.info-box.blue .info-box-value { color: #007bff; }

.info-box.gray { 
  border-left: 4px solid #6c757d; 
  background: linear-gradient(135deg, #f8f9fa 0%, #f5f5f5 100%);
}
.info-box.gray .info-box-value { color: #6c757d; }

.info-box.green { 
  border-left: 4px solid #28a745; 
  background: linear-gradient(135deg, #f8f9fa 0%, #e8f5e8 100%);
}
.info-box.green .info-box-value { color: #28a745; }

.info-box.red { 
  border-left: 4px solid #dc3545; 
  background: linear-gradient(135deg, #f8f9fa 0%, #fdeaea 100%);
}
.info-box.red .info-box-value { color: #dc3545; }

.info-box.orange { 
  border-left: 4px solid #fd7e14; 
  background: linear-gradient(135deg, #f8f9fa 0%, #fff3e0 100%);
}
.info-box.orange .info-box-value { color: #fd7e14; }

.dashboard-button {
  padding: 8px 16px;
  border: none;
  border-radius: 5px;
  color: white;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  margin: 2px;
}

.dashboard-button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.dashboard-button:focus {
  outline: 2px solid #000;
  outline-offset: 2px;
}

.dashboard-button:active {
  transform: translateY(0);
}

.chart-container {
  background: white;
  padding: 25px;
  margin: 30px 0;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: box-shadow 0.3s ease;
}

.chart-container:hover {
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.chart-title {
  color: #333;
  text-align: center;
  margin: 10px 0 20px 0;
  font-size: 24px;
  font-weight: 600;
}

.overview-chart {
  background: white;
  padding: 25px;
  margin: 30px 0;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* ===== SECTION CARDS ===== */
.section-card {
  background: white;
  padding: 25px;
  margin: 20px 0;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.section-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.section-title {
  color: #333;
  font-size: 20px;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #007bff;
  font-weight: 600;
}

.section-description {
  color: #666;
  line-height: 1.6;
  margin-bottom: 15px;
  font-size: 15px;
}

.section-link {
  display: inline-block;
  padding: 10px 20px;
  background: #007bff;
  color: white;
  text-decoration: none;
  border-radius: 5px;
  transition: all 0.2s ease;
  font-weight: 500;
}

.section-link:hover {
  background: #0056b3;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* ===== DETAILS/ACCORDION STYLING ===== */
details {
  margin: 20px 0;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
}

summary {
  background: #f8f9fa;
  padding: 15px 20px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid #e0e0e0;
}

summary:hover {
  background: #e9ecef;
}

.details-content {
  padding: 20px;
  background: white;
}

/* ===== TABLE STYLING ===== */
.table {
  width: 100%;
  margin-bottom: 1rem;
  background-color: transparent;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px;
  vertical-align: top;
  border-top: 1px solid #dee2e6;
  text-align: left;
}

.table thead th {
  background-color: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
  font-weight: 600;
  color: #495057;
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(0,0,0,.05);
}

.table-hover tbody tr:hover {
  background-color: rgba(0,0,0,.075);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  body {
    margin: 0 10px;
  }
  
  .info-box {
    flex: 1 1 calc(50% - 7.5px);
    min-width: calc(50% - 7.5px);
    max-width: calc(50% - 7.5px);
    padding: 15px;
  }
  
  .info-box-value {
    font-size: 20px;
  }
  
  .dashboard-nav a {
    display: block;
    margin: 5px 0;
    padding: 12px 16px;
  }
  
  .chart-container {
    padding: 15px;
    margin: 20px 0;
  }
  
  .chart-title {
    font-size: 20px;
  }
  
  .section-card {
    padding: 20px;
  }
  
  .dashboard-button {
    display: block;
    width: 100%;
    margin: 3px 0;
  }
}

@media (max-width: 480px) {
  .info-box {
    flex: 1 1 100%;
    min-width: 100%;
    max-width: 100%;
  }
  
  .info-box-container {
    gap: 10px;
  }
  
  .chart-title {
    font-size: 18px;
  }
  
  .section-title {
    font-size: 18px;
  }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus indicators for better accessibility */
button:focus,
a:focus,
summary:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .info-box {
    border: 2px solid;
  }
  
  .chart-container {
    border: 2px solid #333;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  .dashboard-nav,
  .dashboard-button {
    display: none;
  }
  
  .chart-container {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }
  
  .info-box {
    break-inside: avoid;
  }
}

/* ===== LOADING STATES ===== */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}