/* Root variables for consistent theming */
:root {
  --primary-color: #8c1515;
  --secondary-color: #0066cc;
  --text-color: #333333;
  --text-muted: #6c757d;
  --background-color: #ffffff;
  --border-color: #e0e0e0;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --success-color: #28a745;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --font-family-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-family-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
  --border-radius: 0.25rem;
  --transition: all 0.3s ease;
}

/* Base styles */
* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-family-base);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--primary-color);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: var(--border-radius);
  z-index: 9999;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 6px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 1.5rem;
  color: var(--text-color);
}

.display-4 {
  font-size: 2.5rem;
  font-weight: 700;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
  color: var(--primary-color);
  position: relative;
  padding-bottom: 0.8rem;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--primary-color);
  border-radius: 2px;
}

.lead {
  font-size: 1.25rem;
  font-weight: 400;
  margin-bottom: 2rem;
  color: var(--text-muted);
}

/* Code styling */
code {
  font-family: var(--font-family-mono);
  font-size: 0.875rem;
  background: #f8f9fa;
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  color: #e83e8c;
}

/* Links */
a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
}

a:hover, a:focus {
  color: var(--primary-color);
  border-bottom: 1px solid var(--primary-color);
  text-decoration: none;
}

a:focus {
  outline: 2px solid var(--secondary-color);
  outline-offset: 2px;
}

/* Header and Navigation */
.navbar {
  background: var(--background-color) !important;
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
}

.navbar-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color) !important;
}

.nav-link {
  font-weight: 500;
  color: var(--text-color) !important;
  padding: 0.5rem 1rem !important;
  border-radius: var(--border-radius);
  transition: var(--transition);
  font-size: 1rem;
}

.nav-link:hover, .nav-link:focus {
  color: var(--primary-color) !important;
  background: rgba(140, 21, 21, 0.1);
}

/* Hero Section */
.hero-section {
  padding: 1.5rem 0;
  background: linear-gradient(135deg, rgba(140, 21, 21, 0.05) 0%, rgba(0, 102, 204, 0.05) 100%);
  border-radius: var(--border-radius);
  margin-bottom: 2rem;
}

.profile-image-container {
  text-align: center;
}

.profile-image-container img {
  width: 100%;
  max-width: 250px;
  height: auto;
  object-fit: cover;
  border: 3px solid var(--background-color);
  box-shadow: 0 8px 25px var(--shadow-color);
}

.hero-content h1 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  font-size: 2.5rem;
}

.hero-content h2 {
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.hero-content h3 {
  color: var(--text-color);
  font-weight: 500;
  margin-bottom: 1rem;
}

.contact-info {
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.contact-info p {
  margin-bottom: 0.75rem;
}

.contact-info i {
  color: var(--primary-color);
  width: 20px;
}

.social-links .btn {
  border-radius: 50px;
  font-weight: 500;
  transition: var(--transition);
}

.social-links .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-color);
}

/* Content Sections */
.content-sections {
  margin-top: 2rem;
}

.section {
  margin-bottom: 2rem;
  padding: 0.5rem 0.8rem;
  display: block;
}

.section-content {
  font-size: 1rem;
  line-height: 1.7;
}

.section-content p {
  margin-bottom: 0.8rem;
}

.section-content strong {
  color: var(--primary-color);
  font-weight: 600;
}

/* Enhanced emphasis and strong styling */
strong, b {
  font-weight: 600;
  color: var(--primary-color);
}

em, i {
  font-style: italic;
  color: var(--text-color);
  background: rgba(0, 102, 204, 0.08);
  padding: 0.05rem 0.2rem;
  border-radius: 0.15rem;
}

/* Special styling for links within emphasized text */
strong a, b a {
  color: inherit;
  background: none;
  padding: 0;
  border-left: none;
  border-bottom: 1px solid var(--primary-color);
}

strong a:hover, b a:hover {
  background: rgba(140, 21, 21, 0.1);
  padding: 0.1rem 0.25rem;
  border-radius: 0.2rem;
}

/* News Section */
.news-list {
  margin-top: 1.5rem;
}

/* Compact news section */
.news-list-compact {
  margin-top: 1.5rem;
}

.news-item-compact {
  margin-bottom: 1rem;
  padding: 0.5rem 0;
  line-height: 1.5;
  border-bottom: 1px solid #e9ecef;
  font-size: 1rem;
}

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

