/* Theme variables are now loaded directly in HTML */

:root {
  --transition: all 0.3s ease;
}

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

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

/* Image optimization - prevent oversharpening */
img {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  -ms-interpolation-mode: bicubic;
  max-width: 100%;
  height: auto;
}

/* Better rendering for thumbnails */
.card-image,
.gallery-item img {
  image-rendering: auto;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
  will-change: transform;
}

/* Lazy loading placeholder */
img[loading="lazy"] {
  background: var(--bg-light);
}

/* Video optimization */
video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Navigation */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  z-index: 1000;
  transition: var(--transition);
}

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

nav .logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}

nav .logo:hover {
  color: var(--secondary-color);
}

nav .nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

nav .nav-links a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  transition: var(--transition);
  position: relative;
}

nav .nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--secondary-color);
  transform: translateX(-50%);
  transition: var(--transition);
}

nav .nav-links a:hover {
  color: var(--secondary-color);
}

nav .nav-links a:hover::after {
  width: 80%;
}

nav .nav-links a.active {
  color: var(--secondary-color);
  font-weight: 600;
}

nav .nav-links a.active::after {
  width: 80%;
  background: var(--accent-color);
  height: 3px;
}

/* Mobile Menu */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 0.5rem;
}

.mobile-menu-toggle span {
  width: 25px;
  height: 3px;
  background: var(--primary-color);
  transition: var(--transition);
  border-radius: 2px;
}

/* Main Content */
main {
  margin-top: 80px;
  min-height: calc(100vh - 80px);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Hero Section */
/* Hero Video Section */
.hero-video {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  margin-top: -80px;
  padding-top: 80px;
  /* Fallback background if video fails to load */
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.hero-background-video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  z-index: 0;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.55) 100%);
  z-index: 1;
}

.hero-video .hero-content {
  position: relative;
  z-index: 2;
  color: white;
  max-width: 900px;
  padding: 2rem;
  text-align: center;
}

.hero-video h1 {
  font-size: 4.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
  letter-spacing: -1px;
}

.hero-tagline {
  font-size: 1.5rem;
  font-weight: 300;
  margin-bottom: 1.5rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
  opacity: 0.95;
}

.hero-description {
  font-size: 1.2rem;
  line-height: 1.8;
  margin-bottom: 2.5rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-buttons .btn {
  font-size: 1.1rem;
  padding: 1rem 2rem;
  background: var(--secondary-color);
  color: white;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.hero-buttons .btn-outline {
  background: transparent;
  border: 2px solid white;
  color: white;
}

.hero-buttons .btn-outline:hover {
  background: white;
  color: var(--primary-color);
}

/* Showcase Images Section */
.showcase-images {
  background: var(--bg-color);
  padding: 0;
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}

.showcase-item {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  cursor: pointer;
  transition: all 0.3s ease;
}

.showcase-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.showcase-item:hover img {
  transform: scale(1.1);
}

.showcase-item:hover {
  z-index: 10;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* Legacy hero styles for other pages */
.hero {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-color) 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(52, 152, 219, 0.1) 0%, transparent 70%);
  top: -250px;
  right: -250px;
  animation: float 20s infinite;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(30px, -30px) rotate(120deg); }
  66% { transform: translate(-30px, 30px) rotate(240deg); }
}

.hero-content {
  z-index: 1;
  max-width: 800px;
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
  animation: fadeInUp 1s ease;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-light);
  margin-bottom: 2rem;
  animation: fadeInUp 1s ease 0.2s both;
}

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

/* Section Styles */
section {
  padding: 4rem 0;
}

section h2 {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  color: var(--primary-color);
  text-align: center;
}

section h3 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

/* Card Grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.card {
  background: var(--bg-color);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
}

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

.card-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: var(--transition);
}

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

.card-content {
  padding: 1.5rem;
}

.card-content h3 {
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}

.card-content p {
  color: var(--text-light);
  line-height: 1.6;
}

.card-link {
  display: inline-block;
  margin-top: 1rem;
  color: var(--secondary-color);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

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

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: var(--secondary-color);
  color: white;
  text-decoration: none;
  border-radius: 5px;
  font-weight: 600;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.btn:hover {
  background: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--secondary-color);
  color: var(--secondary-color);
}

.btn-outline:hover {
  background: var(--secondary-color);
  color: white;
}

/* Image Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  aspect-ratio: 1;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.gallery-item:hover img {
  transform: scale(1.1);
}

.gallery-item-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  padding: 1rem;
  color: white;
  transform: translateY(100%);
  transition: var(--transition);
}

.gallery-item:hover .gallery-item-overlay {
  transform: translateY(0);
}

/* Publications */
.publication {
  background: var(--bg-light);
  padding: 2rem;
  border-radius: 10px;
  margin-bottom: 2rem;
  border-left: 4px solid var(--secondary-color);
}

.publication h4 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.publication .authors {
  color: var(--text-light);
  font-style: italic;
  margin-bottom: 0.5rem;
}

.publication .journal {
  color: var(--text-color);
  font-weight: 600;
  margin-bottom: 1rem;
}

.publication .abstract {
  color: var(--text-light);
  line-height: 1.8;
  margin-top: 1rem;
}

/* Contact Form */
.contact-form {
  max-width: 600px;
  margin: 2rem auto;
  background: var(--bg-light);
  padding: 2rem;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
  font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group textarea {
  min-height: 150px;
  resize: vertical;
}

/* Footer */
footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 3rem 0 1rem;
  margin-top: 4rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.footer-section h3 {
  margin-bottom: 1rem;
  color: var(--footer-text);
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: var(--footer-text);
  opacity: 0.8;
  text-decoration: none;
  transition: var(--transition);
}

.footer-section a:hover {
  opacity: 1;
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: var(--footer-text);
  transition: var(--transition);
}

.social-links a:hover {
  background: var(--secondary-color);
  transform: translateY(-3px);
  color: white;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--footer-text);
  opacity: 0.6;
}

/* Video Container */
.video-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 2rem auto;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.video-container video {
  width: 100%;
  display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }

  nav .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: white;
    box-shadow: var(--shadow);
    padding: 1rem;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  nav .nav-links.active {
    max-height: 500px;
  }

  nav .nav-links li {
    width: 100%;
  }

  nav .nav-links a {
    display: block;
    padding: 1rem;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .hero-video h1 {
    font-size: 2.5rem;
  }

  .hero-tagline {
    font-size: 1.1rem;
  }

  .hero-description {
    font-size: 1rem;
  }

  .hero-buttons .btn {
    font-size: 1rem;
    padding: 0.8rem 1.5rem;
  }

  .showcase-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  section h2 {
    font-size: 2rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .footer-content {
    grid-template-columns: 1fr;
  }
}

/* Loading Animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

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

/* Success/Error Messages */
.message {
  padding: 1rem;
  border-radius: 5px;
  margin: 1rem 0;
  font-weight: 600;
}

.message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Modal/Lightbox */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  cursor: pointer;
}

.modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modal-content img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-content p {
  color: white;
  margin-top: 1rem;
  text-align: center;
  font-size: 1.1rem;
}

.modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(10px);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

