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

/* Base styles */
:root {
    --primary-color: #2d3748;
    --secondary-color: #4a5568;
    --accent-color: #3182ce;
    --background-color: #f7fafc;
    --text-color: #1a202c;
    --light-text: #f8f9fa;
    --card-bg: #ffffff;
    --card-shadow: 0 4px 6px rgba(0,0,0,0.1);
    --transition-speed: 0.3s;
    --heading-font: 'Source Serif Pro', serif;
    --body-font: 'Montserrat', sans-serif;
    --border-radius-lg: 12px;
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --spacing-md: 15px;
    --spacing-lg: 25px;
    --spacing-xl: 40px;
}

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

body {
    font-family: var(--body-font);
    line-height: 1.6;
    background-color: var(--background-color);
    color: var(--text-color);
    background-image: linear-gradient(to right, rgba(49, 130, 206, 0.03) 1px, transparent 1px),
                     linear-gradient(to bottom, rgba(49, 130, 206, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    font-size: 1.05rem;
}

.page-wrapper {
    min-height: 100vh;
    position: relative;
}

/* Navigation */
.navbar {
    background-color: var(--primary-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 75px; /* Set fixed height for navbar to accommodate larger logo */
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--light-text);
    padding: 15px;
    cursor: pointer;
    font-size: 1.1rem;
}

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

.nav-menu li a {
    display: block;
    color: var(--light-text);
    text-decoration: none;
    padding: 20px 18px;
    font-weight: 500;
    transition: all var(--transition-speed);
    position: relative;
}

.nav-menu li a:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background-color: var(--accent-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-menu li a:hover:after {
    width: 70%;
}

.nav-menu li a:hover {
    color: #ffffff;
}

/* Logo Area */
.brand-logo {
    display: flex;
    align-items: center;
    color: var(--light-text);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.4rem; /* Increased from 1.35rem */
    padding: 15px 0;
}

.brand-logo img {
    height: 65px; /* Increased from 55px */
    margin-right: 14px; /* Slightly more spacing */
    transition: transform 0.3s ease;
}

/* Thumbnail */
.thumbnail-container {
    position: fixed;
    top: 115px; /* Adjusted to account for taller navbar */
    right: 30px;
    z-index: 900;
    width: 90px;  /* Smaller size */
    height: 90px; /* Smaller size */
    border-radius: 50%; /* Circular thumbnail for better visual appeal */
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    background-color: #ffffff;
    padding: 3px;
    border: 2px solid var(--accent-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* Ensures the bubble doesn't overlap with text */
    margin-left: 20px;
    /* Hide on smaller screens */
    display: block;
}

.thumbnail-container:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.thumbnail-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Main Content */
.main-content {
    padding-top: 95px; /* Increased to account for taller navbar */
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
    /* Right padding only on larger screens where thumbnail is shown */
    padding-right: 20px;
}

/* Carousel */
.carousel {
    position: relative;
    width: 100%;
    max-width: 1200px;
    height: 500px;
    margin: 30px auto;
    overflow: hidden;
    background-color: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--card-shadow);
    /* Enable hardware acceleration for smoother animations */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.carousel-inner {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-inner .item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
}

.carousel-inner .item.active {
    opacity: 1;
    display: flex;
    visibility: visible;
}

.carousel-inner .item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Ensure image is properly centered */
    display: block;
    margin: 0 auto;
    max-height: 450px;
    /* No filter needed on white background */
    filter: none;
}

/* No gradient overlay needed with white background */

/* Carousel Caption */
.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(49, 130, 206, 0.8); /* Use blue accent color with transparency */
    color: white;
    padding: 15px 20px 40px; /* Adjusted padding */
    text-align: center;
    z-index: 5; /* Ensure caption is above other elements */
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg); /* Match carousel border radius */
}

.carousel-caption h3 {
    font-size: 1.6rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.carousel-caption p {
    font-family: var(--heading-font);
    font-size: 1.4rem;
    margin-bottom: 0;
    opacity: 0.95;
    font-weight: 500;
    line-height: 1.4;
}

/* Carousel Navigation */
.carousel-nav {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
    padding: 5px 10px;
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
    margin: 0 2px; /* Improved spacing */
}

.carousel-dot:hover {
    transform: scale(1.2);
}

.carousel-dot.active {
    background-color: #ffffff;
    transform: scale(1.2);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3); /* Added focus indicator */
}

/* Carousel Controls */
.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background-color: rgba(0, 0, 0, 0.4);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-control:hover {
    background-color: rgba(0, 0, 0, 0.7);
    transform: translateY(-50%) scale(1.1);
}

.carousel-control.prev {
    left: 20px;
}

.carousel-control.next {
    right: 20px;
}

/* Welcome Section */
.welcome-section {
    text-align: center !important;
    padding: 40px var(--spacing-lg);
    margin-bottom: 40px;
    background-color: var(--card-bg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    border-top: 4px solid var(--accent-color);
}

.welcome-section h1 {
    font-family: var(--heading-font);
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--primary-color);
    font-weight: 700;
    line-height: 1.2;
    text-align: center !important;
}

.welcome-section p {
    font-size: 1.4rem;
    max-width: 800px;
    margin: 0 auto;
    color: var(--secondary-color);
    line-height: 1.5;
    text-align: center !important;
}

/* Content Sections */
.content-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-xl);
    padding: var(--spacing-lg) 0;
    max-width: 1000px;
    margin: 0 auto;
}