.news-item-compact a {
  font-weight: 500;
}

/* News Timeline Styling */
.news-timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.news-item {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e9ecef;
  background: #f8f9fa;
  border-radius: var(--border-radius);
  margin-bottom: 0.75rem;
}

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

.news-date {
  flex-shrink: 0;
  font-weight: 600;
  color: var(--primary-color);
  min-width: 140px;
  font-size: 0.95rem;
  margin-top: 0.1rem;
}

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

.news-content a {
  font-weight: 500;
  color: #0066cc;
  text-decoration: none;
  padding: 0.1rem 0.3rem;
  border-radius: 0.2rem;
  background: rgba(0, 102, 204, 0.08);
  transition: all 0.2s ease;
  border-bottom: 1px solid transparent;
}

.news-content a:hover {
  color: var(--primary-color);
  background: rgba(140, 21, 21, 0.08);
  border-bottom: 1px solid var(--primary-color);
  transform: translateY(-1px);
}

/* Alert styling */
.alert {
  border: none;
  border-radius: var(--border-radius);
  padding: 0.75rem 1.25rem;
  margin-bottom: 1.5rem;
}

.alert-primary {
  border-left: 4px solid var(--primary-color);
}

.alert-heading {
  color: var(--primary-color);
  font-weight: 600;
}

/* Paper and publication styling */
.paper-emphasis {
  color: var(--danger-color);
  font-weight: 600;
  font-size: 1rem;
}

.paper-name {
  font-weight: 600;
  color: var(--text-color);
  font-size: 1.1rem;
}

.paper-li {
  margin-bottom: 2rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: var(--border-radius);
  border-left: 4px solid var(--primary-color);
}

.paper-li p {
  margin-bottom: 0.75rem;
  font-size: 1rem;
  line-height: 1.6;
}

/* Section-specific styles */
.research-areas li {
  margin-bottom: 0.8rem;
}

.research-areas ul {
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

.research-highlights li {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: var(--border-radius);
  border-left: 4px solid var(--primary-color);
}

.student-categories {
  margin-top: 2.5rem;
}

.student-category {
  margin-bottom: 2.5rem;
}

.student-category h3 {
  color: var(--primary-color);
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.student-category h4 {
  color: var(--text-color);
  font-size: 1.1rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.student-category ul {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.student-category li {
  margin-bottom: 0.5rem;
}

.publications-list {
  margin-top: 2.5rem;
}

.service-categories {
  margin-top: 2.5rem;
}

.service-category {
  margin-bottom: 2.5rem;
}

.service-category h3 {
  color: var(--primary-color);
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.service-category ul {
  margin-bottom: 1.25rem;
}

.service-category li {
  margin-bottom: 0.25rem;
}

.awards-list {
  list-style: none;
  padding-left: 0;
}

.awards-list li {
  margin-bottom: 0.75rem;
  padding: 1rem 1.25rem;
  background: #f8f9fa;
  border-radius: var(--border-radius);
  border-left: 4px solid var(--success-color);
}

.talks-list {
  margin-top: 2.5rem;
}

.talk-item {
  margin-bottom: 2.5rem;
  padding: 2rem;
  background: #f8f9fa;
  border-radius: var(--border-radius);
  border-left: 4px solid var(--primary-color);
}

.talk-item h4 {
  color: var(--primary-color);
  font-size: 1.2rem;
  margin-bottom: 1.25rem;
}

.talk-item ul {
  margin-bottom: 0;
}

.talk-item li {
  margin-bottom: 0.75rem;
}

/* Open Source Section Styling */
.open-source-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.open-source-item {
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-radius: var(--border-radius);
  padding: 2rem;
  border-left: 4px solid var(--secondary-color);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transition: var(--transition);
}

.open-source-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  border-left-color: var(--primary-color);
}

.open-source-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  gap: 0.5rem;
}

.open-source-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--primary-color);
  text-decoration: none;
  margin-right: 0.75rem;
}

.open-source-title:hover {
  color: var(--secondary-color);
  text-decoration: underline;
}

.open-source-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  font-style: italic;
  flex: 1;
  min-width: 200px;
}

