/**
 * Reusable Component Styles
 * Academic Website Modernization
 */

/* Hero Section */
.hero-section {
  padding: var(--spacing-8) 0 var(--spacing-12);
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.03) 0%, rgba(13, 148, 136, 0.03) 100%);
  margin-top: 56px; /* Account for fixed navbar */
}

@media (max-width: 768px) {
  .hero-section {
    padding: var(--spacing-6) 0 var(--spacing-8);
  }
}

/* Hero Image */
.hero-image-wrapper {
  text-align: center;
  margin-bottom: var(--spacing-3);
}

.hero-image {
  width: 100%;
  max-width: 180px;
  height: auto;
  margin: 0 auto;
  display: block;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hero-image:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
}

@media (max-width: 768px) {
  .hero-image {
    max-width: 150px;
  }
}

/* Hero Content */
.hero-content {
  padding-left: var(--spacing-6);
}

@media (max-width: 768px) {
  .hero-content {
    padding-left: 0;
    text-align: center;
  }
}

.hero-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-h1);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  margin-bottom: var(--spacing-3);
  line-height: var(--line-height-heading);
}

.hero-subtitle {
  font-family: var(--font-heading);
  font-size: var(--font-size-h3);
  font-weight: var(--font-weight-medium);
  color: var(--color-secondary);
  margin-bottom: var(--spacing-8);
  line-height: var(--line-height-heading);
}

@media (max-width: 768px) {
  .hero-title {
    font-size: var(--font-size-h2);
  }
  
  .hero-subtitle {
    font-size: var(--font-size-h4);
  }
}

/* Hero Bio */
.hero-bio {
  color: var(--color-text);
  line-height: var(--line-height-base);
}

.bio-section {
  margin-bottom: var(--spacing-6);
}

.bio-section p {
  margin-bottom: var(--spacing-4);
}

.contact-info {
  font-size: var(--font-size-base);
  color: var(--color-text-light);
}

