/* ==========================================================================
   Academic Laboratory Website Stylesheet - Modeled after MMLab@NTU
   PI: LIU WENDI (wendi005@e.ntu.edu.sg)
   ========================================================================== */

:root {
  --primary-color: #b5121b;       /* NTU Red accent */
  --primary-hover: #8f0d14;
  --secondary-color: #1e3a8a;     /* Deep academic cobalt blue */
  --secondary-hover: #172554;
  --dark-bg: #0f172a;             /* Slate 900 */
  --darker-bg: #090d16;
  --card-bg: #ffffff;
  --light-bg: #f8fafc;
  --border-color: #e2e8f0;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: "Oswald", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --max-width: 1200px;
  --transition: all 0.25s ease-in-out;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.12);
  --radius: 8px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  color: var(--text-main);
  background-color: #ffffff;
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: var(--transition);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 72px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
}

.brand-logo {
  height: 38px;
  width: auto;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #ffffff;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-name span {
  color: var(--primary-color);
}

.brand-affiliation {
  font-size: 0.72rem;
  color: var(--text-light);
  font-weight: 500;
  letter-spacing: 1px;
}

.nav-menu {
  display: flex;
  list-style: none;
  align-items: center;
  gap: 28px;
}

.nav-item a {
  color: #cbd5e1;
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  position: relative;
  padding: 8px 0;
  transition: var(--transition);
}

.nav-item a:hover,
.nav-item a.active {
  color: #ffffff;
}

.nav-item a.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2.5px;
  background-color: var(--primary-color);
  border-radius: 2px;
}

/* Nav Dropdown */
.nav-dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: var(--radius);
  list-style: none;
  min-width: 170px;
  padding: 8px 0;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: var(--transition);
}

.nav-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu li a {
  display: block;
  padding: 8px 16px;
  color: #94a3b8;
  font-size: 0.9rem;
}

.dropdown-menu li a:hover {
  background: #1e293b;
  color: #ffffff;
}

/* Mobile Toggle */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.6rem;
  cursor: pointer;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  position: relative;
  background: linear-gradient(135deg, #090d16 0%, #0f172a 60%, #1e293b 100%);
  color: #ffffff;
  padding: 160px 0 100px 0;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 75% 30%, rgba(181, 18, 27, 0.15), transparent 45%),
              radial-gradient(circle at 20% 70%, rgba(30, 58, 138, 0.25), transparent 50%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 850px;
}

.hero-badge {
  display: inline-block;
  background: rgba(181, 18, 27, 0.18);
  border: 1px solid rgba(181, 18, 27, 0.4);
  color: #fca5a5;
  padding: 4px 14px;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 20px;
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}

.hero-title span {
  color: var(--primary-color);
}

.hero-lead {
  font-size: 1.18rem;
  color: #cbd5e1;
  margin-bottom: 36px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 24px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
}

.btn-primary {
  background-color: var(--primary-color);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-outline-light {
  background-color: transparent;
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
}

.btn-outline-light:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: #ffffff;
  color: #ffffff;
  text-decoration: none;
}

.btn-secondary {
  background-color: #1e293b;
  color: #ffffff;
}

.btn-secondary:hover {
  background-color: #334155;
  color: #ffffff;
  text-decoration: none;
}

/* ==========================================================================
   Section Layouts
   ========================================================================== */
.section {
  padding: 85px 0;
}

.section-light {
  background-color: var(--light-bg);
}

.section-dark {
  background-color: var(--dark-bg);
  color: #ffffff;
}

.section-header {
  margin-bottom: 48px;
}

.section-header.text-center {
  text-align: center;
}

.section-tag {
  color: var(--primary-color);
  text-transform: uppercase;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 2px;
  display: block;
  margin-bottom: 8px;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.section-dark .section-title {
  color: #ffffff;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-top: 8px;
  max-width: 680px;
}

.section-dark .section-subtitle {
  color: var(--text-light);
}

/* ==========================================================================
   PI Profile Card (Sidebar Layout)
   ========================================================================== */
.pi-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 48px;
  align-items: start;
}

