@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Playfair+Display:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Color Palette - Modern & Sophisticated */
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --dark-gradient: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);

  --bg-primary: #0a0e27;
  --bg-secondary: #141b3d;
  --bg-card: rgba(20, 27, 61, 0.6);
  --bg-card-hover: rgba(20, 27, 61, 0.9);

  --text-primary: #ffffff;
  --text-secondary: #b8c5d6;
  --text-accent: #667eea;

  --border-color: rgba(102, 126, 234, 0.2);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 20px rgba(102, 126, 234, 0.15);
  --shadow-lg: 0 20px 60px rgba(102, 126, 234, 0.3);
  --shadow-xl: 0 30px 80px rgba(102, 126, 234, 0.4);

  --border-radius-sm: 8px;
  --border-radius-md: 16px;
  --border-radius-lg: 24px;

  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
  position: relative;
}

/* Animated Background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(79, 172, 254, 0.08) 0%, transparent 50%);
  z-index: -1;
  animation: bgShift 20s ease infinite;
}

@keyframes bgShift {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.1); }
}

/* Floating Particles Effect */
.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--text-accent);
  border-radius: 50%;
  opacity: 0.3;
  animation: float 15s infinite ease-in-out;
}

@keyframes float {
  0%, 100% { transform: translateY(0) translateX(0); }
  25% { transform: translateY(-100px) translateX(50px); }
  50% { transform: translateY(-50px) translateX(-50px); }
  75% { transform: translateY(-150px) translateX(30px); }
}

/* Navigation Bar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0;
  backdrop-filter: blur(20px);
  background: rgba(10, 14, 39, 0.8);
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition-base);
}

.navbar.scrolled {
  background: rgba(10, 14, 39, 0.95);
  box-shadow: var(--shadow-md);
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.nav {
  display: flex;
  list-style: none;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.nav li {
  margin: 0;
}

.nav a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.6rem 1.2rem;
  border-radius: var(--border-radius-sm);
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  transition: var(--transition-base);
  display: inline-block;
  overflow: hidden;
}

.nav a::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--primary-gradient);
  transition: var(--transition-base);
  z-index: -1;
  border-radius: var(--border-radius-sm);
}

.nav a:hover {
  color: var(--text-primary);
  transform: translateY(-2px);
}

.nav a:hover::before {
  left: 0;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  padding-top: 120px;
  padding-bottom: 80px;
}

/* Header Section */
header.hero {
  padding: 4rem 0;
  margin-bottom: 4rem;
  position: relative;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  align-items: start;
}

.profile-section {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.profile-pic-wrapper {
  position: relative;
  width: 220px;
  height: 220px;
}

.profile-pic-wrapper::before {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  background: var(--primary-gradient);
  border-radius: 50%;
  animation: profilePulse 3s ease-in-out infinite;
  z-index: 0;
}

@keyframes profilePulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.05); }
}

#profile_pic {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid var(--bg-primary);
  position: relative;
  z-index: 1;
  transition: var(--transition-slow);
  box-shadow: var(--shadow-lg);
}

#profile_pic:hover {
  transform: scale(1.05) rotate(5deg);
}

.title-section {
  animation: fadeInUp 0.8s ease;
}

h1 {
  font-family: 'Playfair Display', serif;
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientFlow 5s ease infinite;
}

@keyframes gradientFlow {
  0%, 100% { filter: hue-rotate(0deg); }
  50% { filter: hue-rotate(20deg); }
}

.phd {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-accent);
  background: rgba(102, 126, 234, 0.1);
  padding: 0.3rem 0.8rem;
  border-radius: var(--border-radius-sm);
  margin-left: 1rem;
  display: inline-block;
  border: 1px solid var(--border-color);
}

.title-section p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin: 0.5rem 0;
  font-weight: 400;
}

.title-section p:first-of-type {
  font-size: 1.3rem;
  color: var(--text-primary);
  font-weight: 600;
  margin-top: 1.5rem;
}

.social {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
}

.social ul {
  list-style: none;
}

.social li {
  margin: 0.8rem 0;
  display: flex;
  align-items: center;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.social li i {
  width: 30px;
  color: var(--text-accent);
  font-size: 1.1rem;
}

.social a {
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: var(--transition-base);
  font-weight: 500;
}

.social a:hover {
  color: var(--text-accent);
  border-bottom-color: var(--text-accent);
}

/* Article Sections */
article {
  margin: 4rem 0;
  padding: 3rem;
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
  transition: var(--transition-slow);
  position: relative;
  overflow: hidden;
}

article::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--primary-gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: var(--transition-slow);
}

article:hover::before {
  transform: scaleX(1);
}

article:hover {
  transform: translateY(-5px);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-xl);
  border-color: rgba(102, 126, 234, 0.4);
}

.article-content {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 3rem;
}

article header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  position: relative;
  display: inline-block;
}

article header h3::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 50px;
  height: 3px;
  background: var(--primary-gradient);
  border-radius: 2px;
}

