/* --- Global Styles & Variables --- */
:root {
    --primary-color: #007BFF;
    --secondary-color: #6c757d;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
    --text-color: #495057;
    --font-family: 'Inter', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 60px 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 40px;
    color: var(--dark-color);
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: var(--light-color);
    color: var(--dark-color);
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background-color: #e2e6ea;
}


/* --- Navbar --- */
.navbar {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo {
    font-weight: bold;
    font-size: 1.5rem;
    color: var(--dark-color);
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
}

.nav-item {
    margin-left: 20px;
}

.nav-link {
    text-decoration: none;
    color: var(--secondary-color);
    font-weight: bold;
    padding: 5px 0;
    position: relative;
    transition: color 0.3s;
}

.nav-link.active, .nav-link:hover {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s;
}

.nav-link.active::after, .nav-link:hover::after {
    width: 100%;
}


/* Hamburger Menu */
.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--dark-color);
    transition: all 0.3s ease-in-out;
}


/* --- Hero Section --- */
.hero {
    background-color: var(--light-color);
    padding: 80px 0;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.hero-text h1 {
    font-size: 3.5rem;
    color: var(--dark-color);
    margin-bottom: 10px;
}

.hero-text .subtitle {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.rotating-text-container {
    font-size: 1.2rem;
    height: 2em;
    color: var(--primary-color);
    font-weight: bold;
}

.hero-image img {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* --- Metrics Section --- */
.metrics .container {
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.metric-item {
    padding: 20px;
}

.metric-number {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary-color);
}

.metric-label {
    font-size: 1.1rem;
    color: var(--secondary-color);
}


/* --- Timeline Section --- */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}
.timeline::after {
    content: '';
    position: absolute;
    width: 4px;
    background-color: var(--primary-color);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
}
.timeline-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
}
.timeline-item:nth-child(odd) {
    left: 0;
    text-align: right;
}
.timeline-item:nth-child(even) {
    left: 50%;
    text-align: left;
}
.timeline-dot {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    right: -8px;
    background-color: white;
    border: 4px solid var(--primary-color);
    top: 25px;
    border-radius: 50%;
    z-index: 1;
}
.timeline-item:nth-child(even) .timeline-dot {
    left: -8px;
}
.timeline-content {
    padding: 20px 30px;
    background-color: var(--light-color);
    position: relative;
    border-radius: 6px;
}
.timeline-item:nth-child(odd) .timeline-content {
    margin-right: 20px;
}
.timeline-item:nth-child(even) .timeline-content {
    margin-left: 20px;
}
.timeline-content h3 {
    color: var(--dark-color);
}
.timeline-content p {
    color: var(--secondary-color);
    font-size: 0.9rem;
}


/* --- Card Styles --- */
.card-grid, .card-grid-3 {
    display: grid;
    gap: 30px;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.card-grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}
.card {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}
.card-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}
.card h3 {
    color: var(--dark-color);
    margin-bottom: 10px;
}
.card .large-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--dark-color);
}


/* --- Latest News Section --- */
.news-list {
    max-width: 800px;
    margin: 0 auto;
}
.news-item {
    display: flex;
    align-items: flex-start; 
    gap: 20px;
    padding: 20px;
    border-bottom: 1px solid #eee;
}
.news-tag {
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 5px;
    color: #fff;
    flex-shrink: 0;
}
.news-tag.award { background-color: #ffc107; }
.news-tag.grant { background-color: #28a745; }
.news-tag.publication { background-color: var(--primary-color); }
.news-date {
    margin-left: auto;
    color: var(--secondary-color);
    font-weight: bold;
}

/* --- CTA Section --- */
.cta {
    background-color: var(--dark-color);
    color: #fff;
}
.cta-content {
    text-align: center;
}
.cta h2 {
    font-size: 2rem;
    margin-bottom: 30px;
}
.cta-buttons a {
    margin: 0 10px;
}


/* --- Page Specific --- */
.page-header {
    background-color: var(--light-color);
    text-align: center;
}
.page-header h1 {
    font-size: 3rem;
    color: var(--dark-color);
}
.page-header p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 10px auto 0;
}
.table-container {
    overflow-x: auto;
    margin-bottom: 40px;
}
table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}
th, td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
}
th {
    background-color: var(--light-color);
    color: var(--dark-color);
}

/* --- Publication List Enhancements --- */
.publication-list {
    list-style: none; /* Changed from 'decimal' */
    margin-left: 0;
    padding-left: 0;
}
.publication-item {
    display: flex; /* Use flexbox for alignment */
    align-items: flex-start;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}
.pub-number {
    font-weight: bold;
    color: var(--secondary-color);
    width: 40px; /* Give it a fixed width */
    flex-shrink: 0; /* Prevent it from shrinking */
    padding-right: 10px;
    text-align: right;
}
.marker-student, .marker-staff {
    font-weight: bold;
}
.marker-student {
    color: var(--primary-color);
}
.marker-staff {
    color: #28a745; /* Green color for staff */
}
.publication-item {
    padding: 20px 0;
    border-bottom: 1px solid #eee;
}
.pub-year {
    font-weight: bold;
    color: var(--secondary-color);
    display: block;
    margin-bottom: 5px;
}
.pub-title {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--dark-color);
}

.team-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    margin-bottom: 40px;
}
.team-member-card {
    padding: 20px;
    background-color: var(--light-color);
    border-radius: 5px;
}
.team-member-card h3 {
    color: var(--primary-color);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}
.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.3s;
}
.gallery-item img:hover {
    transform: scale(1.05);
}


.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}
.form-group input, .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}


/* --- Footer --- */
.footer {
    background-color: var(--dark-color);
    color: #fff;
    text-align: center;
    padding: 30px 0;
}


