/* Custom styles for academic blog */

/* Move Quarto's built-in theme toggle button to top left */
.quarto-color-scheme-toggle {
  position: fixed !important;
  top: 20px !important;
  left: 20px !important;
  z-index: 1050 !important;
  background: rgba(255, 255, 255, 0.95) !important;
  border: 2px solid #2c3e50 !important;
  border-radius: 50% !important;
  width: 45px !important;
  height: 45px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2) !important;
  transition: all 0.3s ease !important;
  padding: 0 !important;
}

.quarto-color-scheme-toggle:hover {
  background: rgba(255, 255, 255, 1) !important;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.3) !important;
  transform: scale(1.1) !important;
}

.quarto-dark .quarto-color-scheme-toggle,
[data-bs-theme="dark"] .quarto-color-scheme-toggle {
  background: rgba(44, 62, 80, 0.95) !important;
  border-color: #ecf0f1 !important;
  color: #fff !important;
}

.quarto-dark .quarto-color-scheme-toggle:hover,
[data-bs-theme="dark"] .quarto-color-scheme-toggle:hover {
  background: rgba(44, 62, 80, 1) !important;
}

/* Ensure navbar doesn't overlap with toggle button */
.navbar {
  padding-left: 70px !important;
}

/* CV page TOC styling */
#TOC {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

#TOC .nav-link {
  padding: 0.25rem 0.5rem;
  border-left: 2px solid transparent;
  transition: all 0.2s ease;
}

#TOC .nav-link:hover {
  border-left-color: #2c3e50;
  background-color: rgba(44, 62, 80, 0.05);
}

#TOC .nav-link.active {
  border-left-color: #2c3e50;
  background-color: rgba(44, 62, 80, 0.1);
  font-weight: 600;
}

/* Scroll progress indicator */
.quarto-scroll-progress,
.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, #2c3e50, #3498db, #2c3e50);
  z-index: 9999;
  transition: width 0.1s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Post navigation buttons */
.post-navigation {
  margin: 20px 0 30px 0;
  padding: 0;
}

.post-nav-buttons {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
}

.post-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95em;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.post-nav-btn-secondary {
  background-color: #f8f9fa;
  color: #2c3e50;
  border-color: #dee2e6;
}

.post-nav-btn-secondary:hover {
  background-color: #e9ecef;
  border-color: #adb5bd;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  color: #2c3e50;
  text-decoration: none;
}

.post-nav-icon {
  font-size: 1.1em;
  font-weight: 600;
}

/* Dark mode support for navigation buttons */
.quarto-dark .post-nav-btn-secondary,
[data-bs-theme="dark"] .post-nav-btn-secondary {
  background-color: #34495e;
  color: #ecf0f1;
  border-color: #495e74;
}

.quarto-dark .post-nav-btn-secondary:hover,
[data-bs-theme="dark"] .post-nav-btn-secondary:hover {
  background-color: #495e74;
  border-color: #5e748a;
  color: #ecf0f1;
}

/* Responsive: adjust navigation buttons on mobile */
@media (max-width: 768px) {
  .post-nav-buttons {
    flex-direction: column;
    align-items: stretch;
  }
  
  .post-nav-btn {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
  }
}

/* Image styling for about page */
img {
  max-width: 100%;
  height: auto;
}

/* Music artists images - side by side */
.music-artists {
  display: flex;
  gap: 30px;
  justify-content: center;
  align-items: flex-start;
  margin: 20px 0;
  flex-wrap: wrap;
}

.music-artists .artist-item {
  flex: 1;
  text-align: center;
  min-width: 150px;
  max-width: 250px;
}

.music-artists .artist-item img {
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease;
  display: block;
  margin: 0 auto 10px;
}

.music-artists .artist-item img:hover {
  transform: scale(1.05);
}

.music-artists .artist-item em {
  display: block;
  font-style: italic;
  color: #555;
  margin-top: 8px;
  font-size: 0.9em;
}

