/* Custom CSS for ULM Research Portal */

:root {
  --primary-color: #fbbf24;
  --secondary-color: #10b981;
  --accent-color: #3b82f6;
  --dark-color: #1e293b;
  --light-gray: #f8fafc;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
}

/* Header Styles */
.nav-link {
  color: #374151 !important;
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: var(--primary-color) !important;
}

/* Search Section */
.search-section {
  background: linear-gradient(to bottom, rgba(251, 191, 36, 0.05), rgba(255, 255, 255, 1));
  background-size: cover;
}

.search-input {
  border: 2px solid #d1d5db;
  transition: all 0.3s ease;
}

.search-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(251, 191, 36, 0.2);
}

/* Divider Styles */
.divider-line {
  height: 1px;
  background: linear-gradient(to right, transparent, #e5e7eb, transparent);
  flex: 1;
}

.divider-dot {
  width: 8px;
  height: 8px;
  background-color: var(--primary-color);
  border-radius: 50%;
}

.faculty-divider-dot {
  width: 12px;
  height: 12px;
  background: linear-gradient(45deg, #fbbf24, #f59e0b);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(251, 191, 36, 0.3);
}

/* COVID Alert */
.covid-alert {
  background-color: rgba(59, 130, 246, 0.1) !important;
  border: 1px solid rgba(59, 130, 246, 0.2) !important;
  border-radius: 0.5rem;
}

/* Welcome Section */
.welcome-section {
  background-color: rgba(248, 250, 252, 0.5);
}

/* SDG Section */
.sdg-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.sdg-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.sdg-number {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.875rem;
}

/* Added SDG goal card styling to match UN SDG design */
.sdg-goal-card {
  aspect-ratio: 1;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: visible; /* Changed from hidden to visible for tooltip */
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 1; /* Base z-index for cards */
}

.sdg-goal-card:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  z-index: 2; /* Slightly higher when hovered */
}

.sdg-goal-content {
  text-align: center;
  padding: 12px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

.sdg-goal-number {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 8px;
}

.sdg-goal-icon {
  font-size: 1.5rem;
  margin: 8px 0;
  opacity: 0.9;
}

.sdg-goal-title {
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: auto;
  text-align: center;
  word-wrap: break-word;
  hyphens: auto;
}

/* SDG specific color overrides for better contrast */
.sdg-goal-card.bg-warning {
  background-color: #f59e0b !important;
}

.sdg-goal-card.bg-danger {
  background-color: #dc2626 !important;
}

.sdg-goal-card.bg-success {
  background-color: #059669 !important;
}

.sdg-goal-card.bg-info {
  background-color: #0891b2 !important;
}

.sdg-goal-card.bg-primary {
  background-color: #2563eb !important;
}

/* Responsive adjustments for SDG cards */
@media (max-width: 576px) {
  .sdg-goal-card {
    min-height: 100px;
  }

  .sdg-goal-number {
    font-size: 1.5rem;
  }

  .sdg-goal-icon {
    font-size: 1.2rem;
  }

  .sdg-goal-title {
    font-size: 0.6rem;
  }
}

@media (min-width: 992px) {
  .sdg-goal-card {
    min-height: 140px;
  }

  .sdg-goal-number {
    font-size: 2.5rem;
  }

  .sdg-goal-icon {
    font-size: 1.8rem;
  }

  .sdg-goal-title {
    font-size: 0.7rem;
  }
}

/* Faculty Section */
.faculty-section {
  background-color: rgba(248, 250, 252, 0.3);
}

.faculty-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.faculty-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.faculty-card:hover .card-title {
  color: var(--accent-color);
}

.faculty-card:hover .faculty-icon {
  color: var(--secondary-color);
}

/* Collaboration Section */
.collaboration-section {
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 50%, rgba(219, 234, 254, 0.3) 100%);
}

.collaboration-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, transparent, rgba(251, 191, 36, 0.05), transparent);
  border-radius: 0.5rem;
}

