/* ============================================================
   BIDD Homepage - Glassmorphism UI Design
   ============================================================ */

/* ========== CSS Variables ========== */
:root {
  --color-primary: #038d84;
  --color-primary-light: #04b3a6;
  --color-primary-dark: #026b65;
  --color-dark: #0d0e0f;
  --color-dark-alt: #1a1c1e;
  --color-light: #f8f9fa;
  --color-light-alt: #f1f3f3;
  --color-text-dark: #2d3436;
  --color-text-light: #ffffff;
  --color-text-muted: #636e72;
  --color-text-light-muted: #b2bec3;

  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 32px;
  --space-xl: 48px;
  --space-2xl: 64px;

  --font-primary: 'Actor', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 50%;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
  --shadow-glow: 0 0 20px rgba(3, 141, 132, 0.3);

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-bg-light: rgba(255, 255, 255, 0.15);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-blur: blur(12px);
  --glass-blur-strong: blur(20px);

  --navbar-height: 80px;
  --navbar-height-mobile: 60px;
  --container-max: 1200px;
}

/* ========== Reset ========== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text-dark);
  background: var(--color-light);
  overflow-x: hidden;
}

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

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease;
}

ul { list-style: none; }

/* ========== Skip Nav ========== */
.skip-nav {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-primary);
  color: white;
  padding: var(--space-sm) var(--space-md);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  z-index: 9999;
}

.skip-nav:focus { top: 0; }

/* ========== Glassmorphism Components ========== */
.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
}

.glass-strong {
  background: var(--glass-bg-light);
  backdrop-filter: var(--glass-blur-strong);
  -webkit-backdrop-filter: var(--glass-blur-strong);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
}

/* ========== Navigation ========== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(13, 14, 15, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.3s ease;
}

.site-header.scrolled {
  background: rgba(13, 14, 15, 0.95);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--navbar-height);
  padding: 0 5%;
  max-width: var(--container-max);
  margin: 0 auto;
}

.nav-logo a { display: block; }

.nav-logo img {
  height: 45px;
  width: auto;
  transition: transform 0.3s ease;
}

.nav-logo img:hover { transform: scale(1.05); }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-menu a {
  display: block;
  padding: 10px 16px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  position: relative;
  transition: all 0.2s ease;
}

.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--color-primary-light);
  transition: all 0.3s ease;
  transform: translateX(-50%);
  border-radius: 2px;
}

.nav-menu a:hover {
  color: white;
  background: rgba(255, 255, 255, 0.08);
}

.nav-menu a:hover::after { width: 50%; }

.nav-menu a.active {
  color: white;
  font-weight: 600;
}

.nav-menu a.active::after { width: 50%; }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.hamburger-line {
  display: block;
  width: 22px;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger-line:nth-child(1) { transform: translateY(-7px); }
.hamburger-line:nth-child(2) { transform: translateY(0); }
.hamburger-line:nth-child(3) { transform: translateY(7px); }

.nav-toggle.active .hamburger-line:nth-child(1) { transform: rotate(45deg); }
.nav-toggle.active .hamburger-line:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.active .hamburger-line:nth-child(3) { transform: rotate(-45deg); }

/* Mobile Nav Overlay */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nav-overlay.active { opacity: 1; }

/* ========== Hero Section ========== */
.hero-section {
  position: relative;
  width: 100%;
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--navbar-height) + 60px) 5% 60px;
  background: rgba(255, 255, 255, 0.6);
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(3, 141, 132, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(3, 141, 132, 0.06) 0%, transparent 40%);
  pointer-events: none;
}

/* Floating decorative elements */
.hero-section::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(3, 141, 132, 0.06) 0%, transparent 70%);
  top: 10%;
  right: -100px;
  animation: float 8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-30px) rotate(5deg); }
}

.hero-content {
  position: relative;
  max-width: 900px;
  text-align: center;
  animation: fadeInUp 0.8s ease-out;
}

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

.hero-title {
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--color-text-dark);
  margin-bottom: var(--space-md);
  line-height: 1.2;
}

.hero-title img {
  height: 70px;
  vertical-align: middle;
  margin: 0 8px;
}

.hero-subtitle {
  font-size: 1.3rem;
  color: var(--color-primary);
  font-weight: 600;
  margin-bottom: var(--space-lg);
}

.hero-text {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  line-height: 1.8;
  margin-bottom: var(--space-lg);
}

/* ========== Sections ========== */
.section {
  width: 100%;
  padding: var(--space-2xl) 5%;
}

.section-dark {
  background: rgba(15, 20, 25, 0.55);
  backdrop-filter: blur(4px);
  color: white;
}

.section-light { background: #f8f9fa; }
.section-alt { background: var(--color-light-alt); }

.section-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.section-header h1 {
  font-size: 2rem;
  font-weight: 700;
  position: relative;
  display: inline-block;
}

.section-header h1::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
  border-radius: 2px;
}

