@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&display=swap');

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

/* Page fade-in animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f7f8fa;
    color: #2d2d2d;
    font-size: 14pt;
    line-height: 1.7;
    letter-spacing: 0.01em;
    margin-top: 70px; /* space for fixed navbar only */
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 70px);
}

body .container {
    animation: fadeInUp 0.6s ease-out;
}

header {
    position: fixed;
    width: 100%;
    background-color: rgba(0, 25, 60, 1);
    backdrop-filter: blur(8px);
    color: rgb(255, 255, 255);
    padding: 5px 0px 5px 0px;
    margin: 0px 0px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    top: 0;
}

/* Header banner below navbar */
.header-banner {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.header-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 60%;
    display: block;
}

section {
    margin: 20px 0;
    width:100%;
}

#bio h2{
    text-align: left;
}

#back-top{
    color: white;
    text-decoration: none;
    padding: 5px 25px;
}

#bio h3{
    font-size: 1.2em;
    font-weight: bold;
    margin: 0; 
    color: rgba(0, 25, 60);
}

#bio h4{
    font-size: 1em;
    margin: 0;
    font-weight: 200;
    color: rgba(0, 25, 60);
}

#bio h5{
    font-size: 1em;
    font-weight: 200;
    margin: 0;
    font-style: italic;
    color: rgba(0, 25, 60);
}


.section-sep{
    background-color:  rgba(0, 25, 60, 0.8); /* Semi-transparent background */
    color: rgb(255, 255, 255);
    padding:0px 15px;
    border-radius: 5px;
}

p strong {
    color: rgb(0, 25, 60);
}

p a {
    color: rgba(0, 25, 60);
    font-weight: bold;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
    transition: color 0.25s ease, text-decoration-color 0.25s ease;
}

.text-column a:hover {
    color: #2474a2;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

header h1 {
    margin: 0 0 0 20px;
    padding: 15px;
    font-size: 1.3em;
}

header nav {
    display: flex;
    font-size: 15px;
    margin: 0 50px 0 0;
    overflow: hidden;
}

/* menu button */
.navbtn {
    display: none;
    font-size: 2em;
    border: none;
    outline: none;
    color: white;
    padding: 5px 25px;
    font-weight: bold;
    background-color: inherit;
    font-family: inherit;
    margin: 0;
    cursor: pointer;
}

.nav-content {
    display: flex;
}

/* Dropdown button */
.dropdown .dropbtn {
    font-size: inherit;
    border: none;
    outline: none;
    color: white;
    padding: 5px 25px;
    font-weight: bold;
    background-color: inherit;
    font-family: inherit; /* Important for vertical align on mobile phones */
    margin: 0; /* Important for vertical align on mobile phones */
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: rgba(0, 25, 60); 
    font-family: inherit; /* Important for vertical align on mobile phones */
    font-weight: bold;
    min-width:160px;
}

/* Show the dropdown menu on hover */
.dropdown:hover .dropdown-content {
    display: block;
    border-radius: 5px;
}

header nav a {
    color: white;
    text-decoration: none;
    padding: 5px 25px;
    font-weight: bold;
    display: block;
    transition: background-color 0.25s ease;
}

header nav a.active {
    background-color: rgba(36, 116, 162, 0.4);
    border-radius: 5px;
}

#scrollToMain{
    color: white;
    text-decoration: none;
    padding: 5px 25px;
    font-weight: bold;
    display: block;
}

header nav a:hover {
    color: white;
    background-color: #2474a2;
    border-radius: 5px;
}

.dropbtn:hover {
    color: white;
    background-color: #2474a2;
    border-radius: 5px;
}

.container {
    width: 65%;
    margin: 20px auto;
    overflow: hidden;
    flex: 1;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
}

.row h2 {
    text-align: center;
    width: 100%;
}

.column {
    padding: 0.5em;
    flex: 1;
}

.text-column {
    display: flex;
    flex-direction: column;
    padding: 20px 40px;
    margin: 0;
    min-width: 70%;
}

.text-column p {
    margin: 0.5em 0; /* Reduced from default 1em to 0.5em */
}

.image-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Add this to center vertically */
    flex: 1;
    /*min-height: 20%; /* Add this to ensure full height */
}

.card-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 25px 20px;
    margin: 0px;
    border-top: 3px solid #2474a2;
}

.image-column img {
    width: 200px; /* Reduced from 250px to match bio-image */
    object-fit: cover;
}

.bio-image {
    border-radius: 50%;
    width: 100%;
    max-width: 200px; /* Reduced from 250px */
}

.icon-container {
    margin: 0.5em 0 0 0;
    width: 100%;
    text-align: center;
}

