/* Base Styles */
:root {
  --primary: #4361ee;
  --primary-dark: #3a56d4;
  --secondary: #6c757d;
  --light: #f8f9fa;
  --dark: #212529;
  --success: #28a745;
  --info: #17a2b8;
  --warning: #ffc107;
  --danger: #dc3545;
  --white: #ffffff;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;
  --gray-900: #212529;
  --gray-50: #fafafa;
}

body {
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--gray-800);
  background-color: var(--gray-100);
}

/* Navigation */
.navbar {
  padding: 1rem 0;
  transition: all 0.3s ease;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.5px;
}

.nav-link {
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
}

.nav-link:after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 50%;
  background-color: var(--white);
  transition: all 0.3s ease;
}

.nav-link.active:after,
.nav-link:hover:after {
  width: 80%;
  left: 10%;
}

/* Hero Section */
.hero-section {
  padding: 5rem 0;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e7f0 100%);
}

.hero-section h1 {
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1.2;
}

.hero-section p {
  max-width: 540px;
}

.hero-section .btn {
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  border-radius: 30px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
}

.hero-section .btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(67, 97, 238, 0.4);
}

/* Features Section */
.features {
  padding: 5rem 0;
  background-color: var(--white);
}

.features h2 {
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 3rem;
}

.feature-card {
  border-radius: 12px;
  border: none;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.feature-icon {
  color: var(--dark);
  font-size: 2.5rem;
}

.feature-card h3 {
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--gray-800);
}

.feature-card p {
  color: var(--gray-600);
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* CTA Section */
.cta-section {
  padding: 4rem 0;
  background-color: var(--gray-100);
}

.cta-section h2 {
  font-weight: 700;
  color: var(--gray-800);
}

.cta-section .btn {
  padding: 0.75rem 1.75rem;
  font-weight: 600;
  border-radius: 30px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
}

/* Footer */
footer {
  padding: 3rem 0 2rem;
}

footer h5 {
  font-weight: 600;
  margin-bottom: 1.25rem;
}

footer a {
  text-decoration: none;
  transition: all 0.2s ease;
}

footer a:hover {
  color: var(--dark) !important;
  text-decoration: none;
}

/* Recommender Form Styles */
.card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.card-header {
  padding: 1.5rem;
  background: var(--dark);
  border-bottom: none;
}

.card-header h1 {
  font-weight: 700;
  font-size: 1.75rem;
}

.card-header h3 {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--gray-900);
}

.card-body {
  padding: 2rem;
}

.form-label {
  font-weight: 500;
  color: var(--gray-700);
}

.form-select,
.form-control {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--gray-300);
  transition: all 0.2s ease;
}

.form-select:focus,
.form-control:focus {
  border-color: var(--dark);
  box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.25);
}

.btn {
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.btn-primary {
  background-color: var(--dark);
  border-color: var(--dark);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--dark);
  border-color: var(--dark);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(67, 97, 238, 0.3);
}

.btn-outline-secondary:hover {
  transform: translateY(-2px);
}

/* Board Forms */
.board-form {
  padding: 1rem;
  background-color: var(--gray-100);
  border-radius: 8px;
  margin-top: 1rem;
}

/* Enhanced Results Styles - Professional Design */
#results {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--gray-200);
}

#loadingSpinner {
  display: block;
  margin: 2rem auto;
}

/* Remove the childish category labels */
.list-group-item.recommended::before,
.list-group-item.eligible::before {
  display: none;
}

/* Clean university card design */
.list-group-item {
  padding: 1.75rem;
  border: 1px solid var(--gray-200);
  border-radius: 12px !important;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.3s ease;
  background-color: var(--white);
  position: relative;
}

.list-group-item:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
  border-color: var(--dark);
}

/* Strongly Recommended styling */
.list-group-item.recommended {
  border-left: 4px solid #28a745;
  background: linear-gradient(135deg, rgba(40, 167, 69, 0.02) 0%, rgba(40, 167, 69, 0.05) 100%);
}

.list-group-item.recommended:hover {
  border-color: #28a745;
}

/* Eligible styling */
.list-group-item.eligible {
  border-left: 4px solid var(--dark);
  background: linear-gradient(135deg, rgba(67, 97, 238, 0.02) 0%, rgba(67, 97, 238, 0.05) 100%);
}

/* University item layout */
.university-item {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}

/* University header - clean layout */
.university-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

