/* General Reset and Box Model */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    background-color: #f0f0f0; 
    color: #333; 
}

/* Header and Navigation */

header {
    background-color: #361B6B;
    padding: 0;
    position: sticky;
    top: 0;
    width: 100vw;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: none;
    width: 100%;
    padding: 0 1rem;
}

.name {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    letter-spacing: 1px;
    margin: 0;
    padding: 0;
    transition: transform 0.2s ease 0.3s;
}

.name:hover {
    transform:scale(1.1);
}

nav {
    display: flex;
}

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

nav li {
    flex: 1;
    margin: 0;
    padding: 0;
}

nav a {
    display: block;
    text-decoration: none;
    color: white;
    background-color: #361B6B;
    padding: 1rem;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    transition: background-color 0.3s, color 0.3s;
}

nav a:hover {
    background-color: #5A3D93;
}

nav a:active {
    background-color: #5d5d5d;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

section {
    margin-bottom: 4rem;
    scroll-margin-top: 60px;
}

/* Section Titles */

.section-title {
    font-size: 36px;
    margin-bottom: 1rem;
}

/* About Me */

.about-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 5px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.about-text {
    flex: 1;
    padding-right: 2rem;
}

.about-image {
    flex-shrink: 0; /* Prevent the image from shrinking */
    text-align: center;
}

.profile-image {
    width: 250px;
    height: auto;
    border-radius: 5px;
    object-fit: cover;
    display: block;
    overflow: hidden;
}

#resume-button {
    margin-top: 35px;
}

.about-me {
    font-size: 20px;
    margin-bottom: 1.5rem;
}

/* Projects */

.project-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.project-card {
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    padding: 1rem;
    border-radius: 5px;
    overflow: hidden;
    min-height: 300px;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
    margin-bottom: 1rem;
}

.project-card:hover {
    transform: scale(1.05); /* Slightly enlarge the card */
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.project-date {
    font-size: 14px;
    font-style: italic;
    opacity: 60%;
    margin-bottom: 1rem;
}

.project-card .description {
    flex: 1;
}


.skill-icons {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    overflow: visible;
}

.skill-icons img {
    width: 35px;
    height: 35px;
    object-fit: contain;
}

.button-container {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
    width: 100%;
}

.project-link {
    flex: 1;
    display: inline-block;
    background-color: #361B6B;
    color: #fff;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 3px;
    text-align: center;
    box-sizing: border-box;
    transition: background-color 0.3s, color 0.3s;
}

.project-link:hover {
    background-color: #5A3D93; /* Color change on hover */
}

.project-link:active {
    background-color: #5d5d5d; /* Color change when button is pressed */
}

/* Skills */

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 1.5rem;
    justify-items: center;
}

/* wrapper for icon + label */
.skill-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* icon */
.skill-item img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    filter: grayscale(100%);
    transition: transform 0.25s ease, filter 0.25s ease;
}

/* label */
.skill-item span {
    margin-top: 0.5rem;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

/* hover effects */
.skill-item:hover img {
    transform: scale(1.15);
    filter: grayscale(0%);
}

.skill-item:hover span {
    opacity: 1;
    transform: translateY(0);
}

/* Experience Timeline */

.timeline-container {
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 5px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.timeline-item {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 1.5rem;
    padding: 1.25rem 0;
    border-bottom: 1px solid #e5e5e5;
}

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

.timeline-date {
    font-weight: bold;
    font-size: 14px;
    opacity: 0.7;
}

.timeline-content h3 {
    font-size: 18px;
    margin-bottom: 0.4rem;
}

.timeline-content p {
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
}

/* Mobile stacking */
@media (max-width: 768px) {
    .timeline-item {
        grid-template-columns: 1fr;
    }

    .timeline-date {
        margin-bottom: 0.25rem;
    }
}


/* Coursework */

.coursework-container {
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 5px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.coursework-list {
    list-style: disc;
    padding-left: 1.5rem;
    font-size: 20px;
    line-height: 1.8;
}

/* Certifications */

.certifications-container {
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 5px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.certifications-list {
    list-style: none;
    padding: 0;
    font-size: 20px;
    line-height: 1.8;
}

.certifications-list li {
    margin-bottom: 1.2rem;
}


/* Contact */

.contact-links {
    display: flex;
    justify-content: left;
    gap: 1rem;
    margin-top: 2rem;
}

.contact-icon img {
    width: 40px;
    height: 40px;
    display: block;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.contact-icon img:hover {
    transform: scale(1.25); /* Grow slightly on hover */
}

.contact-icon img:active {
    transform: scale(1); /* Shrink slightly when pressed */
}

/* Media Queries for Responsive Design */

/* Stack profile image and text for smaller screens */
@media (max-width: 768px) {
    .about-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .about-text {
        padding-right: 0;
        margin-bottom: 1.5rem; /* Add space below text when image is on top */
    }

    .profile-image {
        width: 200px;
    }
}

/* Stack projects vertically for smaller screens */
@media (max-width: 768px) {
    .project-grid {
        grid-template-columns: 1fr; /* One project per row */
    }
}

/* Adjust skill icons for smaller screens */
@media (max-width: 768px) {
    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr)); 
    }

    .skills-grid img {
        width: 60px;
        height: 60px;
    }
}

/* Header nav displays two buttons per line on tablets and smaller screens */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    nav {
        width: 100%;
    }

    nav ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        padding: 0;
        margin: 0;
        list-style: none;
    }

    nav li {
        flex: 1 1 50%; /* Make each item take up 50% of the width (2 items per line) */
        box-sizing: border-box;
    }

    nav a {
        display: block;
        padding: 0.5rem 1rem;
        text-align: center;
        background-color: #361B6B;
        color: white;
        text-decoration: none;
    }

    nav a:hover {
        background-color: #5A3D93; /* Hover effect */
    }
}

/* Adjust navigation for very small screens */
@media (max-width: 480px) {
    nav ul {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 0;
        padding: 0;
        margin: 0;
        width: 100%;
    }

    nav li {
        margin: 0;
    }

    nav a {
        padding: 0.5rem;
        text-align: center;
        box-sizing: border-box;
    }
}