.icon-container a {
    margin: 0 0.5em;
    text-decoration: none;
    font-size: 1.8em;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.icon-container a:hover {
    transform: scale(1.15);
    opacity: 0.8;
}

.icon-container .linkedin {
    color: #0077b5; /* LinkedIn brand blue */
}

.icon-container .scholar {
    color: #4285F4; /* Google Scholar blue */
}

.icon-container .gmail {
    color: #c71610; /* Gmail red */
}

footer {
    background: rgba(0, 25, 60, 1);
    backdrop-filter: blur(3px);
    color: white;
    text-align: center;
    font-size: 12px;
    padding: 10px 0;
    width: 100%;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

@media (max-width: 800px) {
    .row {
        flex-direction: column;
    }

    .navbtn {
        display: flex;
    }

    .nav-content {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        background-color: rgba(0, 25, 60, 1);
        border-radius: 8px;
        padding: 10px 0;
        min-width: 200px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .nav-content.show {
        display: block;
    }

    header nav a,
    .dropdown .dropbtn {
        padding: 12px 25px;
        width: 100%;
        box-sizing: border-box;
        text-align: left;
    }

    .dropdown-content {
        position: static;
        background-color: rgba(0, 25, 60, 1);
        display: none;
        padding: 5px 0;
    }

    .dropdown-content a {
        padding-left: 40px;
    }

    .dropdown.active .dropdown-content {
        display: block;
    }

    header nav a:hover,
    .dropbtn:hover {
        background-color: #2474a2;
    }

    .header-banner {
        height: 255px;
    }

    .container {
        width: 90%;
        margin: 20px auto;
        overflow: visible;
    }

    body {
        margin-top: 60px; /* space for fixed navbar only */
        min-height: calc(100vh - 60px);
    }
    
    .row {
        margin: 0;
    }

    .text-column {
        padding: 20px;
    }

    header h1 {
        font-size: 1em;
        margin: 0 0 0 10px;
        padding: 10px;
    }

    .card-container {
        margin-top: -157px;
        position: relative;
        z-index: 1;
    }
}

/* Intermediate widths: columns wrap but desktop banner applies */
@media (min-width: 801px) and (max-width: 1300px) {
    .container {
        overflow: visible;
    }

    .card-container {
        margin-top: -170px;
        position: relative;
        z-index: 1;
    }
}

.em_title {
    font-size: 1.15em;
    color: #2474a2;
}

h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8em;
    padding-bottom: 10px;
    color: rgba(0, 25, 60);
    margin: 0 0 20px 0;
}

hr {
    border: none;
    height: 1px;
    background: linear-gradient(to right, rgba(0, 25, 60, 0.3), rgba(0, 25, 60, 0.08));
    margin: 5px 0 25px 0;
}

.carousel-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: #ffffff; /* White background for a clean look */
    border-radius: 10px; /* Rounded corners for elegance */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
}

.carousel {
    display: flex;
    transition: transform 0.5s ease;
}

.carousel-item {
    flex: 0 0 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px; /* Consistent padding for elegance */
    border-bottom: 1px solid #e0e0e0; /* Light border for separation */
}

.project-info {
    flex: 1;
    padding-right: 20px; /* Reduced padding for balance */
    font-family: 'Playfair Display', serif; /* Elegant font for project info */
    color: #333; /* Darker text for readability */
}

.project-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    width: 100%;
    box-sizing: border-box;
    border-left: 3px solid #2474a2;
    padding: 20px;
}

.project-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.project-header {
    display: flex;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 25, 60, 0.1);
    cursor: pointer;
    user-select: none;
}

.project-header:hover {
    opacity: 0.8;
}

.project-header h3 {
    color: rgba(0, 25, 60);
    font-size: 1.05em;
    font-weight: 400;
    margin: 0;
    flex: 1;
}

