/* ============================================
   Faculty Directory — Premium Stylesheet
   ============================================ */

/* --- CSS Variables --- */
:root {
  --primary: #6D28D9;
  --primary-dark: #5B21B6;
  --secondary: #8B5CF6;
  --bg: #F8FAFC;
  --card: #FFFFFF;
  --border: #E5E7EB;
  --text: #111827;
  --text-light: #6B7280;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 20px 48px rgba(109, 40, 217, 0.12);
  --transition: 0.3s ease;
  --navbar-height: 72px;
}

/* --- Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}


body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}



.section-label {
  display: inline-block;
  font-size: 1.25rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(3.75rem, 4vw, 2.5rem);
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-light);
  /*max-width: 560px;*/
  margin-bottom:40px;
}


/* --- Faculty Cards --- */


.faculty-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: visible;
  transition: all var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
  opacity: 1;
  position: relative;
}

.faculty-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: rgba(109, 40, 217, 0.15);
}

.faculty-card-image-wrapper {
  position: relative;
  overflow: hidden;
  height: 280px;
  border-radius: var(--radius) var(--radius) 0 0;
}

.faculty-card-image {
  width: 100%;
  height: 110%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.faculty-card:hover .faculty-card-image {
  transform: scale(1.08);
}


#facultyGrid {
  display: flex;
  flex-wrap: wrap;
}

#facultyGrid > .faculty-card-col {
  display: flex;
  margin-bottom: 24px;
}

#facultyGrid .faculty-card {
  width: 100%;
}

.faculty-card-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 50px;
  border: 1px solid rgba(109, 40, 217, 0.15);
}

.faculty-card-favorite {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-light);
}

.faculty-card-favorite:hover,
.faculty-card-favorite.active {
  color: #EF4444;
  border-color: #FECACA;
  background: #FEF2F2;
}

.faculty-card-favorite.active i {
  fill: #EF4444;
}

.faculty-card-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.faculty-card-name {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}

.faculty-card-designation {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 16px;
}

.h6{
  color: var(--primary);
}

.faculty-card-research {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.faculty-card-contact {
  margin-bottom: 20px;
}

.faculty-card-contact-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 6px;
}

.faculty-card-contact-item i {
  color: var(--primary);
  font-size: 0.85rem;
  width: 16px;
}

.faculty-card-contact-item a {
  color: var(--text-light);
  transition: color var(--transition);
}

.faculty-card-contact-item a:hover {
  color: var(--primary);
}

.btn-view-profile {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: rgb(253, 253, 253);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0d50ba 0%, #1a73e8 100%);
  margin-top: auto;

}

.btn-view-profile::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #0d50ba 0%, #1a73e8 100%);
  transform: translateX(-100%);
  transition: transform 0.35s ease;
  z-index: 0;
}

.btn-view-profile span,
.btn-view-profile i {
  position: relative;
  z-index: 1;
  transition: color var(--transition);
}

.faculty-card:hover .btn-view-profile::after,
.btn-view-profile:hover::after {
  transform: translateX(0);
}

.faculty-card:hover .btn-view-profile span,
.faculty-card:hover .btn-view-profile i,
.btn-view-profile:hover span,
.btn-view-profile:hover i {
  color: #fff;
}

.faculty-card:hover .btn-view-profile,
.btn-view-profile:hover {
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18);
}

.no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.no-results i {
  font-size: 3rem;
  color: var(--border);
  margin-bottom: 16px;
}

/* --- Profile Page --- */
.profile-hero {
  position: relative;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  padding: 120px 0 100px;
  margin-top: calc(-1 * var(--navbar-height));
  padding-top: calc(120px + var(--navbar-height));
  overflow: hidden;
}

.profile-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('https://images.unsplash.com/photo-1541339907198-e08756dedf3d?w=1920&h=600&fit=crop') center/cover;
  opacity: 0.15;
}

.profile-hero-content {
  position: relative;
  z-index: 2;
}

.profile-image-wrapper {
  width: 200px;
  height: 200px;
  border-radius: 24px;
  overflow: hidden;
  border: 4px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.profile-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-name {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}

.profile-designation {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 4px;
}

.profile-department {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50px;
  padding: 6px 16px;
  font-size: 0.85rem;
  color: #fff;
  margin-bottom: 20px;
}

.profile-contact-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.profile-contact-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
}

.profile-contact-item i {
  font-size: 1rem;
}

.profile-contact-item a {
  color: rgba(255, 255, 255, 0.9);
}

.profile-contact-item a:hover {
  color: #fff;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  padding: 10px 20px;
  border-radius: 50px;
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 32px;
  transition: all var(--transition);
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  transform: translateX(-4px);
}

.profile-content {
  padding: 60px 0 100px;
}

.profile-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
  transition: box-shadow var(--transition);
}

