/* =========================================================
   SCHEMES AND GRANTS PAGE STYLES
   ========================================================= */

/* CSS Variables */
:root {
  --primary-color: #0d6efd;
  --primary-dark: #0b5ed7;
  --secondary-color: #6c757d;
  --success-color: #198754;
  --info-color: #0dcaf0;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --light-color: #f8f9fa;
  --dark-color: #212529;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
}

/* =========================================================
   PAGE HEADER
   ========================================================= */
.page-header {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-dark) 100%
  );
  color: white;
  padding: 4rem 0 2rem;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" fill="white" opacity="0.1"><polygon points="0,100 1000,0 1000,100"/></svg>');
  background-size: cover;
}

.page-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.page-header .lead {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 0;
}

.breadcrumb {
  background: transparent;
  padding: 0;
  margin-bottom: 1rem;
}

.breadcrumb-item a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
}

.breadcrumb-item.active {
  color: white;
  font-weight: 500;
}

.breadcrumb-item + .breadcrumb-item::before {
  color: rgba(255, 255, 255, 0.6);
}

/* =========================================================
   INTRODUCTION SECTION
   ========================================================= */
.introduction-section {
  background: white;
}

.content-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--primary-color);
}

.content-card p {
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
  color: var(--dark-color);
}

.highlight-box {
  background: linear-gradient(135deg, var(--light-color) 0%, #e9ecef 100%);
  border-left: 4px solid var(--success-color);
  padding: 1.5rem;
  border-radius: var(--radius-sm);
  margin-top: 2rem;
}

.highlight-box p {
  margin-bottom: 0;
  font-size: 1.1rem;
  color: var(--dark-color);
}

/* =========================================================
   FUNDING AGENCIES SECTION
   ========================================================= */
.agencies-section {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.agency-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 2rem;
  text-align: center;
  height: 100%;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.agency-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

.agency-icon {
  width: 70px;
  height: 70px;
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-dark) 100%
  );
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 1.75rem;
  color: white;
}

.agency-card h4 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--dark-color);
}

.agency-card p {
  color: var(--secondary-color);
  font-size: 0.9rem;
  margin-bottom: 0;
}

/* =========================================================
   RESEARCH SECTION
   ========================================================= */
.research-section {
  background: white;
}

.table {
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.table thead th {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-dark) 100%
  );
  color: white;
  border: none;
  padding: 1rem;
  font-weight: 600;
  text-align: center;
}

.table tbody td {
  padding: 1rem;
  vertical-align: middle;
  border-color: #dee2e6;
}

.table tbody tr:nth-child(even) {
  background-color: rgba(13, 110, 253, 0.05);
}

.table tbody tr:hover {
  background-color: rgba(13, 110, 253, 0.1);
}

/* Chart Styles */
.chart-container {
  background: white;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  height: 100%;
}

.chart-legend {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.legend-item {
  display: flex;
  align-items: center;
  margin: 0 1rem;
}

.legend-color {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  margin-right: 0.5rem;
}

.bar-chart {
  padding: 1rem 0;
}

.bar-container {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
}

.bar-label {
  width: 80px;
  font-weight: 500;
  color: var(--dark-color);
}

.bar {
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 1rem;
  color: white;
  font-weight: 600;
  min-width: 40px;
  transition: width 1s ease;
}

/* =========================================================
   CONSULTANCY SECTION
   ========================================================= */
.consultancy-section {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.table-success thead th {
  background: linear-gradient(135deg, var(--success-color) 0%, #157347 100%);
}

.stat-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--secondary-color);
  font-size: 0.95rem;
  font-weight: 500;
}

/* =========================================================
   CALL TO ACTION SECTION
   ========================================================= */
.cta-section {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-dark) 100%
  );
  color: white;
}

.cta-section h3 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.cta-section p {
  opacity: 0.9;
  margin-bottom: 0;
}

.btn-primary {
  background: white;
  color: var(--primary-color);
  border: none;
  padding: 0.75rem 2rem;
  font-weight: 600;
  border-radius: 50px;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background: var(--light-color);
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* =========================================================
   RESPONSIVE DESIGN
   ========================================================= */
@media (max-width: 768px) {
  .page-header {
    padding: 3rem 0 1.5rem;
  }

  .page-header h1 {
    font-size: 2rem;
  }

  .content-card {
    padding: 1.5rem;
  }

  .table {
    font-size: 0.875rem;
  }

  .table thead th,
  .table tbody td {
    padding: 0.75rem;
  }

  .agency-card {
    padding: 1.5rem;
  }

  .stat-card {
    padding: 1.5rem;
    margin-bottom: 1rem;
  }

  .stat-number {
    font-size: 2rem;
  }

  .bar {
    font-size: 0.875rem;
    padding: 0 0.5rem;
  }
}

@media (max-width: 576px) {
  .page-header h1 {
    font-size: 1.75rem;
  }

  .chart-container {
    margin-bottom: 1.5rem;
  }

  .cta-section .col-lg-4 {
    text-align: center !important;
    margin-top: 1.5rem;
  }

  .breadcrumb {
    font-size: 0.875rem;
  }
}

/* =========================================================
   ANIMATIONS
   ========================================================= */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}

/* =========================================================
   PRINT STYLES
   ========================================================= */
@media print {
  .page-header {
    background: white !important;
    color: black !important;
    padding: 2rem 0 1rem;
  }

  .btn,
  .breadcrumb,
  .agency-card:hover,
  .stat-card:hover,
  .chart-container {
    box-shadow: none !important;
    transform: none !important;
  }

  .table {
    border: 1px solid #dee2e6;
  }

  .cta-section {
    display: none;
  }
}

/* =========================================================
   ACCESSIBILITY
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .agency-card:hover,
  .stat-card:hover,
  .btn-primary:hover {
    transform: none !important;
  }
}

/* Focus styles for accessibility */
.table:focus,
.btn:focus,
.agency-card:focus {
  outline: 3px solid rgba(13, 110, 253, 0.5);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .table thead th {
    border: 2px solid black;
  }

  .agency-card,
  .stat-card,
  .chart-container {
    border: 2px solid black;
  }
}