.content-section {
    background-color: var(--card-bg);
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-xl);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--card-shadow);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    border-bottom: 3px solid transparent;
}

.content-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.12);
    border-bottom: 3px solid var(--accent-color);
}

.content-section h2 {
    font-family: var(--heading-font);
    color: var(--primary-color);
    margin-bottom: 18px;
    font-size: 2.2rem;
    position: relative;
    padding-bottom: 12px;
    font-weight: 600;
}

.content-section h2:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--accent-color);
}

.content-section p {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--secondary-color);
}

.content-section .icon {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 15px;
}

/* Download button styling */
.cta-button {
    display: inline-block;
    background-color: var(--accent-color);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.cta-button:hover {
    background-color: #2c5282;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.text-center {
    text-align: center;
}

/* Staff Page Styles */
.staff-profile {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 30px;
    overflow: hidden;
}

.profile-image {
    flex: 0 0 300px;
    height: 400px; /* Taller height for Dr. Muhlbauer's photo to maintain proportions */
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Changed to contain to maintain original aspect ratio */
    object-position: left; /* Left-align the image */
    border-radius: 8px;
    transition: transform 0.3s ease;
    background-color: #f5f7fa; /* Light background for portrait */
    padding: 5px; /* Add slight padding */
}

.profile-image img:hover {
    transform: scale(1.03);
}

.profile-info {
    flex: 1;
}

.profile-info h2 {
    margin-bottom: 15px;
    font-size: 2rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
    display: inline-block;
}

.profile-info h3 {
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-size: 1.4rem;
}

.profile-info p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color);
}

.experience-list {
    list-style-type: none;
    padding-left: 0;
    margin-top: 40px;
}

.experience-list li {
    margin-bottom: 15px;
    font-size: 1.1rem;
    line-height: 1.6;
    padding-left: 35px;
    position: relative;
    text-align: left;
}

.experience-list li:before {
    content: '•';
    color: var(--accent-color);
    font-weight: bold;
    font-size: 1.5rem;
    position: absolute;
    left: 8px;
    top: -2px;
}

/* Admin section */
.admin-section {
    display: flex;
    align-items: center;
    overflow: hidden;
    margin-bottom: var(--spacing-xl);
}

.admin-image {
    flex: 0 0 40%;
    min-height: 300px;
    max-height: 400px;
    overflow: hidden;
    border-radius: 8px; /* Add rounded corners */
}

.admin-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-radius: 8px; /* Match parent container */
}

.admin-image img:hover {
    transform: scale(1.02);
}

.admin-content {
    flex: 0 0 60%;
    padding: var(--spacing-xl);
}

.admin-content h2 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
    font-size: 1.8rem;
}

.admin-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--secondary-color);
}

/* Footer */
.footer {
    background-color: var(--primary-color);
    color: var(--light-text);
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    /* Ensure content is readable on narrow screens */
    min-width: 0;
}

.footer-section h3 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
    display: inline-block;
}

.footer-section p, .footer-section a {
    color: #bdc3c7;
    line-height: 1.8;
}

.footer-section a {
    display: block;
    text-decoration: none;
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #ffffff;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    margin-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Responsive adjustments for staff page */
@media (max-width: 768px) {
    .staff-profile {
        flex-direction: column;
    }

    .profile-image {
        flex: 0 0 auto;
        max-width: 100%;
        height: auto; /* Let height be determined by content */
        margin: 0 auto 20px;
        max-width: 280px; /* Fixed width for thumbnail style */
    }
    
    .admin-section {
        flex-direction: column;
    }
    
    .admin-image, .admin-content {
        flex: 0 0 100%;
    }
    
    .admin-image {
        min-height: 250px;
        max-height: 300px; /* Limit height on mobile */
        overflow: hidden;
    }
    
    .admin-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }
}