.pi-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 28px;
  box-shadow: var(--shadow-md);
  text-align: center;
  position: sticky;
  top: 100px;
}

.pi-avatar {
  width: 100%;
  max-width: 250px;
  border-radius: 10px;
  margin: 0 auto 20px auto;
  box-shadow: var(--shadow-sm);
  display: block;
}

.pi-name {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.pi-role {
  font-size: 0.92rem;
  color: var(--primary-color);
  font-weight: 600;
  margin-bottom: 12px;
}

.pi-institution {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 18px;
}

.pi-contact-list {
  list-style: none;
  text-align: left;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
  margin-bottom: 20px;
  font-size: 0.88rem;
}

.pi-contact-list li {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
}

.pi-contact-list strong {
  color: var(--text-main);
  min-width: 60px;
}

.pi-social-links {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--light-bg);
  color: var(--text-main);
  border-radius: 50%;
  font-size: 0.9rem;
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.social-btn:hover {
  background: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
  text-decoration: none;
}

.pi-bio-content {
  font-size: 1.02rem;
  color: #334155;
  line-height: 1.8;
}

.pi-bio-content p {
  margin-bottom: 18px;
  text-align: justify;
}

/* Research Highlights Grid */
.research-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  margin-top: 24px;
}

.research-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.research-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.research-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: #0f172a;
}

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

.research-card-title {
  font-size: 1.22rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 10px;
}

.research-card-desc {
  font-size: 0.94rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
  flex-grow: 1;
}

/* ==========================================================================
   News List Section
   ========================================================================== */
.news-list {
  list-style: none;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 8px 24px;
  box-shadow: var(--shadow-sm);
}

.news-item {
  display: flex;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
  align-items: baseline;
}

.news-item:last-child {
  border-bottom: none;
}

.news-date {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-color);
  min-width: 95px;
  background: rgba(181, 18, 27, 0.08);
  padding: 4px 10px;
  border-radius: 4px;
  text-align: center;
}

.news-text {
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.6;
}

/* ==========================================================================
   Team Members Grid
   ========================================================================== */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 28px;
}

.team-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.team-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.team-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  margin: 0 auto 16px auto;
  object-fit: cover;
  background: #e2e8f0;
  border: 3px solid #f1f5f9;
}

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

.team-role {
  font-size: 0.85rem;
  color: var(--primary-color);
  font-weight: 600;
  margin-bottom: 8px;
}

.team-research {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.4;
}

.team-links {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.team-links a {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--light-bg);
}

.team-links a:hover {
  color: var(--primary-color);
  background: #f1f5f9;
  text-decoration: none;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background-color: var(--darker-bg);
  color: #94a3b8;
  padding: 70px 0 30px 0;
  border-top: 1px solid #1e293b;
  font-size: 0.92rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-col h4 {
  color: #ffffff;
  font-size: 1.1rem;
  margin-bottom: 20px;
  font-weight: 700;
}

.footer-col p {
  line-height: 1.7;
  margin-bottom: 12px;
}

.footer-links {
  list-style: none;
}

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

.footer-links a {
  color: #94a3b8;
}

.footer-links a:hover {
  color: #ffffff;
  text-decoration: none;
}

.footer-bottom {
  border-top: 1px solid #1e293b;
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #64748b;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 992px) {
  .pi-grid {
    grid-template-columns: 1fr;
  }
  .pi-card {
    position: static;
    max-width: 480px;
    margin: 0 auto;
  }
  .hero-title {
    font-size: 2.3rem;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .mobile-toggle {
    display: block;
  }
  .nav-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 72px;
    left: 0;
    width: 100%;
    background: #0f172a;
    padding: 24px;
    border-bottom: 1px solid #1e293b;
  }
  .nav-menu.is-active {
    display: flex;
  }
  .hero-title {
    font-size: 1.9rem;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}