.collaboration-title {
  background: linear-gradient(to right, #1e293b, #374151, #1e293b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: #1e293b;
}

.world-map-placeholder {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Footer */
.social-icon {
  width: 20px;
  height: 20px;
  cursor: pointer;
  transition: color 0.3s ease;
}

.social-icon:hover {
  color: var(--primary-color);
}

.footer-link {
  color: #d1d5db;
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: var(--primary-color);
}

.contact-info .small {
  color: #d1d5db;
}

/* Simplified back-to-top button for use with mrd-smoothscroller */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
  border: none;
  cursor: pointer;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(251, 191, 36, 0.4);
  background-color: #f59e0b !important;
}

/* Facilities Grid Layout - Remove CSS Grid to use Bootstrap Grid */
/* .facilities-grid styles removed to prevent conflict with Bootstrap */

/* Facility Card Styles */
.facility-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.facility-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-color);
}

.facility-card .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.facility-card .card-footer {
  margin-top: auto;
}

/* Ensure Bootstrap grid works properly for facilities */
#facilitiesContainer.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -0.75rem;
  margin-left: -0.75rem;
}

#facilitiesContainer.row > * {
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  padding-right: 0.75rem;
  padding-left: 0.75rem;
  margin-bottom: 1.5rem;
}

/* Bootstrap responsive grid classes for facilities */
@media (min-width: 768px) {
  #facilitiesContainer.row .col-md-6 {
    flex: 0 0 auto;
    width: 50%;
  }
}

@media (min-width: 992px) {
  #facilitiesContainer.row .col-lg-4 {
    flex: 0 0 auto;
    width: 33.333333%;
  }
}

/* Ensure cards have equal height in Bootstrap grid */
#facilitiesContainer.row .col-md-6,
#facilitiesContainer.row .col-lg-4 {
  display: flex;
}

#facilitiesContainer.row .col-md-6 .card,
#facilitiesContainer.row .col-lg-4 .card {
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* Badge styling improvements */
.badge.bg-light {
  color: #6b7280 !important;
  background-color: #f3f4f6 !important;
  border: 1px solid #e5e7eb;
}

/* Enhanced responsive design for mobile devices */
@media (max-width: 768px) {
  .display-5 {
    font-size: 2rem;
  }

  .display-6 {
    font-size: 1.75rem;
  }

  .lead {
    font-size: 1rem;
  }

  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    font-size: 16px;
  }
}

/* Enhanced accessibility and reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .back-to-top,
  .sdg-card,
  .faculty-card,
  .sdg-goal-card {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}

/* Enhanced focus styles for better accessibility */
.back-to-top:focus,
.sdg-card:focus,
.faculty-card:focus,
.sdg-goal-card:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Added SDG stats box hover effects and styling */
.hover-bg-white {
  transition: background-color 0.2s ease;
}

.hover-bg-white:hover {
  background-color: white !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#sdg-stats a {
  transition: all 0.2s ease;
}

#sdg-stats a:hover {
  transform: translateY(-1px);
}

#sdg-stats .card {
  transition: all 0.3s ease;
}

/* Added tooltip-style overlay for SDG stats */
.sdg-stats-tooltip {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999; /* Increased from 1000 to 9999 */
  background: white;
  border-radius: 8px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2); /* Enhanced shadow */
  border: 1px solid #e5e7eb;
  padding: 16px;
  margin-top: 12px; /* Increased margin for better spacing */
  min-width: 220px; /* Slightly wider */
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none; /* Prevent interference when hidden */
}

.sdg-stats-tooltip.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto; /* Enable interactions when visible */
}

.sdg-stats-tooltip::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid white;
  filter: drop-shadow(0 -2px 2px rgba(0, 0, 0, 0.1));
  z-index: 10000; /* Ensure arrow is also above everything */
}

.sdg-stats-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
  margin-bottom: 8px;
}

.sdg-stats-item:last-child {
  margin-bottom: 0;
}

.sdg-stats-item:hover {
  background-color: #f8fafc;
  transform: translateY(-1px);
  text-decoration: none;
  color: inherit;
}

.sdg-stats-icon {
  width: 24px;
  height: 24px;
  margin-right: 12px;
  color: #6b7280;
}

.sdg-stats-count {
  font-weight: 600;
  color: #f59e0b;
  margin-right: 8px;
}

.sdg-stats-label {
  color: #374151;
  font-size: 0.875rem;
}

/* Ensure SDG container doesn't clip tooltips */
#sdg-section {
  overflow: visible !important;
}

#sdg-section .container {
  overflow: visible !important;
}

#sdg-section .row {
  overflow: visible !important;
}