/* ========== Glass Cards ========== */
.glass-card {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.glass-card:hover {
  transform: translateY(-8px) scale(1.02);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(3, 141, 132, 0.4);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.2),
    0 0 30px rgba(3, 141, 132, 0.1);
}

/* Light glass card */
.glass-card-light {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.glass-card-light:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
  border-color: var(--color-primary);
}

/* ========== People Section ========== */
.people-intro {
  display: flex;
  align-items: flex-start;
  gap: var(--space-xl);
  max-width: 1100px;
  margin: 0 auto var(--space-xl);
}

.people-photo {
  flex: 0 0 260px;
  text-align: right;
}

.people-photo img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.people-bio { flex: 1; }

.people-bio h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
  color: var(--color-text-light);
}

.people-bio .people-title {
  font-size: 1.1rem;
  color: var(--color-primary-light);
  margin-bottom: var(--space-md);
}

.people-bio p {
  color: var(--color-text-light-muted);
  line-height: 1.8;
  margin-bottom: var(--space-sm);
}

.people-bio a {
  color: var(--color-primary-light);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.people-bio a:hover { color: var(--color-primary); }

/* Team Grid */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-lg);
  max-width: var(--container-max);
  margin: 0 auto;
}

.team-member {
  text-align: center;
  padding: var(--space-lg) var(--space-md);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.team-member:hover {
  transform: translateY(-8px);
}

.team-member img {
  width: 110px;
  height: 110px;
  border-radius: var(--radius-full);
  object-fit: cover;
  margin: 0 auto var(--space-sm);
  border: 3px solid rgba(255, 255, 255, 0.15);
  transition: all 0.3s ease;
}

.team-member:hover img {
  border-color: var(--color-primary);
  box-shadow: 0 0 20px rgba(3, 141, 132, 0.3);
}

.team-member h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: white;
  margin-bottom: 4px;
}

.team-member p {
  font-size: 0.8rem;
  color: var(--color-text-light-muted);
}

/* ========== Database Section ========== */
.database-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  max-width: var(--container-max);
  margin: 0 auto;
}

.database-column {
  padding: var(--space-lg);
}

.database-column h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-primary);
  padding-bottom: var(--space-sm);
  margin-bottom: var(--space-md);
  border-bottom: 2px solid var(--color-primary);
}

.database-column ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.database-column li {
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.database-column li:hover {
  background: rgba(3, 141, 132, 0.08);
  transform: translateX(4px);
}

.database-column a {
  color: var(--color-text-dark);
  font-weight: 500;
  font-size: 0.9rem;
}

.database-column a:hover { color: var(--color-primary); }

.database-logo {
  height: 32px;
  margin-top: 6px;
}

/* ========== Software Section ========== */
.software-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  max-width: var(--container-max);
  margin: 0 auto;
}

.software-card {
  padding: var(--space-lg);
  text-align: center;
}

.software-card img {
  height: 60px;
  margin: 0 auto var(--space-md);
}

.software-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
  min-height: 48px;
  color: white;
}

.software-card ul {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.software-card li {
  font-size: 0.85rem;
  color: var(--color-text-light-muted);
  padding-left: 20px;
  position: relative;
}

.software-card li::before {
  content: '✦';
  position: absolute;
  left: 0;
  color: var(--color-primary-light);
  font-size: 0.7rem;
}

/* ========== Art Section ========== */
.art-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  max-width: var(--container-max);
  margin: 0 auto;
}

.art-card {
  padding: var(--space-lg);
  text-align: center;
}

.art-card img {
  height: 60px;
  margin: 0 auto var(--space-md);
}

.art-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-dark);
  margin-bottom: var(--space-xs);
}

/* ========== Teaching Section ========== */
.teaching-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
  max-width: 1000px;
  margin: 0 auto;
}

.teaching-column h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
  color: var(--color-primary-light);
}

.teaching-column ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.teaching-column li {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--color-text-light-muted);
  transition: all 0.2s ease;
}

.teaching-column li:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(4px);
  color: white;
}

/* ========== Research Section ========== */
.research-intro {
  max-width: 1000px;
  margin: 0 auto var(--space-xl);
  text-align: center;
}

.research-intro h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
}

.research-intro p {
  font-size: 1rem;
  color: var(--color-text-muted);
  line-height: 1.8;
}

/* Publications Table */
.publications-table-wrapper {
  overflow-x: auto;
  margin: var(--space-lg) auto;
  border-radius: var(--radius-lg);
  max-width: 900px;
}

.publications-table {
  width: 100%;
  border-collapse: collapse;
}

