/* Bridge Builder Custom Styles - Navy, Mint, Black Background Theme */

/* Font Display Optimization for Performance */
@font-face {
  font-family: 'Font Awesome 6 Free';
  font-display: swap; /* Improves text visibility during font load */
}

/* Critical CSS - Above the fold */
.navbar { font-display: swap; }
.card { font-display: swap; }

/* Root Variables for Consistency */
:root {
  --bb-primary: #acede7;
  --bb-secondary: #ffffff;
  --bb-success: #acede7;
  --bb-info: #acede7;
  --bb-warning: #acede7;
  --bb-danger: #161d24;
  --bb-light: #ffffff;
  --bb-dark: #161d24;
  --bb-mint: #acede7;
  --bb-navy: #161d24;
  
  --bb-border-radius: 0.375rem;
  --bb-box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --bb-box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
  
  --bb-transition: all 0.15s ease-in-out;
  
  /* Override Bootstrap variables */
  --bs-primary: #acede7;
  --bs-primary-rgb: 172, 237, 231;
  --bs-secondary: #ffffff;
  --bs-success: #acede7;
  --bs-info: #acede7;
  --bs-warning: #acede7;
  --bs-danger: #161d24;
}

/* General Enhancements */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  background-color: #161d24 !important;
  color: #ffffff !important;
}

/* Text color fixes for mint backgrounds - section headers should be navy */
.card-header h1,
.card-header h2, 
.card-header h3,
.card-header h4,
.card-header h5,
.card-header h6,
.card-header .card-title {
  color: #161d24 !important;
}

/* Other elements with mint backgrounds */
.bg-primary,
.bg-primary *,
.btn-primary,
.btn-primary *,
.alert-info,
.alert-info * {
  color: #161d24 !important;
}

/* Table header styling - Force navy color on quiz table headers */
.table thead th,
.table-light thead th,
table thead th,
#quizTable thead th,
.card .table thead th,
.table > thead > tr > th {
    color: #161d24 !important;
    font-weight: 600 !important;
    border-bottom: 2px solid #161d24 !important;
}

/* Force white text ONLY for assigned quizzes card */
.assigned-quizzes-card,
.assigned-quizzes-card h6,
.assigned-quizzes-card h3,
.assigned-quizzes-card .card-title {
  color: #ffffff !important;
}

/* Force white text for Total Reviews and other specific elements */
.text-white,
.card.bg-primary .text-white,
.bg-primary small.text-white,
.total-reviews-card,
.total-reviews-card *,
.total-reviews-card h3,
.total-reviews-card small {
  color: #ffffff !important;
}

/* Navigation Enhancements */
.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  color: #acede7 !important;
}

.navbar-nav .nav-link {
  font-weight: 500;
  transition: var(--bb-transition);
  color: #ffffff !important;
}

.navbar-nav .nav-link:hover {
  transform: translateY(-1px);
  color: #acede7 !important;
}

.dropdown-menu {
  background-color: #161d24;
  border: 1px solid #acede7;
}

.dropdown-item {
  color: #ffffff !important;
}

.dropdown-item:hover {
  background-color: #acede7;
  color: #161d24 !important;
}

/* Card Enhancements */
.card {
  border: 2px solid #acede7;
  box-shadow: var(--bb-box-shadow);
  transition: var(--bb-transition);
  background-color: #161d24 !important;
  color: #ffffff !important;
}

.card:hover {
  box-shadow: var(--bb-box-shadow-lg);
  transform: translateY(-2px);
  border-color: #161d24;
}

.card-header {
  background-color: #acede7 !important;
  border-bottom: 1px solid #161d24;
  font-weight: 600;
  color: #161d24 !important;
}

/* Button Enhancements */
.btn {
  font-weight: 500;
  transition: var(--bb-transition);
  border-radius: var(--bb-border-radius);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
}

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

.btn-primary {
  background-color: #acede7 !important;
  border-color: #acede7 !important;
  color: #161d24 !important;
}

.btn-primary:hover {
  background-color: #161d24 !important;
  border-color: #161d24 !important;
  color: #ffffff !important;
}

.btn-secondary {
  background-color: #ffffff !important;
  border-color: #161d24 !important;
  color: #161d24 !important;
}

.btn-secondary:hover {
  background-color: #acede7 !important;
  border-color: #acede7 !important;
  color: #ffffff !important;
}

.btn-outline-primary {
  border-color: #acede7 !important;
  color: #acede7 !important;
  border-width: 2px !important;
  background-color: rgba(172, 237, 231, 0.1) !important;
}

.btn-outline-primary:hover {
  background-color: #acede7 !important;
  color: #161d24 !important;
  border-color: #acede7 !important;
}

.btn-outline-secondary {
  border-color: #ffffff !important;
  color: #ffffff !important;
  border-width: 2px !important;
  background-color: rgba(255, 255, 255, 0.1) !important;
}

