/**
 * Academic Website Styles
 * 
 * Table of Contents:
 * 1. Fonts & Typography
 * 2. CSS Variables
 * 3. Base Styles
 * 4. Layout Components
 * 5. Navigation
 * 6. Hero Section
 * 7. Content Sections
 * 8. Publications
 * 9. Forms & Interactions
 * 10. Utility Classes
 * 11. External Libraries
 */

/* ==========================================================================
   1. FONTS & TYPOGRAPHY
   ========================================================================== */

/* Questa Grande Font from Font Squirrel */
@font-face {
    font-family: 'QuestaGrande';
    src: url('../fonts/QuestaGrande-Regular.woff2') format('woff2'),
         url('../fonts/QuestaGrande-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ==========================================================================
   2. CSS VARIABLES
   ========================================================================== */

:root {
    --bs-primary: #4a4a4a;
    --bs-primary-rgb: 74, 74, 74;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

/* ==========================================================================
   3. BASE STYLES
   ========================================================================== */

body {
    font-family: 'Source Sans Pro', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1.1rem;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

/* Navigation */
.navbar-brand {
    font-size: 1.65rem;
    font-family: 'QuestaGrande', 'Georgia', 'Times New Roman', serif;
    font-weight: 400; /* Questa Grande has its own weight, use normal */
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Source Sans Pro', sans-serif;
}

.nav-link.active {
    font-weight: 600;
}

/* Hero section */
.hero-section {
    background: linear-gradient(135deg, var(--gray-500) 0%, var(--gray-600) 100%);
    color: white;
    padding: 4rem 0;
}

.profile-img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.2);
}

/* Cards */
.card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: var(--gray-100);
    color: var(--gray-800);
    border-bottom: 1px solid var(--gray-200);
}

/* News items */
.news-item {
    border-left: 3px solid var(--gray-400);
    padding-left: 1rem;
    margin-bottom: 1.5rem;
}

.news-date {
    color: var(--gray-600);
    font-size: 0.9rem;
    font-weight: 600;
}

/* Publications */
.publication-item {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    background: #fff;
}

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

.publication-title {
    color: var(--bs-primary);
    text-decoration: none;
    font-weight: 600;
    line-height: 1.3;
}

.publication-title:hover {
    color: var(--gray-600);
}

.publication-authors {
    color: var(--gray-600);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.publication-venue {
    color: var(--gray-700);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

/* Bibliography styling */
.bibliography {
    list-style: none;
    padding: 0;
}

.bibliography li {
    margin-bottom: 0;
    padding: 0;
}

/* Year headings for grouped bibliography */
.bibliography h2 {
    color: var(--gray-800);
    border-bottom: 2px solid var(--gray-300);
    padding-bottom: 0.5rem;
    margin-top: 2rem;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.bibliography h2:first-child {
    margin-top: 0;
}

/* Abstract toggle */
.abstract-container {
    margin-top: 0.5rem;
}

.abstract-text {
    margin-bottom: 0.25rem;
}

.toggle-abstract {
    color: var(--bs-primary);
    text-decoration: none;
    border: none;
    background: none;
    padding: 0;
}

.toggle-abstract:hover {
    color: var(--gray-600);
    text-decoration: underline;
}

/* BibTeX code styling */
.bibtex-code {
    background-color: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 0.375rem;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    overflow-x: auto;
    white-space: pre-wrap;
}

.bibtex-container .card {
    border: 1px solid var(--gray-200);
}

.bibtex-container .card-header {
    background-color: var(--gray-100);
    border-bottom: 1px solid var(--gray-200);
    padding: 0.5rem 1rem;
}

/* Publication type badges */
.badge {
    font-size: 0.75em;
}

/* Button groups in publications */
.btn-group-vertical .btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
}

/* Research highlights */
.research-highlight {
    background: linear-gradient(45deg, var(--gray-50), var(--gray-100));
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.research-highlight h4 {
    color: var(--gray-800);
}

/* Contact page */
.contact-info {
    background-color: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 2rem;
}

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

/* Social links */
.social-links a {
    color: var(--gray-500);
    font-size: 1.2rem;
    transition: color 0.2s ease-in-out;
}

.social-links a:hover {
    color: var(--gray-800);
}

/* Social links under profile picture */
.social-links-profile {
    margin-top: 1rem;
}

.social-links-profile a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.5rem;
    transition: all 0.3s ease-in-out;
    display: inline-block;
}

.social-links-profile a:hover {
    color: white;
    transform: translateY(-2px);
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0;
        text-align: center;
    }
    
    .profile-img {
        width: 150px;
        height: 150px;
        margin-bottom: 1rem;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .display-5 {
        font-size: 1.5rem;
    }
}

/* Utility classes */
.text-primary-custom {
    color: var(--gray-700) !important;
}

.bg-primary-custom {
    background-color: var(--gray-700) !important;
}

.border-primary-custom {
    border-color: var(--gray-300) !important;
}

/* Academic service styling */
.service-category {
    margin-bottom: 2rem;
}

.service-item {
    padding: 1rem 0;
    border-bottom: 1px solid #e9ecef;
}

.service-item:last-child {
    border-bottom: none;
}

.service-role {
    font-weight: 600;
    color: var(--bs-primary);
}

.service-organization {
    color: #6c757d;
}

/* Animation for smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Layout-specific styles */

/* Hero section layout */
.hero-section {
    padding: 3rem 0;
}

.hero-profile-img {
    width: 180px;
    height: 180px;
    object-fit: cover;
}

.hero-name {
    color: white;
    font-family: 'QuestaGrande', 'Georgia', 'Times New Roman', serif;
    font-weight: 900;
}

.hero-tagline {
    color: rgba(255, 255, 255, 0.9);
    font-family: 'QuestaGrande', 'Georgia', 'Times New Roman', serif;
    font-weight: 300;
}

.hero-title {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.hero-affiliation {
    color: rgba(255, 255, 255, 0.8);
    /* font-size: 1.1rem; */
}

.hero-social-icons a {
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.2s;
}

.hero-social-icons a:hover {
    color: white;
}

/* Main content sections */
.content-section {
    padding: 4rem 0;
}

.content-section-white {
    background-color: white;
}

.content-section-gray {
    background-color: var(--gray-50);
}

/* Section headers */
.section-header {
    color: var(--gray-800);
}

.section-icon {
    color: var(--gray-600);
}

/* Biography section */
.biography-text {
    line-height: 1.8;
    text-align: left;
}

.biography-lead {
    color: var(--gray-700);
}

.research-interests-subsection {
    color: var(--gray-800);
    font-weight: 600;
}

.research-interests-icon {
    color: var(--gray-600);
    font-size: 0.9rem;
}

.research-interests-list {
    color: var(--gray-600);
    line-height: 1.7;
}

.research-interest-topic {
    color: var(--gray-700);
}

/* Biography in hero section (dark background) */
.hero-section .biography-text {
    color: rgba(255, 255, 255, 0.9);
}

.hero-section .biography-lead {
    color: rgba(255, 255, 255, 0.9);
}

.hero-section .research-interests-subsection {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
}

.hero-section .research-interests-icon {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.hero-section .research-interests-list {
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.7;
}

.hero-section .research-interest-topic {
    color: rgba(255, 255, 255, 0.95);
}

/* News section */

.news-title {
    color: var(--gray-800);
    font-weight: 600;
}

.news-date {
    color: var(--gray-500);
}

.news-description {
    color: var(--gray-600);
    font-size: 0.95rem;
}

.news-description a, 
.news-description a:visited, 
.news-description a:link {
    color: var(--gray-800) !important;
    text-decoration: underline;
}

.news-description a:hover, 
.news-description a:focus, 
.news-description a:active {
    color: var(--gray-900) !important;
    text-decoration: underline;
}

.news-toggle-btn {
    background-color: var(--gray-200);
    color: var(--gray-700);
    border: none;
    font-size: 0.9rem;
    padding: 0.5rem 1.5rem;
}

/* Selected publications section */
.selected-publication-item a, 
.selected-publication-item a:visited, 
.selected-publication-item a:link {
    color: var(--gray-800) !important;
    text-decoration: underline;
}

.selected-publication-item a:hover, 
.selected-publication-item a:focus, 
.selected-publication-item a:active {
    color: var(--gray-900) !important;
    text-decoration: underline;
}

.selected-publication-title {
    color: var(--gray-800);
    font-weight: 600;
}

.selected-publication-authors {
    color: var(--gray-600);
}

.selected-publication-venue {
    color: var(--gray-700);
    font-weight: 500;
}

.selected-publication-abstract {
    color: var(--gray-600);
    line-height: 1.5;
}

/* Buttons */
.btn-gray {
    background-color: var(--gray-200);
    color: var(--gray-700);
    border: none;
    font-size: 0.9rem;
    padding: 0.5rem 1.5rem;
}

.btn-gray:hover {
    background-color: var(--gray-300);
    color: var(--gray-800);
}

/* Contact page specific */
.contact-header {
    color: var(--gray-800);
}

.contact-section-header {
    color: var(--gray-800);
    font-weight: 600;
}

.contact-info-text {
    color: var(--gray-700);
}

.contact-info-text a, 
.contact-info-text a:visited, 
.contact-info-text a:link {
    color: var(--gray-800) !important;
    text-decoration: underline;
}

.contact-info-text a:hover, 
.contact-info-text a:focus, 
.contact-info-text a:active {
    color: var(--gray-900) !important;
    text-decoration: underline;
}

.contact-link {
    color: var(--gray-700);
    text-decoration: none;
    border-bottom: 1px solid var(--gray-400);
}

.contact-link:hover {
    color: var(--gray-800);
}

.contact-response-badge {
    color: var(--gray-600);
    font-size: 0.9rem;
}

.contact-response-badge-email {
    background-color: var(--gray-200);
    color: var(--gray-700);
    font-size: 0.8rem;
}

.contact-response-badge-academic {
    background-color: var(--gray-300);
    color: var(--gray-700);
    font-size: 0.8rem;
}

.contact-response-badge-students {
    background-color: var(--gray-400);
    color: white;
    font-size: 0.8rem;
}

.contact-response-note {
    color: var(--gray-500);
}

/* Service page specific */
.service-role {
    color: var(--gray-800);
    font-weight: 600;
}

.service-organization {
    color: var(--gray-700);
    font-weight: 500;
}

.service-description {
    color: var(--gray-600);
}

.service-date-badge {
    background-color: var(--gray-200);
    color: var(--gray-700);
}

.service-date-badge-completed {
    background-color: var(--gray-300);
    color: var(--gray-700);
}

/* Notes page specific */
.notes-count-badge {
    background-color: var(--gray-100);
}

.notes-count-number {
    color: var(--gray-700);
    font-weight: 600;
}

.notes-count-text {
    color: var(--gray-600);
}

.note-item-container {
    /* Border removed for cleaner look */
}

.note-title {
    color: var(--gray-800);
    text-decoration: none;
    font-weight: 600;
}

.note-title:hover {
    color: var(--gray-600);
}

.note-date-badge {
    background-color: var(--gray-200);
    color: var(--gray-700);
}

.note-category-badge {
    background-color: var(--gray-300);
    color: var(--gray-700);
    text-transform: capitalize;
}

.note-tag-badge {
    background-color: var(--gray-100);
    color: var(--gray-600);
}

.note-summary {
    color: var(--gray-600);
    font-size: 0.95rem;
}

.note-read-more {
    color: var(--gray-700);
    text-decoration: none;
    border-bottom: 1px solid var(--gray-400);
}

.note-read-more:hover {
    color: var(--gray-800);
}

.category-item-badge {
    background-color: var(--gray-200);
    color: var(--gray-700);
    font-weight: 500;
    text-transform: capitalize;
}

.category-count {
    color: var(--gray-600);
}

/* Biography page specific */
.biography-section {
    margin-bottom: 2rem;
}

.biography-content {
    max-width: none;
}

.biography-text {
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.biography-text a, 
.biography-text a:visited, 
.biography-text a:link {
    color: var(--gray-200) !important;
    text-decoration: underline;
}


.biography-text a:hover, 
.biography-text a:focus, 
.biography-text a:active {
    color: var(--gray-200) !important;
    text-decoration: underline;
}

.biography-section h2 {
    border-bottom: 2px solid var(--gray-300);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

/* LaTeX/MathJax styling */
.has-jax { 
    color: var(--gray-800); 
}

mjx-container[jax="CHTML"] { 
    color: var(--gray-800); 
}

mjx-container[jax="CHTML"][display="true"] { 
    margin: 1em 0; 
    text-align: center; 
}

mjx-container[jax="CHTML"] mjx-math { 
    color: inherit; 
}

.MathJax { 
    color: var(--gray-800); 
}

.MathJax_Display { 
    margin: 1em 0; 
    text-align: center; 
}

/* Bootstrap color overrides for presentation highlighting */
.border-warning {
    border-color: #ffc107 !important;
}

.border-info {
    border-color: #0dcaf0 !important;
}

.bg-warning {
    background-color: #fff3cd !important;
}

.bg-info {
    background-color: #d1ecf1 !important;
}

.bg-opacity-10 {
    --bs-bg-opacity: 0.1;
    background-color: rgba(var(--bs-bg-rgb), var(--bs-bg-opacity)) !important;
}

.text-dark {
    color: #212529 !important;
}

.border-3 {
    border-width: 3px !important;
}

.border-gray-200 {
    border-color: var(--gray-200) !important;
}

/* Additional utility classes for cleanup */
.section-intro {
    line-height: 1.8;
}

.response-time-text {
    color: var(--gray-600);
    font-size: 0.9rem;
}

.response-time-badge {
    font-size: 0.8rem;
}

.response-note {
    color: var(--gray-500);
}

/* Section styling */
.section-description {
    color: var(--gray-600);
    font-style: italic;
    line-height: 1.5;
}

.service-divider {
    border-color: var(--gray-200);
    opacity: 0.5;
}

/* Common text color utilities */
.text-gray-600 {
    color: var(--gray-600) !important;
}

.text-gray-700 {
    color: var(--gray-700) !important;
}

.text-gray-800 {
    color: var(--gray-800) !important;
}

/* Common styling patterns */
.contact-section-header {
    color: var(--gray-800);
    font-weight: 600;
}

.contact-info-text {
    color: var(--gray-700);
}

.contact-link {
    color: var(--gray-700);
    text-decoration: none;
    border-bottom: 1px solid var(--gray-400);
}

.contact-link:hover {
    color: var(--gray-800);
    border-bottom-color: var(--gray-600);
}

.section-icon {
    color: var(--gray-600);
}

/* Publication styling utilities */
.publication-title-style {
    color: var(--gray-800);
    line-height: 1.3;
}

.publication-authors-style {
    color: var(--gray-600);
    font-size: 0.9rem;
}

.publication-venue-style {
    color: var(--gray-700);
    font-size: 0.9rem;
}

.publication-abstract-style {
    color: var(--gray-600);
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Note styling utilities */
.note-title-link {
    color: var(--gray-800);
    text-decoration: none;
    font-weight: 600;
}

.note-date-badge {
    background-color: var(--gray-200);
    color: var(--gray-700);
}

.note-category-badge {
    background-color: var(--gray-300);
    color: var(--gray-700);
    text-transform: capitalize;
}

.note-tag-badge {
    background-color: var(--gray-100);
    color: var(--gray-600);
}

.note-summary-text {
    color: var(--gray-600);
    font-size: 0.95rem;
}

.note-read-more {
    color: var(--gray-700);
    text-decoration: none;
    border-bottom: 1px solid var(--gray-400);
}