@media (max-width: 480px) {
    .profile-info h2 {
        font-size: 1.6rem;
    }

    .profile-info h3 {
        font-size: 1.2rem;
    }

    .experience-list li {
        font-size: 1rem;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .carousel {
        height: 400px;
    }
    
    .carousel-inner .item img {
        height: 400px;
    }
    
    .thumbnail-container {
        width: 90px;
        height: 90px;
    }
    
    .profile-image {
        flex: 0 0 250px;
        height: 250px;
    }
    
    .admin-image {
        min-height: 280px;
    }
}

@media (max-width: 1024px) {
    /* On medium screens, set a reasonable right padding */
    .main-content {
        padding-right: 20px;
    }
}

@media (max-width: 768px) {
    .navbar-toggle {
        display: block;
        width: auto; /* Ensure button is sized by content */
        overflow: visible; /* Prevent text cut-off */
        white-space: nowrap; /* Keep text on one line */
        margin-right: 10px; /* Add some space from the edge */
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: var(--primary-color);
        position: absolute;
        top: 100%;
        left: 0;
        box-shadow: 0 8px 16px rgba(0,0,0,0.1);
        z-index: 100;
    }
    
    /* On narrow screens (not just mobile phones) show a more compact header */
    .brand-logo {
        max-width: 80%; /* Allow enough space for title */
    }
    
    /* Hide logo on narrow screens to prevent menu overlap */
    .brand-logo img {
        display: none;
    }
    
    /* Adjust title position when logo is hidden */
    .brand-logo {
        padding-left: 5px;
        justify-content: flex-start; /* Left-align the title */
    }
    
    /* Ensure nav container spacing is appropriate */
    .nav-container {
        justify-content: space-between;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li a {
        padding: 15px 20px;
        font-size: 1.1rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .nav-menu li a:after {
        display: none;
    }
    
    .nav-menu li:last-child a {
        border-bottom: none;
    }

    .carousel {
        height: 350px;
        max-width: 90%;
        margin: 20px auto;
    }

    .content-section {
        padding: 20px;
    }

    /* Hide the thumbnail for better mobile layouts */
    .thumbnail-container {
        display: none;
    }
    
    .welcome-section h1 {
        font-size: 2rem;
    }
    
    /* Center align text for better mobile reading */
    .content-section p, .admin-content p {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .carousel {
        height: 250px;
        max-width: 95%;
        margin: 20px auto;
        border-radius: 8px; /* Smaller radius for mobile */
    }
    
    /* Improve menu toggle display on small screens */
    .navbar-toggle {
        padding: 15px 10px; /* More horizontal padding */
        font-size: 1rem; /* Slightly smaller font to fit better */
    }
    
    .navbar-toggle span {
        display: inline-block; /* Ensures proper rendering */
    }
    
    /* Ensure mobile title is properly sized and positioned */
    .brand-logo {
        font-size: 1.2rem; /* Smaller font size on mobile */
        max-width: 75%; /* Allow more space for title when logo is hidden */
        justify-content: flex-start; /* Left-align the title */
    }
    
    /* Ensure full title is visible on mobile */
    .brand-logo span {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        font-size: 1rem; /* Smaller font size to fit the full title */
        line-height: 1.2;
        max-width: 200px; /* Limit width to prevent overlap with menu button */
    }
    
    /* Increase touch targets for mobile */
    .carousel-control {
        width: 40px;
        height: 40px;
    }
    
    .carousel-dot {
        width: 10px;
        height: 10px;
        margin: 0 4px; /* More space for touch */
    }

    .content-section h2 {
        font-size: 1.8rem;
    }

    .content-section p {
        font-size: 1.05rem;
    }
    
    /* Improve carousel caption readability */
    .carousel-caption {
        background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.6) 60%, rgba(0,0,0,0));
        padding: 15px 15px 40px; /* Adjust padding for mobile */
    }
    
    .carousel-caption p {
        font-size: 1.1rem;
        line-height: 1.4;
        padding: 0 8px;
    }
    
    .welcome-section {
        padding: 25px 15px;
    }
    
    .welcome-section h1 {
        font-size: 2.2rem;
        line-height: 1.3;
    }
    
    .welcome-section p {
        font-size: 1.15rem;
    }
    
    .profile-image {
        height: 400px;
        max-width: 280px;
        margin: 0 auto 20px;
    }
    
    .staff-profile {
        padding: 15px;
    }
    
    .admin-section {
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    
    .admin-image {
        min-height: 180px;
    }
    
    .admin-content {
        padding: 15px;
    }
    
    /* Improve content readability */
    .content-container {
        gap: 20px;
    }
    
    /* Center some elements for better mobile experience but keep text left-aligned */
    .content-section {
        text-align: left;
        padding: 15px;
    }
    
    .content-section .icon {
        margin: 0 auto 15px;
        display: block;
    }
    
    .content-section h2 {
        text-align: center;
    }
    
    /* Ensure bullets remain left-aligned */
    .experience-list li {
        text-align: left;
    }
    
    /* Footer improvements for mobile */
    .footer-section {
        text-align: center;
    }
    
    .footer-section h3 {
        display: block;
        text-align: center;
        margin-left: auto;
        margin-right: auto;
    }
}