.btn-outline-secondary:hover {
  background-color: #ffffff !important;
  color: #161d24 !important;
  border-color: #ffffff !important;
}

.btn-outline-success {
  border-color: #acede7 !important;
  color: #acede7 !important;
  border-width: 2px !important;
  background-color: rgba(172, 237, 231, 0.1) !important;
}

.btn-outline-success:hover {
  background-color: #acede7 !important;
  color: #161d24 !important;
  border-color: #acede7 !important;
}

.btn-outline-danger {
  border-color: #ff4757 !important;
  color: #ff4757 !important;
  border-width: 2px !important;
  background-color: rgba(255, 71, 87, 0.1) !important;
}

.btn-outline-danger:hover {
  background-color: #ff4757 !important;
  color: #ffffff !important;
  border-color: #ff4757 !important;
}

.btn-outline-warning {
  border-color: #ffa502 !important;
  color: #ffa502 !important;
  border-width: 2px !important;
  background-color: rgba(255, 165, 2, 0.1) !important;
}

.btn-outline-warning:hover {
  background-color: #ffa502 !important;
  color: #ffffff !important;
  border-color: #ffa502 !important;
}

.btn-outline-info {
  border-color: #70a1ff !important;
  color: #70a1ff !important;
  border-width: 2px !important;
  background-color: rgba(112, 161, 255, 0.1) !important;
}

.btn-outline-info:hover {
  background-color: #70a1ff !important;
  color: #ffffff !important;
  border-color: #70a1ff !important;
}

/* Quiz Specific Styles */
.choice-card {
  border: 2px solid #acede7;
  transition: var(--bb-transition);
  cursor: pointer;
  background-color: #161d24;
  color: #ffffff;
}

.choice-card:hover {
  border-color: #161d24;
  background-color: #acede7;
  color: #ffffff;
}

.form-check-input:checked ~ .form-check-label .choice-card {
  border-color: #161d24;
  background-color: #161d24;
  color: #ffffff;
}

.quiz-progress {
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
}

.quiz-progress .progress-bar {
  transition: width 0.6s ease;
}

/* Dashboard Enhancements */
.dashboard-stat-card {
  border-left: 4px solid;
  transition: var(--bb-transition);
}

.dashboard-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--bb-box-shadow-lg);
}

.dashboard-stat-card.primary {
  border-left-color: var(--bb-primary);
}

.dashboard-stat-card.success {
  border-left-color: var(--bb-success);
}

.dashboard-stat-card.info {
  border-left-color: var(--bb-info);
}

.dashboard-stat-card.warning {
  border-left-color: var(--bb-warning);
}

/* Badge Enhancements */
.badge {
  font-weight: 500;
  font-size: 0.75em;
  padding: 0.35em 0.65em;
}

.badge.badge-lg {
  font-size: 0.875em;
  padding: 0.5em 0.75em;
}

/* Table Enhancements */
.table {
  border-radius: var(--bb-border-radius);
  overflow: hidden;
  color: #ffffff !important;
}

.table thead th {
  border-bottom: 2px solid rgba(var(--bs-primary-rgb), 0.2);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.5px;
  color: #ffffff !important;
}

.table tbody tr {
  transition: var(--bb-transition);
}

.table tbody tr:hover {
  background-color: rgba(var(--bs-primary-rgb), 0.05);
}

.table tbody td {
  color: #ffffff !important;
}

/* Form Enhancements */
.form-control {
  border-radius: var(--bb-border-radius);
  border: 1px solid rgba(var(--bs-border-color), 0.5);
  transition: var(--bb-transition);
}

.form-control:focus {
  border-color: var(--bb-primary);
  box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

.form-label {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #ffffff !important;
}

/* Alert Enhancements */
.alert {
  border: none;
  border-left: 4px solid;
  border-radius: var(--bb-border-radius);
}

.alert-primary {
  border-left-color: var(--bb-primary);
  background-color: rgba(var(--bs-primary-rgb), 0.1);
  color: #ffffff !important;
}

.alert-success {
  border-left-color: var(--bb-success);
  background-color: rgba(var(--bs-success-rgb), 0.1);
  color: #ffffff !important;
}

.alert-warning {
  border-left-color: var(--bb-warning);
  background-color: rgba(var(--bs-warning-rgb), 0.1);
  color: #ffffff !important;
}

.alert-danger {
  border-left-color: var(--bb-danger);
  background-color: rgba(var(--bs-danger-rgb), 0.1);
  color: #ffffff !important;
}

.alert-info {
  border-left-color: var(--bb-info);
  background-color: rgba(var(--bs-info-rgb), 0.1);
  color: #ffffff !important;
}

/* Modal Enhancements */
.modal-content {
  border: none;
  border-radius: var(--bb-border-radius);
  box-shadow: var(--bb-box-shadow-lg);
}

.modal-header {
  background-color: rgba(var(--bs-primary-rgb), 0.05);
  border-bottom: 1px solid rgba(var(--bs-primary-rgb), 0.2);
}

/* Loading States */
.loading-spinner {
  width: 2rem;
  height: 2rem;
  border: 0.25em solid rgba(var(--bs-primary-rgb), 0.25);
  border-right-color: var(--bb-primary);
  border-radius: 50%;
  animation: spinner-border 0.75s linear infinite;
}

/* Avatar Styles */
.avatar-circle {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--bb-primary), var(--bb-info));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 1rem;
  transition: var(--bb-transition);
}