.project-chevron {
    margin-left: auto;
    font-size: 1.2em;
    color: rgba(0, 25, 60, 0.5);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.project-chevron.rotated {
    transform: rotate(180deg);
}

.project-header:has(+ .project-content.collapsed) {
    padding-bottom: 0;
    border-bottom: none;
}

.project-content {
    padding-top: 15px;
}

.project-content.collapsed {
    display: none;
}

.project-details {
    padding: 15px;
    background-color: #f7f8fa;
    border-radius: 6px;
}

.project-description {
    color: #4a4a4a;
    margin: 0 0 12px 0;
}

.project-citation {
    color: #4a4a4a;
    margin: 0 0 12px 0;
}

.project-link {
    display: inline-block;
    color: #2474a2;
    font-weight: 600;
    text-decoration: none;
    padding: 6px 14px;
    border: 1.5px solid #2474a2;
    border-radius: 5px;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.project-link:hover {
    background-color: #2474a2;
    color: white;
}

.project-image {
    margin-right: 20px;
    flex-shrink: 0;
}

.project-image img {
    width: 88px;
    height: 88px;
    object-fit: contain;
    border-radius: 4px;
}

.construction-message {
    text-align: center;
    padding: 2rem;
    background-color: white;
    border-radius: 8px;
    margin: 2rem 0;
}

.construction-message i {
    font-size: 3rem;
    color: #ffc107;
    margin-bottom: 1rem;
}

.construction-message p {
    font-size: 1.2rem;
    color: #6c757d;
    margin: 0;
}

a:hover {
    color: #2474a2;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

/* Override link styles for gation and footer */
header nav a,
#scrollToMain,
footer a {
    color: white;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    font-weight: bold; /* Keep navigation links bold */
}

header nav a:hover,
#scrollToMain:hover,
footer a:hover {
    color: white;
    background-color: #2474a2;
    text-decoration: none;
    border-bottom: 1px solid white;
}

/* Style links in construction message */
.construction-message a {
    color: rgba(0, 25, 60);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    font-weight: 500;
}

.construction-message a:hover {
    color: #2474a2;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

/* Timeline styles */
.timeline {
    position: relative;
    padding: 20px 0;
    margin: 40px 0;
    width: 90%;
    margin-left: auto;
    margin-right: auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 30px;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, #2474a2, rgba(36, 116, 162, 0.15));
}

.timeline-item {
    position: relative;
    margin-bottom: 60px;
    width: 100%;
}

.timeline-dot {
    position: absolute;
    left: 30px;
    transform: translateX(-50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: #2474a2;
    z-index: 1;
    box-shadow: 0 0 0 4px rgba(36, 116, 162, 0.2);
}

.timeline-date {
    position: absolute;
    left: 70px;
    top: -30px;
    font-weight: 500;
    color: rgba(0, 25, 60);
}

.timeline-content {
    margin-left: 70px;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    border-left: 3px solid #2474a2;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.timeline-content:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.timeline-content-text {
    flex: 1;
}

.timeline-content h3 {
    color: rgba(0, 25, 60);
    margin: 0 0 10px 0;
    font-size: 1.2em;
}

.timeline-content .institution {
    color: #2474a2;
    font-weight: 500;
    margin: 5px 0;
}

.timeline-content .description {
    color: #4a4a4a;
    margin: 10px 0;
}

.award-image {
    width: 150px;
    height: auto;
    border-radius: 4px;
    flex-shrink: 0;
}

@media (max-width: 800px) {
    .timeline {
        width: 100%;
    }

    .timeline::before {
        left: 50%;
        transform: translateX(-50%);
    }

    .timeline-dot {
        left: 50%;
    }

    .timeline-date {
        position: static;
        text-align: left;
        margin-bottom: 10px;
        padding-left: calc(50% + 20px);
    }

    .timeline-content {
        margin-left: 0;
        flex-direction: column;
    }

    .award-image {
        width: 100%;
        height: auto;
        margin-top: 15px;
    }
}

/* Teaching Experience Styles */
.institution-section {
    margin-bottom: 40px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    border-left: 3px solid #2474a2;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.institution-section:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.institution-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 25, 60, 0.1);
    cursor: pointer;
    user-select: none;
}

.institution-header:hover {
    opacity: 0.8;
}

.institution-chevron {
    margin-left: auto;
    font-size: 1.2em;
    color: rgba(0, 25, 60, 0.5);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.institution-chevron.rotated {
    transform: rotate(180deg);
}

.institution-header:has(+ .teaching-experiences.collapsed) {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.institution-image {
    width: 100px;
    height: 100px;
    object-fit: contain;
    margin-right: 20px;
    border-radius: 4px;
    transition: transform 0.3s ease;
}

.institution-image:hover {
    transform: scale(1.05);
}

.institution-header h3 {
    color: rgba(0, 25, 60);
    font-size: 1.05em;
    font-weight: 400;
    margin: 0;
}

.teaching-experiences {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.teaching-experiences.collapsed {
    display: none;
}

.teaching-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding: 15px;
    background-color: #f7f8fa;
    border-radius: 6px;
    transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.teaching-card:hover {
    background-color: #eef1f5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.teaching-content {
    flex: 1;
}

.teaching-content h4 {
    color: rgba(0, 25, 60);
    margin: 0 0 10px 0;
    font-size: 1.2em;
}

.teaching-content .role {
    color: #2474a2;
    font-weight: 500;
    margin: 5px 0;
}

.teaching-content .description {
    color: #4a4a4a;
    margin: 10px 0;
}

.experience-image {
    width: 150px;
    height: auto;
    border-radius: 4px;
    transition: transform 0.3s ease;
}

.experience-image:hover {
    transform: scale(1.05);
}

@media (max-width: 800px) {
    .institution-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .institution-header h3 {
        font-size: 1.1em;
    }

    .institution-image {
        margin-bottom: 15px;
    }

    .teaching-card {
        flex-direction: column;
    }

    .experience-image {
        width: 100%;
        margin-top: 15px;
    }

    .project-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .project-header h3 {
        font-size: 1.1em;
    }

    .project-image {
        margin-right: 0;
        margin-bottom: 12px;
    }
}