@media (max-width: 768px) {
  .music-artists {
    flex-direction: column;
    gap: 20px;
  }
  
  .music-artists .artist-item {
    max-width: 80%;
    margin: 0 auto;
  }
}

/* Blog category cards styling */
.blog-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.category-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  background: #f9f9f9;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.category-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: #2c3e50;
}

.category-card h3 {
  margin-top: 0;
  color: #2c3e50;
}

.category-card h3 a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease;
}

.category-card h3 a:hover {
  color: #3498db;
}

.category-card p {
  margin-bottom: 0;
  color: #666;
  font-size: 0.9em;
}

/* Dark mode support for category cards */
.quarto-dark .category-card,
[data-bs-theme="dark"] .category-card {
  background: #2c3e50;
  border-color: #34495e;
  color: #ecf0f1;
}

.quarto-dark .category-card h3,
[data-bs-theme="dark"] .category-card h3 {
  color: #ecf0f1;
}

.quarto-dark .category-card p,
[data-bs-theme="dark"] .category-card p {
  color: #bdc3c7;
}

.quarto-dark .category-card:hover,
[data-bs-theme="dark"] .category-card:hover {
  border-color: #3498db;
  background: #34495e;
}

/* Home page sections */
.home-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.home-section-card {
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 25px;
  text-align: center;
  background: linear-gradient(135deg, #f9f9f9 0%, #ffffff 100%);
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.home-section-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  border-color: #3498db;
}

.section-icon {
  font-size: 3em;
  margin-bottom: 15px;
  display: block;
}

.home-section-card h3 {
  margin: 10px 0;
  color: #2c3e50;
}

.home-section-card h3 a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease;
}

.home-section-card h3 a:hover {
  color: #3498db;
}

.home-section-card p {
  margin: 0;
  color: #666;
  font-size: 0.9em;
}

/* Dark mode for home sections */
.quarto-dark .home-section-card,
[data-bs-theme="dark"] .home-section-card {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  border-color: #34495e;
  color: #ecf0f1;
}

.quarto-dark .home-section-card h3,
[data-bs-theme="dark"] .home-section-card h3 {
  color: #ecf0f1;
}

.quarto-dark .home-section-card p,
[data-bs-theme="dark"] .home-section-card p {
  color: #bdc3c7;
}

.quarto-dark .home-section-card:hover,
[data-bs-theme="dark"] .home-section-card:hover {
  border-color: #3498db;
  background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
}

/* Tag filter and search */
.tag-filter-container,
.blog-filter-container {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 25px 0;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-group label {
  font-weight: 600;
  color: #2c3e50;
  white-space: nowrap;
}

.tag-filter-select,
.blog-search-input {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.95em;
  background: white;
  color: #333;
  transition: all 0.2s ease;
}

.tag-filter-select:focus,
.blog-search-input:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.clear-filter-btn {
  padding: 8px 16px;
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9em;
  transition: all 0.2s ease;
}

.clear-filter-btn:hover {
  background: #c0392b;
  transform: translateY(-1px);
}

/* Posts list */
.posts-list {
  margin-top: 20px;
}

.post-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  background: #ffffff;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.post-card:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: #3498db;
}

.post-card h4 {
  margin-top: 0;
  margin-bottom: 10px;
}

.post-card h4 a {
  text-decoration: none;
  color: #2c3e50;
  transition: color 0.2s ease;
}

.post-card h4 a:hover {
  color: #3498db;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.post-date {
  color: #666;
  font-size: 0.9em;
}

.post-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.post-tag {
  display: inline-block;
  padding: 4px 10px;
  background: #e8f4f8;
  color: #2c3e50;
  border-radius: 12px;
  font-size: 0.85em;
  font-weight: 500;
  transition: all 0.2s ease;
}

.post-tag:hover {
  background: #3498db;
  color: white;
  cursor: pointer;
}

.post-description {
  color: #555;
  line-height: 1.6;
  margin-bottom: 0;
}

/* Dark mode for filters and posts */
.quarto-dark .tag-filter-container,
.quarto-dark .blog-filter-container,
[data-bs-theme="dark"] .tag-filter-container,
[data-bs-theme="dark"] .blog-filter-container {
  background: #2c3e50;
  border-color: #34495e;
}