.avatar-circle:hover {
  transform: scale(1.1);
}

.avatar-circle.sm {
  width: 32px;
  height: 32px;
  font-size: 0.875rem;
}

.avatar-circle.lg {
  width: 48px;
  height: 48px;
  font-size: 1.25rem;
}

/* Timeline Styles */
.timeline {
  position: relative;
}

.timeline-item {
  position: relative;
  padding-bottom: 1.5rem;
}

.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 30px;
  bottom: -1.5rem;
  width: 2px;
  background-color: rgba(var(--bs-border-color-rgb), 0.5);
}

.timeline-marker {
  position: relative;
  z-index: 2;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: var(--bs-body-bg);
  border: 2px solid var(--bb-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bb-primary);
}

/* Progress Enhancements */
.progress {
  border-radius: var(--bb-border-radius);
  overflow: hidden;
}

.progress-bar {
  transition: width 0.6s ease;
}

/* Accessibility Enhancements */
.btn:focus,
.form-control:focus,
.form-select:focus {
  outline: 2px solid var(--bb-primary);
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #dee2e6;
  }
  
  .btn {
    display: none;
  }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .card {
    margin-bottom: 1rem;
  }
  
  .table-responsive {
    font-size: 0.875rem;
  }
  
  .btn-group {
    flex-direction: column;
  }
  
  .btn-group .btn {
    margin-bottom: 0.25rem;
  }
  
  .timeline-item .row {
    flex-direction: column;
  }
  
  .timeline-date {
    text-align: center !important;
    margin-bottom: 0.5rem;
  }
  
  .timeline-marker {
    margin: 0 auto 0.5rem;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .card {
    border: 2px solid var(--bs-border-color);
  }
  
  .btn {
    border-width: 2px;
  }
  
  .form-control {
    border-width: 2px;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(var(--bs-border-color-rgb), 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(var(--bs-border-color-rgb), 0.5);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--bs-border-color-rgb), 0.7);
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

.slide-up {
  animation: slideUp 0.5s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Utility Classes */
.text-gradient {
  background: linear-gradient(135deg, var(--bb-primary), var(--bb-info));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

.border-start-primary {
  border-left: 4px solid var(--bb-primary) !important;
}

.border-start-success {
  border-left: 4px solid var(--bb-success) !important;
}

.border-start-warning {
  border-left: 4px solid var(--bb-warning) !important;
}

.border-start-danger {
  border-left: 4px solid var(--bb-danger) !important;
}

.bg-gradient-primary {
  background: linear-gradient(135deg, var(--bb-primary), var(--bb-info));
}

.bg-gradient-success {
  background: linear-gradient(135deg, var(--bb-success), #20c997);
}

/* Feature Highlight */
.feature-highlight {
  position: relative;
  overflow: hidden;
}

.feature-highlight::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.feature-highlight:hover::before {
  left: 100%;
}

/* Tab Navigation Fixes - Override Bootstrap Purple Text */
.nav-tabs .nav-link {
  color: #ffffff !important;
  border: 1px solid rgba(172, 237, 231, 0.3);
  background-color: transparent;
  transition: var(--bb-transition);
  opacity: 0.7;
}

.nav-tabs .nav-link:hover {
  color: #ffffff !important;
  background-color: rgba(172, 237, 231, 0.2);
  border-color: #acede7;
  opacity: 0.9;
}

.nav-tabs .nav-link.active {
  color: #161d24 !important;
  background-color: #acede7 !important;
  border-color: #acede7 !important;
  opacity: 1;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(172, 237, 231, 0.3);
}

/* Spacious Dropdown Menu */
.dropdown-menu-spacious {
  min-width: 200px;
  padding: 0.75rem 0;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
}

.dropdown-menu-spacious .dropdown-item {
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  border-radius: 0;
  transition: var(--bb-transition);
}

.dropdown-menu-spacious .dropdown-item:hover {
  background-color: rgba(172, 237, 231, 0.1);
  padding-left: 1.75rem;
}

.dropdown-menu-spacious .dropdown-divider {
  margin: 0.5rem 1rem;
  opacity: 0.3;
}