.profile-card:hover {
  box-shadow: var(--shadow);
}

.profile-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.profile-card-title i {
  color: var(--primary);
  font-size: 1.2rem;
}

.profile-message {
  background: linear-gradient(135deg, rgba(109, 40, 217, 0.06), rgba(139, 92, 246, 0.06));
  border: 1px solid rgba(109, 40, 217, 0.12);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
  position: relative;
}

.profile-message::before {
  content: '\201C';
  position: absolute;
  top: 12px;
  left: 24px;
  font-size: 4rem;
  color: var(--primary);
  opacity: 0.15;
  line-height: 1;
  font-family: Georgia, serif;
}

.profile-message p {
  font-size: 1.05rem;
  font-style: italic;
  color: var(--text);
  line-height: 1.8;
  padding-left: 20px;
  margin: 0;
}

.profile-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.profile-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  color: var(--text-light);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.profile-list li:last-child {
  border-bottom: none;
}

.profile-list li i {
  color: var(--primary);
  margin-top: 4px;
  flex-shrink: 0;
}

.profile-bio {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.8;
}

.social-links {
  display: flex;
  gap: 12px;
}

.social-link {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  transition: all var(--transition);
  font-size: 1.1rem;
}

.social-link:hover {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(109, 40, 217, 0.3);
}

.profile-not-found {
  text-align: center;
  padding: 120px 20px;
}

.profile-not-found i {
  font-size: 4rem;
  color: var(--border);
  margin-bottom: 24px;
}

.profile-not-found h2 {
  margin-bottom: 12px;
}

.profile-not-found p {
  color: var(--text-light);
  margin-bottom: 32px;
}

/* --- Footer --- */
.footer {
  background: var(--text);
  color: rgba(255, 255, 255, 0.7);
  padding: 60px 0 30px;
}

.footer-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}

.footer-text {
  font-size: 0.9rem;
  line-height: 1.7;
  max-width: 320px;
}

.footer-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  margin-bottom: 20px;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  transition: color var(--transition);
}

.footer-links a:hover {
  color: #fff;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 48px;
  padding-top: 24px;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

/* --- Animations --- */
.fade-in {
  opacity: 1;
  transform: translateY(0);
}

#statsContainer > .col-6:nth-child(1) { transition-delay: 0s; }
#statsContainer > .col-6:nth-child(2) { transition-delay: 0.1s; }
#statsContainer > .col-6:nth-child(3) { transition-delay: 0.2s; }
#statsContainer > .col-6:nth-child(4) { transition-delay: 0.3s; }

.research-image {
  height: 320px;
  object-fit: cover;
}

.contact-icon {
  color: var(--primary) !important;
}

/* --- Profile Popup (per card) --- */
.card-profile-toggle {
  display: none !important;
}

.card-profile-popup {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 3000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card-profile-toggle:checked ~ .card-profile-popup {
  display: flex;
}

.card-profile-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  cursor: pointer;
}

.card-profile-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  max-height: min(80vh, 640px);
  overflow-y: auto;
  background: #fff;
  border-radius: 20px;
  padding: 48px 40px 36px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
}

.card-profile-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.card-profile-close:hover {
  color: var(--text);
  border-color: rgba(109, 40, 217, 0.25);
  background: var(--bg);
}

.card-profile-text {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.75;
  text-align: justify;
}

label.btn-view-profile {
  cursor: pointer;
  margin-bottom: 0;
  user-select: none;
}

/* --- Responsive --- */
@media (max-width: 991.98px) {
  section {
    padding: 60px 0;
  }

  .search-card {
    padding: 28px;
  }

  .profile-image-wrapper {
    width: 160px;
    height: 160px;
    margin-bottom: 24px;
  }
}

@media (max-width: 767.98px) {
  :root {
    --navbar-height: 64px;
  }

  section {
    padding: 48px 0;
  }

  .hero-content {
    padding: 100px 20px 60px;
  }

  .search-section {
    margin-top: -60px;
    padding-bottom: 48px;
  }

  .search-card {
    padding: 24px;
    border-radius: 16px;
  }

  .faculty-card-image-wrapper {
    height:430px;
  }

  .profile-hero {
    padding: 100px 0 60px;
    padding-top: calc(100px + var(--navbar-height));
  }

  .profile-card {
    padding: 24px;
  }

  .dept-chip {
    padding: 10px 18px;
    font-size: 0.85rem;
  }

  .card-profile-popup {
    padding: 16px;
  }

  .card-profile-dialog {
    padding: 44px 24px 28px;
    border-radius: 16px;
  }
}

@media (max-width: 575.98px) {
  .hero-cta-group {
    flex-direction: column;
    align-items: center;
  }

  .btn-hero-primary,
  .btn-hero-secondary {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }

  .stat-card {
    padding: 24px 16px;
  }
}
