/* Modern Academic Platform Design System */

/* ============================================
   Root Variables - Color Palette
   ============================================ */
:root {
  /* Primary - Deep Navy/Slate */
  --bs-primary: #1e3a5f;
  --bs-primary-rgb: 30, 58, 95;
  
  /* Secondary - Muted Slate */
  --bs-secondary: #5a6c7d;
  --bs-secondary-rgb: 90, 108, 125;
  
  /* Success - Muted Green */
  --bs-success: #4a7c59;
  --bs-success-rgb: 74, 124, 89;
  
  /* Warning - Muted Amber */
  --bs-warning: #c9a227;
  --bs-warning-rgb: 201, 162, 39;
  
  /* Danger - Muted Red */
  --bs-danger: #a54444;
  --bs-danger-rgb: 165, 68, 68;
  
  /* Info - Muted Blue */
  --bs-info: #5b8db8;
  --bs-info-rgb: 91, 141, 184;
  
  /* Light - Off-white */
  --bs-light: #f8f9fa;
  --bs-light-rgb: 248, 249, 250;
  
  /* Dark - Near-black */
  --bs-dark: #1a1a1a;
  --bs-dark-rgb: 26, 26, 26;
  
  /* Body */
  --bs-body-bg: #fafbfc;
  --bs-body-color: #1a1a1a;
  --bs-border-color: #e0e3e8;
  
  /* Text */
  --bs-body-text-color: #2c2c2c;
  --bs-muted-color: #6c757d;
}

/* ============================================
   Typography
   ============================================ */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #1a1a1a;
  background-color: #fafbfc;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  color: #1a1a1a;
  letter-spacing: -0.3px;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

h4, h5, h6 {
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.display-5 {
  font-size: 2.5rem;
  font-weight: 700;
}

.lead {
  font-size: 1rem;
  font-weight: 400;
  color: #4c5563;
}

/* ============================================
   Navbar - Dark Navy Anchor
   ============================================ */
.navbar {
  background-color: #1e3a5f !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  padding: 0.75rem 0 !important;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.125rem;
  color: #ffffff !important;
  letter-spacing: -0.3px;
  transition: opacity 0.2s ease;
}

.navbar-brand:hover {
  opacity: 0.9;
}

/* Public nav (Browse Projects) vs Account nav separator */
.navbar-nav .nav-item:nth-child(1)::after {
  content: '';
  position: absolute;
  right: -0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 24px;
  background-color: rgba(255, 255, 255, 0.2);
}

.navbar-nav .nav-link {
  color: #e8eaed !important;
  font-weight: 500;
  font-size: 0.9375rem;
  padding: 0.5rem 1rem !important;
  margin: 0 0.25rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
  position: relative;
  display: inline-flex;
  align-items: center;
}

.navbar-nav .nav-link:hover {
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.08);
  border-bottom: 2px solid rgba(255, 255, 255, 0.5);
  padding-bottom: calc(0.5rem - 2px) !important;
}

.navbar-nav .nav-link.active {
  color: #ffffff !important;
  font-weight: 600;
  background-color: rgba(255, 255, 255, 0.12);
  border-bottom: 2px solid #ffffff;
  padding-bottom: calc(0.5rem - 2px) !important;
}

/* Navbar badge styling for dark background */
.navbar-nav .badge {
  margin-left: 0.5rem;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
}

/* Logout button styling on dark navbar */
.navbar-nav .btn-outline-secondary {
  color: #e8eaed !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  margin-left: 0.5rem;
  transition: all 0.2s ease;
}

.navbar-nav .btn-outline-secondary:hover {
  background-color: rgba(255, 255, 255, 0.12) !important;
  border-color: #ffffff !important;
  color: #ffffff !important;
}