.publications-table td {
  padding: var(--space-lg);
  vertical-align: top;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.publications-table img {
  width: 180px;
  height: 120px;
  object-fit: cover;
  margin-right: var(--space-md);
  float: left;
  border-radius: var(--radius-md);
}

.publications-table a {
  color: var(--color-primary-light);
  font-weight: 500;
}

.publications-table a:hover { text-decoration: underline; }

/* ========== Collaborations ========== */
.collab-grid {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-xl);
  flex-wrap: wrap;
  max-width: var(--container-max);
  margin: 0 auto;
}

.collab-logo {
  height: 55px;
  width: auto;
  opacity: 1;
  transition: all 0.4s ease;
}

.collab-logo:hover {
  transform: scale(1.08);
}

/* ========== Footer ========== */
.footer {
  display: flex;
  width: 100%;
  background: white;
}

.footer-contact {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--space-xl);
  background: linear-gradient(135deg, var(--color-light) 0%, var(--color-light-alt) 100%);
  text-align: center;
}

.footer-contact h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
}

.footer-logos {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.footer-logos img {
  height: 50px;
  transition: transform 0.3s ease;
}

.footer-logos img:hover { transform: scale(1.05); }

.footer-address {
  line-height: 1.8;
  color: var(--color-text-muted);
}

.footer-address b { color: var(--color-text-dark); }

.footer-address a {
  color: var(--color-primary);
  font-weight: 500;
}

.footer-address a:hover { text-decoration: underline; }

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

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.animate-in {
  animation: fadeInUp 0.6s ease-out forwards;
}

/* Stagger animation for grid items */
.team-grid .team-member:nth-child(1) { animation-delay: 0.1s; }
.team-grid .team-member:nth-child(2) { animation-delay: 0.2s; }
.team-grid .team-member:nth-child(3) { animation-delay: 0.3s; }

.software-grid .software-card:nth-child(1) { animation-delay: 0.1s; }
.software-grid .software-card:nth-child(2) { animation-delay: 0.2s; }
.software-grid .software-card:nth-child(3) { animation-delay: 0.3s; }

/* ========== Utilities ========== */
.text-center { text-align: center; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Inline Button Link */
.btn-inline {
  display: inline-block;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.btn-inline img {
  height: 32px;
  width: auto;
  opacity: 0.85;
  transition: opacity 0.3s ease;
}

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

.btn-inline:hover img {
  opacity: 1;
}

/* Fixed Background */
img.fixed-background {
  position: fixed;
  inset: 0;
  z-index: -10;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ========== Responsive ========== */
@media screen and (max-width: 1024px) {
  .nav-menu a { padding: 8px 12px; font-size: 0.85rem; }
  .hero-title { font-size: 2.2rem; }
  .database-grid, .software-grid, .art-grid { grid-template-columns: repeat(2, 1fr); }
  .people-photo { flex: 0 0 200px; }
  .people-photo img { height: 260px; }
}

@media screen and (max-width: 768px) {
  :root { --navbar-height: 60px; }

  .nav-toggle { display: flex; }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    flex-direction: column;
    align-items: stretch;
    background: rgba(13, 14, 15, 0.98);
    backdrop-filter: blur(20px);
    padding: 80px 20px 20px;
    gap: 4px;
    transition: right 0.3s ease;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    z-index: 1000;
  }

  .nav-menu.active { display: flex; right: 0; }
  .nav-menu li { width: 100%; }
  .nav-menu a { padding: 14px 16px; font-size: 1rem; border-radius: var(--radius-md); }
  .nav-menu a::after { display: none; }
  .nav-overlay.active { display: block; }

  .hero-section { min-height: 70vh; padding-top: calc(60px + 40px); }
  .hero-title { font-size: 1.8rem; }
  .hero-title img { height: 45px; }

  .section-header h1 { font-size: 1.6rem; }

  .database-grid, .software-grid, .art-grid { grid-template-columns: 1fr; }
  .teaching-grid { grid-template-columns: 1fr; }

  .people-intro { flex-direction: column; text-align: center; }
  .people-photo { flex: none; text-align: center; }
  .people-photo img { max-width: 200px; margin: 0 auto; height: auto; aspect-ratio: 1; }

  .footer { flex-direction: column; }
  .footer-contact { width: 100%; min-height: 300px; }

  .team-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--space-md); }
  .team-member img { width: 90px; height: 90px; }
}

@media screen and (max-width: 480px) {
  .nav-logo img { height: 35px; }
  .hero-title { font-size: 1.5rem; }
  .section { padding: var(--space-xl) 5%; }

  .team-member { padding: var(--space-md); }
  .team-member img { width: 80px; height: 80px; }

  .publications-table-wrapper { margin: 0 -5%; border-radius: 0; }
  .publications-table td { padding: var(--space-md); }
  .publications-table img { width: 120px; height: 80px; }
}

/* Focus States */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Print */
@media print {
  .site-header, .nav-toggle, .nav-overlay, img.fixed-background { display: none !important; }
  body { margin-top: 0; }
}
