/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    line-height: 1.7;
    color: #333;
    background-color: #ffffff;
}

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

/* Header and Navigation */
header {
    background-color: #1F3A5F;
    color: white;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

nav {
    padding: 1rem 0;
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.nav-links a:hover {
    opacity: 0.8;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    padding: 2rem 0;
    border-bottom: 4px solid #1F3A5F;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: center;
}

.hero-text h2 {
    font-size: 2rem;
    color: #222;
    margin-bottom: 0.3rem;
}

.hero-text h3 {
    font-size: 1.4rem;
    color: #1F3A5F;
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.hero-text .title {
    font-size: 1rem;
    color: #555;
    margin-top: 0.5rem;
}

.hero-image {
    display: none;
}

.hero-image img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Section Styles */
.section {
    padding: 4rem 0;
}

.section h2 {
    font-size: 2rem;
    color: #222;
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #1F3A5F;
    display: inline-block;
}

.section h3 {
    font-size: 1.5rem;
    color: #333;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.section h4 {
    font-size: 1.2rem;
    color: #1F3A5F;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.section p {
    margin-bottom: 1.2rem;
    font-size: 1.05rem;
}

.alt-bg {
    background-color: #f9f9f9;
}

/* Quicklinks Section */
.quicklinks-section {
    background-color: #f5f5f5;
    padding: 0.75rem 0;
    border-bottom: 1px solid #ddd;
}

.quicklinks-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.quicklink-card {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: white;
    border-radius: 5px;
    text-decoration: none;
    color: #555;
    transition: background-color 0.2s ease, color 0.2s ease;
    border: 1px solid #ddd;
    font-size: 0.9rem;
}

.quicklink-card:hover {
    background-color: #1F3A5F;
    color: white;
    border-color: #1F3A5F;
}

.quicklink-card:hover .quicklink-text h3 {
    color: white;
}

.quicklink-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.quicklink-icon-img {
    height: 1.2rem;
    width: auto;
    flex-shrink: 0;
    object-fit: contain;
}

.quicklink-text h3 {
    margin: 0;
    font-size: 0.9rem;
    color: #555;
    font-weight: 500;
    transition: color 0.2s ease;
}

.quicklink-text p {
    display: none;
}

/* Biography Section */
#bio {
    padding-bottom: 2rem;
}

#bio .container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
    align-items: start;
}

#bio .bio-content {
    grid-column: 1;
}

#bio .bio-image {
    grid-column: 2;
    grid-row: 1 / span 10;
    margin-top: 6rem;
}

#bio .bio-image img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 100px;
}

/* Personal Info */
.personal-info {
    background-color: #f5f5f5;
    padding: 2rem;
    border-radius: 8px;
    margin-top: 2rem;
    border-left: 4px solid #1F3A5F;
}

.personal-info h3 {
    margin-top: 0;
    color: #1F3A5F;
}

/* Research Section */
.research-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 3rem;
    align-items: start;
}

.research-text {
    grid-column: 1;
}

.research-image {
    grid-column: 2;
    grid-row: 1 / span 10;
    position: sticky;
    top: 100px;
}

.research-thumbnail {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.5s ease, box-shadow 0.5s ease;
    cursor: pointer;
}

.research-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.research-areas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
    list-style: none;
}

.research-areas li {
    background-color: white;
    padding: 1rem;
    border-radius: 6px;
    border-left: 3px solid #1F3A5F;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#research h3 {
    color: #1F3A5F;
    font-size: 1.4rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.3rem;
    border-bottom: 2px solid #ddd;
}

#research h3:first-of-type {
    margin-top: 2rem;
}

#research p {
    line-height: 1.8;
}

#research a:not(.btn) {
    color: #1F3A5F;
    text-decoration: underline;
}

#research a:not(.btn):hover {
    color: #8B1616;
}

/* Teaching Section */
.teaching-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 3rem;
    align-items: start;
}

.teaching-text {
    grid-column: 1;
}

.teaching-image {
    grid-column: 2;
    grid-row: 1 / span 10;
    position: sticky;
    top: 100px;
}

.teaching-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.youtube-thumbnail {
    margin-top: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.youtube-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.caption {
    font-style: italic;
    color: #666;
    margin-top: 0.5rem;
    font-size: 0.95rem;
}

.teaching-year {
    margin-bottom: 1.5rem;
}

.teaching-year ul {
    margin-left: 2rem;
    margin-top: 0.5rem;
}

.teaching-year li {
    margin-bottom: 0.5rem;
}

.course-listing {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #f5f5f5;
    border-radius: 6px;
    border-left: 3px solid #1F3A5F;
}

.course-listing h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: #1F3A5F;
}

.course-listing p {
    margin-bottom: 0;
    color: #555;
    line-height: 1.6;
}

/* Students Section */
.students-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 3rem;
    align-items: start;
}

.students-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Lab Members Grid */
.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 2rem;
    margin: 2rem 0 3rem 0;
}