/* Mobile navbar toggle button */
.navbar-toggler {
  border: none;
  padding: 0.25rem 0.5rem;
  color: #e8eaed;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23e8eaed' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-toggler:focus {
  box-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Mobile menu background */
.navbar-collapse {
  padding-top: 0.5rem;
}

@media (max-width: 991px) {
  .navbar-nav .nav-item:nth-child(1)::after {
    display: none;
  }

  .navbar-nav .nav-link {
    color: #e8eaed !important;
    padding: 0.5rem 0 !important;
    margin: 0.25rem 0;
  }

  .navbar-nav .nav-link:hover,
  .navbar-nav .nav-link.active {
    background-color: transparent;
    border-bottom: none;
    padding-bottom: 0.5rem !important;
    color: #ffffff !important;
  }
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  border-radius: 0.375rem;
  font-weight: 500;
  font-size: 0.9375rem;
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.btn-primary {
  background-color: #1e3a5f;
  border-color: #1e3a5f;
  color: white;
}

.btn-primary:hover {
  background-color: #152a47;
  border-color: #152a47;
  box-shadow: 0 2px 4px rgba(30, 58, 95, 0.15);
}

.btn-primary:active {
  background-color: #0f1f33;
  border-color: #0f1f33;
}

.btn-outline-primary {
  color: #1e3a5f;
  border-color: #1e3a5f;
}

.btn-outline-primary:hover {
  background-color: #1e3a5f;
  border-color: #1e3a5f;
  color: white;
}

.btn-secondary {
  background-color: #5a6c7d;
  border-color: #5a6c7d;
}

.btn-secondary:hover {
  background-color: #4a5c6d;
  border-color: #4a5c6d;
}

.btn-outline-secondary {
  color: #5a6c7d;
  border-color: #5a6c7d;
}

.btn-outline-secondary:hover {
  background-color: #5a6c7d;
  border-color: #5a6c7d;
  color: white;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

/* ============================================
   Cards
   ============================================ */
.card {
  border: 1px solid #e0e3e8;
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  background-color: white;
  transition: all 0.2s ease;
}

.card:hover {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.card-body {
  padding: 1.5rem;
}

.card-title {
  color: #1a1a1a;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card-text {
  color: #4c5563;
  font-size: 0.9375rem;
}

.card-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid #e0e3e8;
  font-weight: 600;
  color: #1a1a1a;
  padding: 1rem 1.5rem;
}

/* ============================================
   Forms
   ============================================ */
.form-label {
  font-weight: 500;
  color: #1a1a1a;
  margin-bottom: 0.5rem;
  font-size: 0.9375rem;
}

.form-control,
.form-select {
  border: 1px solid #d0d4db;
  border-radius: 0.375rem;
  padding: 0.625rem 0.875rem;
  font-size: 0.9375rem;
  color: #1a1a1a;
  background-color: white;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: #1e3a5f;
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
  outline: none;
}

.form-control::placeholder {
  color: #9ca3af;
}

textarea.form-control {
  min-height: 120px;
}

/* ============================================
   Badges - Enhanced Visibility
   ============================================ */
.badge {
  border-radius: 0.375rem;
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 0.4rem 0.75rem;
  display: inline-block;
  border: none;
}

/* Success - Muted Dark Green with White Text */
.badge.bg-success {
  background-color: #3d7749 !important;
  color: #ffffff !important;
}

/* Warning - Muted Dark Amber with White Text */
.badge.bg-warning {
  background-color: #a58e1f !important;
  color: #ffffff !important;
}

/* Danger - Muted Dark Red with White Text */
.badge.bg-danger {
  background-color: #8b4444 !important;
  color: #ffffff !important;
}

/* Primary - Muted Dark Navy with White Text */
.badge.bg-primary {
  background-color: #1e3a5f !important;
  color: #ffffff !important;
}

/* Info - Muted Dark Blue with White Text */
.badge.bg-info {
  background-color: #3d5f8b !important;
  color: #ffffff !important;
}

/* Secondary - Muted Medium Slate with White Text */
.badge.bg-secondary {
  background-color: #6c757d !important;
  color: #ffffff !important;
}

/* Light - Light Gray with Dark Text (for non-status badges) */
.badge.bg-light {
  background-color: #e8eaed !important;
  color: #4c5563 !important;
  border: 1px solid #d0d4db;
}

/* Utility: Navy text on light background (for group name badges) */
.text-navy.badge,
.badge.text-navy {
  background-color: #f0f4f9 !important;
  color: #1e3a5f !important;
  border: 1px solid #d0d4db;
  font-weight: 600;
}

/* ============================================
   Alerts
   ============================================ */
.alert {
  border: 1px solid transparent;
  border-radius: 0.375rem;
  padding: 0.875rem 1rem;
  font-size: 0.9375rem;
}

.alert-primary {
  background-color: #e3f2fd;
  border-color: #bbdefb;
  color: #0d47a1;
}

.alert-success {
  background-color: #e8f5e9;
  border-color: #c8e6c9;
  color: #2d5016;
}

.alert-warning {
  background-color: #fff3e0;
  border-color: #ffe0b2;
  color: #5f4c00;
}

.alert-danger {
  background-color: #ffebee;
  border-color: #ffcdd2;
  color: #5a1a1a;
}

.alert-info {
  background-color: #e1f5fe;
  border-color: #b3e5fc;
  color: #01579b;
}

.alert-light {
  background-color: #f8f9fa;
  border-color: #e0e3e8;
  color: #4c5563;
}

/* ============================================
   Tables
   ============================================ */
.table {
  color: #1a1a1a;
  border-color: #e0e3e8;
}

.table thead {
  background-color: #f8f9fa;
  border-color: #e0e3e8;
}

.table thead th {
  font-weight: 600;
  color: #1a1a1a;
  border-color: #e0e3e8;
  padding: 0.875rem;
}

.table tbody tr {
  border-color: #e0e3e8;
}

.table tbody td {
  padding: 0.875rem;
  vertical-align: middle;
}

.table tbody tr:hover {
  background-color: #f8f9fa;
}

/* ============================================
   List Groups
   ============================================ */
.list-group {
  border-color: #e0e3e8;
}

.list-group-item {
  border-color: #e0e3e8;
  background-color: white;
  color: #1a1a1a;
  padding: 0.875rem 1rem;
}

.list-group-item:hover {
  background-color: #f8f9fa;
}

.list-group-item.active {
  background-color: #1e3a5f;
  border-color: #1e3a5f;
}

/* ============================================
   Stat Cards - Admin Dashboard
   ============================================ */
.stat-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 140px;
}

.stat-card-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1e3a5f;
  line-height: 1;
  margin-bottom: 0.75rem;
  letter-spacing: -1px;
}

.stat-card-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================
   Feature Icons & Step Numbers (Landing Page)
   ============================================ */
.icon-box {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  background-color: #e3f2fd;
  color: #1e3a5f;
  font-size: 1.375rem;
  margin-bottom: 1rem;
}

/* Secondary accent variant, used to alternate with the navy icon-box
   above on the homepage feature grid (kept muted, matches --bs-warning). */
.icon-box-gold {
  background-color: #f5ecd9;
  color: #b8923f;
}

.step-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background-color: #1e3a5f;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 auto 1rem;
}