/* --- Animations --- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}


/* --- Responsive --- */
@media(max-width: 768px) {
    .hamburger {
        display: block;
    }
    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }
    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: #fff;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 10px rgba(0,0,0,0.1);
    }
    
    .nav-menu.active {
        left: 0;
    }

    .nav-item {
        margin: 16px 0;
    }

    .hero-content {
        flex-direction: column-reverse;
        text-align: center;
    }
    .hero-text h1 { font-size: 2.5rem; }

    .metrics .container { flex-direction: column; }
    
    .timeline::after { left: 31px; }
    .timeline-item { width: 100%; padding-left: 70px; padding-right: 25px; }
    .timeline-item:nth-child(odd), .timeline-item:nth-child(even) { left: 0; text-align: left;}
    .timeline-dot, .timeline-item:nth-child(even) .timeline-dot { left: 23px; }
    .timeline-item:nth-child(odd) .timeline-content, .timeline-item:nth-child(even) .timeline-content { margin: 0; }
    
    .contact-layout { grid-template-columns: 1fr; }
}

/* --- Publication Filter Controls --- */
.filter-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    padding: 20px;
    background-color: var(--light-color);
    border-radius: 8px;
}

.filter-controls input,
.filter-controls select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    font-family: var(--font-family);
}

.filter-controls input {
    flex-grow: 1; /* Allows search bar to take up more space */
    min-width: 250px;
}

.filter-controls select {
    min-width: 150px;
}

/* --- Research Summary Section --- */
.research-summary {
    background-color: var(--light-color);
}
.summary-list {
    list-style: none;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}
.summary-list li {
    font-size: 1.1rem;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}
.summary-list li:last-child {
    border-bottom: none;
}

/* --- Service List in Cards --- */
.service-list {
    list-style: none;
    padding-left: 0;
}
.service-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
}
.service-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

/* --- Citation Table Specific Styles --- */
.citation-table th, .citation-table td {
    text-align: center;
}

/* --- Single Award Card Style --- */
.card.single-award {
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
}

.team-grid + h3 {
    margin-top: 40px;
}

/* --- Multi-column Service List --- */
.service-list.columns {
    columns: 2;
    -webkit-columns: 2;
    -moz-columns: 2;
}

@media(max-width: 768px) {
    .service-list.columns {
        columns: 1;
        -webkit-columns: 1;
        -moz-columns: 1;
    }
}


/* --- Show More Controls --- */
.show-more-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    margin-top: 25px;
    margin-bottom: 25px;
    padding-top: 15px;
    padding-bottom: 15px;
    /* border-top: 1px solid #eee; */ /* Light separator line */
}
.pub-count {
    color: var(--secondary-color);
    font-size: 0.9rem;
}
.show-more-link, .show-less-link {
    text-decoration: none;
    color: var(--secondary-color);
    font-weight: bold;
    font-size: 0.9rem;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}
.show-more-link:hover, .show-less-link:hover {
    color: var(--primary-color);
}

/* ADD THIS NEW BLOCK */
.title-link {
    color: #1d2e91;
    text-decoration: none;
    /* font-weight: bold; */
    border-bottom: 1px solid transparent;
    transition: border-bottom 0.3s ease;
}
.title-link:hover {
    border-bottom: 1px solid var(--primary-color);
}


/* --- New Contact Page Styles --- */
.contact-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}
.contact-card {
    background: var(--light-color);
    padding: 30px;
    border-radius: 8px;
    text-align: center;
}
.contact-card .card-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}
.contact-card h3 {
    margin-bottom: 15px;
    color: var(--dark-color);
}
.contact-card p {
    color: var(--secondary-color);
    line-height: 1.8;
}

.form-map-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: flex-start;
}

.form-group input, .form-group textarea {
    background-color: var(--light-color);
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}
.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}
.contact-form button {
    width: 100%;
}

.map-placeholder {
    width: 100%;
    height: 100%;
    min-height: 300px;
    background-color: #e9ecef;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--secondary-color);
    font-weight: bold;
}

@media(max-width: 768px) {
    .form-map-grid {
        grid-template-columns: 1fr;
    }
}


/* --- New Service Page Styles --- */
.service-tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    color: #fff;
    margin-bottom: 15px;
}
.service-tag.university {
    background-color: var(--primary-color);
}
.service-tag.school {
    background-color: var(--secondary-color);
}
.service-period {
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin-top: 10px;
}

/* Accordion Styles */
.accordion-container {
    max-width: 900px;
    margin: 60px auto 0;
}
.accordion-header {
    width: 100%;
    background-color: var(--light-color);
    border: none;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border-radius: 8px;
    text-align: left;
}
.accordion-header h3 {
    margin: 0;
    color: var(--dark-color);
}
.accordion-icon {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}
.accordion-header.active .accordion-icon {
    transform: rotate(45deg);
}
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    background-color: #fff;
    padding: 0 20px;
}
.accordion-content ul {
    padding: 20px 0;
}


/* --- New Team Page Photo Styles --- */
.team-grid-photo {
    display: grid;
    gap: 30px;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    margin-bottom: 40px;
}
.team-member-card-photo {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background-color: var(--light-color);
    border-radius: 8px;
}
.team-member-card-photo img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.team-member-details h3 {
    color: var(--primary-color);
    margin-bottom: 5px;
}
.team-member-details p {
    font-size: 0.9rem;
    line-height: 1.5;
}

/* --- Research Vision Section --- */
/* .research-vision {
    background-color: var(--light-color);
} */
.research-vision blockquote {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.2rem;
    font-style: italic;
    color: var(--secondary-color);
    border-left: 5px solid var(--primary-color);
    border-right: 5px solid var(--primary-color);
    padding-left: 30px;
    padding-right: 30px;
}