.contact-info a {
  color: var(--color-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.contact-info a:hover {
  color: var(--color-link-hover);
  text-decoration: underline;
}

.research-interests {
  margin-top: var(--spacing-6);
}

.research-interests h3 {
  font-family: var(--font-heading);
  font-size: var(--font-size-h4);
  color: var(--color-primary);
  margin-bottom: var(--spacing-4);
  padding-bottom: var(--spacing-2);
  border-bottom: 2px solid var(--color-accent);
}

.research-interests p {
  margin-bottom: 0;
}

/* Visitor Counter */
.visitor-counter {
  text-align: center;
  margin-top: var(--spacing-6);
  padding-top: var(--spacing-6);
  border-top: 1px solid var(--color-border);
}

.visitor-counter a {
  display: inline-block;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.visitor-counter a:hover,
.visitor-counter a:focus {
  transform: scale(1.05);
  opacity: 0.9;
}

.visitor-map {
  max-width: 100%;
  height: auto;
  width: 200px;
  border-radius: var(--radius-md);
  transition: box-shadow var(--transition-fast);
}

.visitor-counter a:hover .visitor-map,
.visitor-counter a:focus .visitor-map {
  box-shadow: var(--shadow-md);
}

/* Navigation */
.navbar {
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.navbar-scrolled {
  background-color: rgba(33, 37, 41, 0.95) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.navbar-toggler {
  transition: transform var(--transition-fast), opacity var(--transition-fast);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-toggler:hover,
.navbar-toggler:focus {
  transform: scale(1.05);
  opacity: 0.9;
  border-color: var(--color-accent);
}

.navbar-toggler:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.navbar-brand {
  font-family: var(--font-heading);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  transition: color 0.3s ease;
}

.navbar-brand:hover {
  color: var(--color-accent, #0d9488) !important;
}

.nav-link {
  font-weight: var(--font-weight-medium);
  transition: color 0.3s ease;
  padding: var(--spacing-2) var(--spacing-4) !important;
  position: relative;
}

.nav-link:hover,
.nav-link:focus {
  text-decoration: none;
  color: var(--color-accent, #0d9488) !important;
}

.nav-link:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: var(--color-accent, #0d9488);
  transition: width 0.3s ease, left 0.3s ease;
}

.nav-link:hover::after,
.nav-item.active .nav-link::after {
  width: 80%;
  left: 10%;
}

/* Social Links */
.social-links {
  margin-top: var(--spacing-4);
  max-width: 200px;
  margin-left: auto;
  margin-right: auto;
}

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

.social-links-list li {
  margin-bottom: var(--spacing-2);
}

.social-link {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
  padding: var(--spacing-2) var(--spacing-3);
  color: var(--color-text);
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  text-decoration: none;
  font-size: var(--font-size-sm);
  min-height: 40px; /* Minimum touch target size */
}

.social-link:hover,
.social-link:focus {
  color: var(--color-accent);
  border-color: var(--color-accent);
  transform: translateX(3px);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}

.social-link:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.social-link i {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.social-link span {
  flex: 1;
}

@media (max-width: 768px) {
  .social-links-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-2);
  }
  
  .social-links-list li {
    margin-bottom: 0;
  }
  
  .social-link {
    padding: var(--spacing-2) var(--spacing-3);
    font-size: var(--font-size-sm);
  }
}

/* Publication Entry */
.publication-section {
  margin-bottom: var(--spacing-12);
}

.publication-section .section-heading {
  font-family: var(--font-heading);
  font-size: var(--font-size-h2);
  color: var(--color-primary);
  border-bottom: 3px solid var(--color-accent);
  padding-bottom: var(--spacing-4);
  margin-bottom: var(--spacing-8);
}

.publications-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-6);
}

.publication-entry {
  padding: var(--spacing-6);
  background-color: var(--color-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  transition: all var(--transition-base);
}

.publication-entry:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--color-accent);
  background-color: rgba(30, 58, 138, 0.02);
}

.publication-authors {
  color: var(--color-text-light);
  margin-bottom: var(--spacing-3);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
}

.publication-authors .current-author {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}

.publication-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--spacing-3);
  line-height: var(--line-height-heading);
}

.publication-title a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.publication-title a:hover,
.publication-title a:focus {
  color: var(--color-accent);
  text-decoration: underline;
}

.publication-title a:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.publication-venue {
  color: var(--color-text);
  font-style: italic;
  margin-bottom: var(--spacing-3);
  font-size: var(--font-size-base);
}

.publication-links {
  display: flex;
  gap: var(--spacing-4);
  flex-wrap: wrap;
  align-items: center;
  margin-top: var(--spacing-3);
}

.publication-links a {
  color: var(--color-link);
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  transition: color var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-1);
}

.publication-links a:hover,
.publication-links a:focus {
  color: var(--color-link-hover);
  text-decoration: underline;
}

.publication-links a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.publication-links i {
  font-size: 1rem;
}

.publication-special {
  display: inline-block;
  padding: var(--spacing-1) var(--spacing-3);
  background-color: var(--color-accent);
  color: var(--color-white);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

.publication-meta {
  display: flex;
  gap: var(--spacing-4);
  flex-wrap: wrap;
  margin-top: var(--spacing-3);
}

.publication-badge {
  display: inline-block;
  padding: var(--spacing-1) var(--spacing-3);
  background-color: var(--color-accent);
  color: var(--color-white);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

/* Page Title */
.page-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-h1);
  color: var(--color-primary);
  margin-top: var(--spacing-8);
  margin-bottom: var(--spacing-8);
  text-align: center;
}

@media (max-width: 768px) {
  .publication-title {
    font-size: var(--font-size-lg);
  }
  
  .publication-authors {
    font-size: var(--font-size-sm);
  }
  
  .publication-venue {
    font-size: var(--font-size-sm);
  }
}

/* News Section */
.news-section {
  background-color: var(--color-white);
  padding: var(--spacing-12) 0;
}

.news-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--spacing-8) 0;
}