/* Outline button variant used only by the homepage hero's "Get Started"
   CTA, to introduce the muted gold accent without touching the shared
   .btn-outline-primary used elsewhere in the app. */
.btn-outline-gold {
  color: #b8923f;
  border-color: #b8923f;
  background-color: transparent;
}

.btn-outline-gold:hover {
  background-color: #b8923f;
  border-color: #b8923f;
  color: #ffffff;
}

/* ============================================
   Links & Text Utilities
   ============================================ */
a {
  color: #1e3a5f;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #152a47;
  text-decoration: underline;
}

.text-muted {
  color: #6c757d !important;
}

.text-secondary {
  color: #5a6c7d !important;
}

.bg-light {
  background-color: #f8f9fa !important;
}

/* ============================================
   Utilities & Overrides
   ============================================ */
.border {
  border-color: #e0e3e8 !important;
}

.border-top {
  border-top-color: #e0e3e8 !important;
}

.border-bottom {
  border-bottom-color: #e0e3e8 !important;
}

.rounded-1 {
  border-radius: 0.375rem;
}

.rounded-2 {
  border-radius: 0.5rem;
}

.shadow-sm {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02) !important;
}

.shadow {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

.shadow-lg {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

/* ============================================
   Code & Pre
   ============================================ */
code {
  background-color: #f5f6f7;
  border-radius: 0.25rem;
  padding: 0.125rem 0.375rem;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.875rem;
  color: #0f1f33;
}

pre {
  background-color: #f5f6f7;
  border: 1px solid #e0e3e8;
  border-radius: 0.375rem;
  padding: 1rem;
  overflow-x: auto;
}

/* ============================================
   Utility Classes for Custom Spacing
   ============================================ */
.border-subtle {
  border-color: #e0e3e8 !important;
}

.text-navy {
  color: #1e3a5f;
}

.bg-navy {
  background-color: #1e3a5f;
}

.bg-navy-light {
  background-color: #e3f2fd;
}

.text-slate {
  color: #5a6c7d;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
  h1 {
    font-size: 1.75rem;
  }
  
  h2 {
    font-size: 1.25rem;
  }
  
  .display-5 {
    font-size: 2rem;
  }
  
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
  body {
    background-color: white;
  }
  
  .navbar,
  .btn-outline-secondary {
    display: none;
  }
}