.quarto-dark .filter-group label,
[data-bs-theme="dark"] .filter-group label {
  color: #ecf0f1;
}

.quarto-dark .tag-filter-select,
.quarto-dark .blog-search-input,
[data-bs-theme="dark"] .tag-filter-select,
[data-bs-theme="dark"] .blog-search-input {
  background: #34495e;
  border-color: #4a5568;
  color: #ecf0f1;
}

.quarto-dark .post-card,
[data-bs-theme="dark"] .post-card {
  background: #2c3e50;
  border-color: #34495e;
}

.quarto-dark .post-card h4 a,
[data-bs-theme="dark"] .post-card h4 a {
  color: #ecf0f1;
}

.quarto-dark .post-date,
.quarto-dark .post-description,
[data-bs-theme="dark"] .post-date,
[data-bs-theme="dark"] .post-description {
  color: #bdc3c7;
}

.quarto-dark .post-tag,
[data-bs-theme="dark"] .post-tag {
  background: #34495e;
  color: #ecf0f1;
}

.quarto-dark .post-tag:hover,
[data-bs-theme="dark"] .post-tag:hover {
  background: #3498db;
  color: white;
}

/* Blog filter section */
.blog-filter-section {
  margin: 30px 0;
  padding: 25px;
  background: #f8f9fa;
  border-radius: 8px;
}

/* Tag bar styling (like progress bar) */
.tag-bar-container {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e0e0e0;
}

.blog-search-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.blog-search-container label {
  font-weight: 600;
  color: #2c3e50;
  white-space: nowrap;
}

.tag-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
}

.tag-btn {
  padding: 8px 16px;
  background: #ffffff;
  border: 2px solid #e0e0e0;
  border-radius: 20px;
  font-size: 0.9em;
  font-weight: 500;
  color: #2c3e50;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tag-btn:hover {
  background: #3498db;
  border-color: #3498db;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.tag-btn.active {
  background: #2c3e50;
  border-color: #2c3e50;
  color: white;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(44, 62, 80, 0.3);
}

.tag-btn.active:hover {
  background: #34495e;
  border-color: #34495e;
}

/* Dark mode for blog filter section */
.quarto-dark .blog-filter-section,
[data-bs-theme="dark"] .blog-filter-section {
  background: #2c3e50;
}

.quarto-dark .tag-bar-container,
[data-bs-theme="dark"] .tag-bar-container {
  border-bottom-color: #4a5568;
}

.quarto-dark .blog-search-container label,
[data-bs-theme="dark"] .blog-search-container label {
  color: #ecf0f1;
}

.quarto-dark .tag-btn,
[data-bs-theme="dark"] .tag-btn {
  background: #34495e;
  border-color: #4a5568;
  color: #ecf0f1;
}

.quarto-dark .tag-btn:hover,
[data-bs-theme="dark"] .tag-btn:hover {
  background: #3498db;
  border-color: #3498db;
  color: white;
}

.quarto-dark .tag-btn.active,
[data-bs-theme="dark"] .tag-btn.active {
  background: #3498db;
  border-color: #3498db;
  color: white;
}

/* Responsive: adjust on mobile */
@media (max-width: 768px) {
  .quarto-color-scheme-toggle {
    top: 15px !important;
    left: 15px !important;
    width: 40px !important;
    height: 40px !important;
  }
  
  .navbar {
    padding-left: 60px !important;
  }
  
  #TOC {
    position: relative;
    top: 0;
    max-height: none;
  }
  
  .blog-categories,
  .home-sections {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .tag-filter-container,
  .blog-filter-container {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-group {
    flex-direction: column;
    align-items: stretch;
  }
  
  .tag-filter-select,
  .blog-search-input {
    width: 100%;
  }
  
  .tag-bar-container {
    padding: 15px;
  }
  
  .tag-btn {
    padding: 6px 12px;
    font-size: 0.85em;
  }
}