.news-item {
  display: flex;
  gap: var(--spacing-4);
  padding: var(--spacing-6);
  margin-bottom: var(--spacing-6);
  border-left: 4px solid var(--color-accent);
  background-color: var(--color-background);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.news-item:hover {
  border-left-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
  transform: translateX(4px);
}

@media (max-width: 768px) {
  .news-item {
    flex-direction: column;
    gap: var(--spacing-2);
  }
}

.news-date {
  display: inline-block;
  padding: var(--spacing-1) var(--spacing-3);
  background-color: var(--color-primary);
  color: hwb(0 100% 0%);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  white-space: nowrap;
  flex-shrink: 0;
  align-self: flex-start;
}

.news-content {
  color: var(--color-text);
  line-height: var(--line-height-base);
  flex: 1;
}

.news-content a {
  font-weight: var(--font-weight-medium);
  color: var(--color-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.news-content a:hover {
  color: var(--color-link-hover);
  text-decoration: underline;
}

.news-archive-link {
  text-align: center;
  margin-top: var(--spacing-8);
}

.btn-link {
  display: inline-block;
  padding: var(--spacing-3) var(--spacing-6);
  color: var(--color-primary);
  background-color: transparent;
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-medium);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.btn-link:hover,
.btn-link:focus {
  color: var(--color-white);
  background-color: var(--color-primary);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-link:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
}

/* Card Component */
.card-custom {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-6);
  margin-bottom: var(--spacing-6);
  transition: all var(--transition-base);
}

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

.card-header-custom {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
  margin-bottom: var(--spacing-4);
  padding-bottom: var(--spacing-3);
  border-bottom: 2px solid var(--color-border);
}

.card-body-custom {
  color: var(--color-text);
}

.card-footer-custom {
  margin-top: var(--spacing-4);
  padding-top: var(--spacing-4);
  border-top: 1px solid var(--color-border);
  color: var(--color-text-light);
  font-size: var(--font-size-sm);
}

/* Section Headings */
.section-heading {
  font-size: var(--font-size-h2);
  color: var(--color-primary);
  margin-bottom: var(--spacing-8);
  padding-bottom: var(--spacing-4);
  border-bottom: 3px solid var(--color-accent);
  position: relative;
}

.section-heading::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 60px;
  height: 3px;
  background-color: var(--color-primary);
}

/* Button Styles */
.btn-custom {
  display: inline-block;
  padding: var(--spacing-3) var(--spacing-6);
  font-weight: var(--font-weight-medium);
  text-align: center;
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  border: 2px solid transparent;
}

.btn-primary-custom {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.btn-primary-custom:hover,
.btn-primary-custom:focus {
  background-color: var(--color-accent);
  color: var(--color-white);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-primary-custom:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
}

.btn-outline-custom {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-outline-custom:hover,
.btn-outline-custom:focus {
  background-color: var(--color-primary);
  color: var(--color-white);
  text-decoration: none;
}

.btn-outline-custom:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
}

/* Footer */
.footer {
  background-color: var(--color-primary);
  color: var(--color-white);
  padding: var(--spacing-8) 0;
  margin-top: var(--spacing-16);
}

.footer a {
  color: var(--color-white);
}

.footer a:hover {
  color: var(--color-accent);
}

/* Skip Navigation Link (Accessibility) */
.skip-nav {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary);
  color: var(--color-white);
  padding: var(--spacing-2) var(--spacing-4);
  text-decoration: none;
  z-index: 100;
}

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

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

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

/* Apply subtle fade-in to major sections */
.hero-section,
.news-section,
.publication-section {
  animation: fadeIn 0.6s ease-out;
}

/* Stagger animation for list items */
.publication-entry {
  animation: fadeInUp 0.5s ease-out backwards;
}

.publication-entry:nth-child(1) { animation-delay: 0.1s; }
.publication-entry:nth-child(2) { animation-delay: 0.15s; }
.publication-entry:nth-child(3) { animation-delay: 0.2s; }
.publication-entry:nth-child(4) { animation-delay: 0.25s; }
.publication-entry:nth-child(5) { animation-delay: 0.3s; }
.publication-entry:nth-child(6) { animation-delay: 0.35s; }
.publication-entry:nth-child(7) { animation-delay: 0.4s; }
.publication-entry:nth-child(8) { animation-delay: 0.45s; }

.news-item {
  animation: fadeInUp 0.5s ease-out backwards;
}

.news-item:nth-child(1) { animation-delay: 0.1s; }
.news-item:nth-child(2) { animation-delay: 0.15s; }
.news-item:nth-child(3) { animation-delay: 0.2s; }
.news-item:nth-child(4) { animation-delay: 0.25s; }
.news-item:nth-child(5) { animation-delay: 0.3s; }
.news-item:nth-child(6) { animation-delay: 0.35s; }
.news-item:nth-child(7) { animation-delay: 0.4s; }
.news-item:nth-child(8) { animation-delay: 0.45s; }
.news-item:nth-child(9) { animation-delay: 0.5s; }
.news-item:nth-child(10) { animation-delay: 0.55s; }

.social-link {
  animation: fadeInUp 0.4s ease-out backwards;
}

.social-link:nth-child(1) { animation-delay: 0.1s; }
.social-link:nth-child(2) { animation-delay: 0.15s; }
.social-link:nth-child(3) { animation-delay: 0.2s; }
.social-link:nth-child(4) { animation-delay: 0.25s; }
.social-link:nth-child(5) { animation-delay: 0.3s; }
.social-link:nth-child(6) { animation-delay: 0.35s; }

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  .hero-section,
  .news-section,
  .publication-section,
  .publication-entry,
  .news-item,
  .social-link {
    animation: none;
  }
}