/* University name styling */
.university-name {
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--gray-900);
  margin: 0;
  line-height: 1.3;
  flex: 1;
}

/* Rank badge - professional design */
.university-rank {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-width: 80px;
  flex-shrink: 0;
}

.university-rank span {
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  font-size: 0.9rem;
  text-align: center;
  min-width: 60px;
}

/* General ranking */
.university-rank span:first-child {
  background-color: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}

/* Course ranking */
.university-rank span:nth-child(2) {
  background-color: rgba(67, 97, 238, 0.1);
  color: var(--dark);
  border: 1px solid rgba(67, 97, 238, 0.2);
  font-size: 0.8rem;
}

/* Requirements section */
.university-requirements {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.university-requirement {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  padding: 0.6rem 1rem;
  background-color: var(--gray-50);
  border-radius: 8px;
  border: 1px solid var(--gray-200);
  font-weight: 500;
}

.university-requirement .requirement-label {
  color: var(--gray-600);
  font-weight: 500;
}

.university-requirement .requirement-value {
  color: var(--gray-800);
  font-weight: 600;
}

.university-requirement .your-score {
  color: var(--dark);
  font-weight: 600;
}

/* Performance indicators */
.university-requirement.above-requirement {
  border-left: 3px solid #28a745;
  background-color: rgba(40, 167, 69, 0.03);
}

.university-requirement.below-requirement {
  border-left: 3px solid #ffc107;
  background-color: rgba(255, 193, 7, 0.03);
}

/* Tab styling improvements */
.nav-tabs {
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 1.5rem;
}

.nav-tabs .nav-link {
  font-weight: 600;
  color: var(--gray-600);
  border: none;
  border-bottom: 3px solid transparent;
  padding: 1rem 1.5rem;
  transition: all 0.2s ease;
  font-size: 1rem;
}

.nav-tabs .nav-link.active {
  color: var(--dark);
  border-bottom: 3px solid var(--dark);
  background-color: transparent;
}

.nav-tabs .nav-link:hover:not(.active) {
  color: var(--dark);
  border-bottom: 3px solid rgba(67, 97, 238, 0.3);
}

/* Badge styling */
.badge {
  font-weight: 600;
  padding: 0.4rem 0.7rem;
  border-radius: 20px;
}

.badge.bg-success {
  background-color: #28a745 !important;
}

.badge.bg-primary {
  background-color: var(--dark) !important;
}

/* Empty state improvements */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--gray-500);
}

.empty-state .icon {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  opacity: 0.3;
}

.empty-state h4 {
  color: var(--gray-600);
  margin-bottom: 1rem;
  font-weight: 600;
}

.empty-state p {
  margin-bottom: 0;
  font-size: 1rem;
  line-height: 1.5;
  max-width: 400px;
  margin: 0 auto;
}

/* Smooth transitions */
.tab-pane {
  animation: fadeIn 0.3s ease-in-out;
}

.tab-content {
  min-height: 200px;
}

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

/* Country flag */
.country-flag {
  width: 24px;
  height: 16px;
  margin-right: 0.5rem;
  object-fit: cover;
  border-radius: 2px;
}

/* Responsive styles */
@media (max-width: 992px) {
  .hero-section {
    text-align: center;
    padding: 4rem 0;
  }
  
  .hero-section p {
    margin: 0 auto;
  }
  
  .features {
    padding: 4rem 0;
  }
}

@media (max-width: 768px) {
  .hero-section {
    padding: 3rem 0;
  }
  
  .features h2 {
    margin-bottom: 2rem;
  }
  
  .university-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .university-rank {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    min-width: auto;
  }
  
  .university-name {
    font-size: 1.25rem;
  }
  
  .university-requirements {
    grid-template-columns: 1fr;
  }
  
  .list-group-item {
    padding: 1.5rem;
  }
  
  .nav-tabs .nav-link {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }
  
  .card-body {
    padding: 1.5rem;
  }
}

@media (max-width: 576px) {
  .hero-section h1 {
    font-size: 2rem;
  }
  
  .feature-card {
    margin-bottom: 1.5rem;
  }
  
  .card-header h1 {
    font-size: 1.5rem;
  }
  
  .university-name {
    font-size: 1.1rem;
  }
  
  .university-rank span {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    min-width: 50px;
  }
  
  .university-rank span:nth-child(2) {
    font-size: 0.75rem;
  }
}