.member-card {
    text-align: center;
    transition: transform 0.3s ease;
}

.member-card:hover {
    transform: translateY(-5px);
}

.member-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1rem;
    border: 3px solid #1F3A5F;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    display: block;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.member-photo:hover {
    filter: grayscale(0%);
}

.member-photo.no-photo {
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #1F3A5F;
    border: 3px solid #ddd;
}

.member-name {
    font-weight: 500;
    color: #333;
    font-size: 1rem;
    line-height: 1.4;
}

.member-name a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.member-name a:hover {
    color: #1F3A5F;
}

.member-note {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.25rem;
}

/* Contact Section */
.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.contact-item {
    background-color: #f5f5f5;
    padding: 1.5rem;
    border-radius: 8px;
    border-top: 3px solid #1F3A5F;
}

.contact-item h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #1F3A5F;
    font-size: 1.2rem;
}

.contact-item p {
    margin-bottom: 0;
}

/* Button Styles */
.btn {
    display: inline-block;
    background-color: #1F3A5F;
    color: white;
    padding: 0.8rem 2rem;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: background-color 0.3s;
    margin-top: 1rem;
}

.btn:hover {
    background-color: #8B1616;
}

.btn-small {
    display: inline-block;
    background-color: #1F3A5F;
    color: white;
    padding: 0.5rem 1.2rem;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: background-color 0.3s;
    font-size: 0.95rem;
}

.btn-small:hover {
    background-color: #8B1616;
}

/* Section Header with Links */
.section-header-with-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header-with-links h2 {
    margin-bottom: 0;
}

/* Profile Links */
.profile-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.profile-icon-link {
    display: inline-block;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.profile-icon-link:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

.profile-icon {
    height: 50px;
    width: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Collapsible Section */
.collapsible-section {
    margin-top: 2rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    background-color: #f9f9f9;
}

.collapsible-section summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
}

.collapsible-section summary::-webkit-details-marker {
    display: none;
}

.collapsible-section summary h3 {
    margin: 0;
    display: inline-block;
}

.collapsible-section summary::before {
    content: '▶';
    margin-right: 0.5rem;
    color: #1F3A5F;
    transition: transform 0.3s;
    font-size: 0.8rem;
}

.collapsible-section[open] summary::before {
    transform: rotate(90deg);
}

.collapsible-content {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #ddd;
}

/* Footer */
footer {
    background-color: #222;
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-top: 4rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .quicklinks-grid {
        gap: 0.5rem;
    }

    .quicklink-card {
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
    }

    .quicklink-icon {
        font-size: 1rem;
    }

    .quicklink-icon-img {
        height: 1rem;
    }

    .quicklink-text h3 {
        font-size: 0.85rem;
    }

    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-image {
        order: -1;
    }

    .hero-image img {
        max-width: 250px;
        margin: 0 auto;
    }

    .hero-text h2 {
        font-size: 1.5rem;
    }

    .hero-text h3 {
        font-size: 1.2rem;
    }

    .nav-links {
        flex-wrap: wrap;
        gap: 1rem;
        font-size: 0.9rem;
    }

    nav .container {
        flex-direction: column;
        gap: 1rem;
    }

    #bio .container {
        grid-template-columns: 1fr;
    }

    #bio .bio-image {
        grid-column: 1;
        grid-row: auto;
        text-align: center;
        margin-bottom: 2rem;
    }

    #bio .bio-image img {
        max-width: 250px;
        position: static;
    }

    .students-content {
        grid-template-columns: 1fr;
    }

    .students-image {
        order: -1;
    }

    .research-content {
        grid-template-columns: 1fr;
    }

    .research-image {
        grid-column: 1;
        grid-row: auto;
        position: static;
        text-align: center;
        margin-bottom: 2rem;
        order: -1;
    }

    .research-thumbnail {
        max-width: 400px;
    }

    .teaching-content {
        grid-template-columns: 1fr;
    }

    .teaching-image {
        grid-column: 1;
        grid-row: auto;
        position: static;
        text-align: center;
        margin-bottom: 2rem;
    }

    .teaching-image img {
        max-width: 400px;
    }

    .contact-info {
        grid-template-columns: 1fr;
    }

    .research-areas {
        grid-template-columns: 1fr;
    }

    .members-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1.5rem;
    }

    .member-photo {
        width: 120px;
        height: 120px;
    }
}

@media (max-width: 480px) {
    .section {
        padding: 2rem 0;
    }

    .hero {
        padding: 2rem 0;
    }

    .hero-text h2 {
        font-size: 1.5rem;
    }

    .hero-text h3 {
        font-size: 1.2rem;
    }

    .section h2 {
        font-size: 1.5rem;
    }

    .members-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 1rem;
    }

    .member-photo {
        width: 100px;
        height: 100px;
    }

    .member-name {
        font-size: 0.9rem;
    }
}