.open-source-description {
  color: var(--text-color);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

.open-source-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.open-source-tags .badge {
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
}

/* Responsive design for open source section */
@media (max-width: 768px) {
  .open-source-item {
    padding: 1.5rem;
  }
  
  .open-source-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  .open-source-title {
    font-size: 1.2rem;
    margin-right: 0;
  }
  
  .open-source-subtitle {
    min-width: auto;
    margin-top: 0.25rem;
  }
}

/* Improved spacing for nested lists */
.section ul ul {
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
}

.section li {
  margin-bottom: 0.375rem;
}

/* Enhanced button styling */
.btn-outline-primary {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

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

/* Improved link styling within sections */
.section-content a {
  font-weight: 400;
  position: relative;
  transition: all 0.2s ease;
}

.section-content a:hover {
  background: rgba(0, 102, 204, 0.15);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 102, 204, 0.3);
}

/* Compact research highlights */
.research-highlights-compact {
  margin-top: 1.5rem;
}

.highlight-item {
  margin-bottom: 1.25rem;
  padding: 0.5rem 1rem;
  background: #f8f9fa;
  border-radius: var(--border-radius);
  border-left: 3px solid var(--primary-color);
  line-height: 1.6;
  font-size: 1rem;
}

.highlight-item:last-child {
  margin-bottom: 0;
}

.highlight-item strong {
  color: var(--primary-color);
}

.highlight-item a {
  font-weight: 500;
}

/* Responsive adjustments for compact highlights */
@media (max-width: 768px) {
  .highlight-item {
    padding: 0.5rem 0.75rem;
    margin-bottom: 1rem;
  }
}

/* Responsive design */
@media (max-width: 768px) {
  .display-4 {
    font-size: 2rem;
  }
  
  .section {
    padding: 0.8rem;
    margin-bottom: 0rem;
  }
  
  .hero-section {
    padding: 1rem 0;
  }
  
  .social-links .btn {
    margin-bottom: 0.75rem;
  }
  
  .nav-link {
    padding: 0.75rem 1rem !important;
  }
  
  .news-date {
    display: block;
    margin-bottom: 0.5rem;
    margin-right: 0;
    min-width: auto;
  }
  
  .news-item-compact {
    padding: 0.5rem 0;
  }
  
  /* Responsive design for news timeline */
  .news-item {
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
  }
  
  .news-date {
    min-width: auto;
    margin-top: 0;
    font-size: 0.9rem;
  }
  
  .news-timeline {
    gap: 0.75rem;
    margin-top: 0.75rem;
  }
}

@media (max-width: 576px) {
  .hero-content h1 {
    font-size: 2rem;
  }
  
  .hero-content h2 {
    font-size: 1.25rem;
  }
  
  .hero-content h3 {
    font-size: 1.1rem;
  }
  
  .section {
    padding: 0;
  }
  
  .section-title {
    font-size: 1.5rem;
  }
}

/* Print styles */
@media print {
  .navbar,
  .skip-link,
  .social-links {
    display: none !important;
  }
  
  .section {
    display: block !important;
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }
  
  a {
    color: var(--text-color) !important;
    text-decoration: none !important;
  }
  
  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
}

/* Animation and transitions */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section {
  animation: fadeIn 0.5s ease-out;
}

/* Focus management for accessibility */
:focus {
  outline: 2px solid var(--secondary-color);
  outline-offset: 2px;
}

/* High contrast mode support 
@media (prefers-contrast: high) {
  :root {
    --primary-color: #000000;
    --secondary-color: #0066cc;
    --text-color: #000000;
    --border-color: #000000;
  }
}*/

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.top {
  padding-top: 40px;
}

.footer {
  background-color: white;
  bottom: 0;
  width: 100%;
  text-align: center;
}

/* FAQ Styling */
.faq-item {
  margin-bottom: 2.4rem;
  padding: 0.8rem;
  background: #f8f9fa;
  border-radius: var(--border-radius);
  border-left: 4px solid var(--primary-color);
  transition: all 0.3s ease;
}

.faq-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.faq-question {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
}

.faq-answer {
  color: var(--text-muted);
  line-height: 1.6;
}

.faq-answer p {
  margin-bottom: 0.75rem;
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

.faq-answer ul {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.faq-answer li {
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

/* Responsive FAQ */
@media (max-width: 768px) {
  .faq-item {
    padding: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .faq-question {
    font-size: 1.1rem;
    flex-direction: row;
    align-items: flex-start;
  }
  
  .faq-question i {
    margin-top: 0.2rem;
    flex-shrink: 0;
  }
}