h4 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 2rem 0 1rem;
  display: flex;
  align-items: center;
}

h4::before {
  content: '';
  width: 4px;
  height: 1.3rem;
  background: var(--primary-gradient);
  margin-right: 0.8rem;
  border-radius: 2px;
}

p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin: 1rem 0;
}

strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Links */
a {
  color: var(--text-accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: var(--transition-base);
  position: relative;
}

a:hover {
  color: #8b9dff;
  border-bottom-color: #8b9dff;
}

/* Lists */
ul {
  list-style: none;
  padding: 0;
}

article ul {
  margin: 1rem 0;
}

article ul li {
  padding: 0.6rem 0;
  padding-left: 1.5rem;
  position: relative;
  color: var(--text-secondary);
  line-height: 1.6;
  transition: var(--transition-base);
}

article ul li::before {
  content: '▹';
  position: absolute;
  left: 0;
  color: var(--text-accent);
  font-weight: bold;
  font-size: 1.2rem;
}

article ul li:hover {
  color: var(--text-primary);
  transform: translateX(5px);
}

/* Space Dividers */
.space {
  height: 1.5rem;
}

/* Footer */
footer {
  text-align: center;
  padding: 3rem 2rem;
  margin-top: 4rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

footer a {
  color: var(--text-accent);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

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

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

.fade-in-up {
  animation: fadeInUp 0.8s ease;
}

/* Scroll Progress Bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--primary-gradient);
  z-index: 1001;
  transition: width 0.1s ease;
}

/* Responsive Design */
@media (max-width: 968px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }

  .profile-section {
    justify-content: center;
  }

  .article-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  article header h3::after {
    left: 50%;
    transform: translateX(-50%);
  }

  h1 {
    font-size: 2.5rem;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 1.5rem;
    padding-top: 100px;
  }

  article {
    padding: 2rem 1.5rem;
  }

  h1 {
    font-size: 2rem;
  }

  .nav {
    gap: 0.3rem;
  }

  .nav a {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
  }

  .profile-pic-wrapper,
  #profile_pic {
    width: 180px;
    height: 180px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.8rem;
  }

  h4 {
    font-size: 1.1rem;
  }

  article {
    padding: 1.5rem 1rem;
  }

  .navbar-inner {
    padding: 0.8rem 1rem;
  }
}

/* Email Obfuscation */
.cryptedem::after {
  content: " " attr(data-name) " @ " attr(data-domain) "." attr(data-tld);
}

/* Publications Page Styles */
.publications {
  background: var(--bg-primary);
  padding: 2rem;
  min-height: 100vh;
}

.publications h1 {
  text-align: center;
  margin: 3rem 0;
  font-family: 'Playfair Display', serif;
}

.publications table {
  max-width: 1000px;
  margin: 2rem auto;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 1.5rem;
}

.publications tr {
  transition: var(--transition-base);
}

.publications td {
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
  vertical-align: top;
}

.publications td:first-child {
  border-radius: var(--border-radius-md) 0 0 var(--border-radius-md);
  width: 100px;
  text-align: center;
  font-weight: 600;
  color: var(--text-accent);
  background: var(--bg-secondary);
}

.publications td:last-child {
  border-radius: 0 var(--border-radius-md) var(--border-radius-md) 0;
}

.publications tr:hover td {
  background: var(--bg-card-hover);
  border-color: rgba(102, 126, 234, 0.4);
  transform: translateX(5px);
}

.publications a {
  color: var(--text-accent);
  font-weight: 500;
}

.publications em {
  color: var(--text-secondary);
  font-style: italic;
}

.publications pre {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 1rem 0;
}

/* Loading Animation */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-content {
  text-align: center;
}

.loader-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid var(--border-color);
  border-top-color: var(--text-accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loader-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Style Switcher in Navigation */
.style-switcher-nav {
  display: flex;
  align-items: center;
  margin-left: 1rem;
}

/* Toggle Switch - Minimal */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition-base);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

.toggle-switch:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

.toggle-slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, #ffd700 0%, #ffa500 100%);
  border-radius: 50%;
  transition: var(--transition-base);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.toggle-switch.modern .toggle-slider {
  transform: translateX(20px);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Icons in toggle */
.toggle-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  transition: var(--transition-base);
  opacity: 0.6;
}

.toggle-icon.classic {
  left: 5px;
}

.toggle-icon.modern {
  right: 5px;
}

.toggle-switch.modern .toggle-icon.modern {
  opacity: 1;
}

.toggle-switch:not(.modern) .toggle-icon.classic {
  opacity: 1;
}

/* Responsive Style Switcher */
@media (max-width: 768px) {
  .toggle-switch {
    width: 40px;
    height: 22px;
  }

  .toggle-slider {
    width: 16px;
    height: 16px;
  }

  .toggle-switch.modern .toggle-slider {
    transform: translateX(18px);
  }

  .toggle-icon {
    font-size: 0.65rem;
  }

  .style-switcher-nav {
    margin-left: 0.5rem;
  }
}
