body {
    background: linear-gradient(to bottom, #D8D0C4, #D8D0C4);
    padding: 1rem 1rem;
    margin: 0px 0px;
}

html, body {
    max-height: 100vh;
    max-width: 100vw;
    height: 100%;
    width: 100%;
    box-sizing: border-box;
}

.main-layout {
    display: grid;
    grid-template: repeat(10, 1fr) / repeat(12, 1fr);
    height: 100%;
    width: 100%;
    gap: 1rem;
}

.main-layout > div {
    border-radius: 1rem;
    background-color: #A28A74;
    padding: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.main-layout > div p {
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

.navbar {
    grid-area: 1 / 1 / 2 / 13;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar > h1 {
    margin-left: 1.5rem;
    font-size: 1.5rem;
    font-family: 'Times New Roman', Times, serif;
    font-weight: bold;
    color: black;
}

.resume-button {
    margin-right: 1.5rem;
    padding: 0.9rem 1.5rem;
    background-color: #D8D0C4;
    border: 2px solid;
    border-radius: 0.5rem;
    font-family: 'Times New Roman', Times, serif;
    font-weight: 500;
    color: black;
    font-size: 1rem;
    text-decoration: none;
    transition: transform 0.25s ease-in-out;
}

.resume-button:hover {
    transform: scale(1.1);
    background-color: #CBAA83;
    color: white;
}

.middle-left-container {
    grid-area: 2 / 1 / 7 / 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    overflow: hidden;
    min-width: 0;
}

.middle-left-container > img {
    height: 100px;
    width: 100px;
    margin-top: 5%;
    margin-right: 5%;
    margin-left: 75%;
    transform-origin: 50% 50%;  
    animation: slowRotation 30s linear infinite;
}

@keyframes slowRotation {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.middle-left-container > p {
    font-size: clamp(1rem, 3vw, 3rem); /* Reduce max font size */
    margin: 0.5rem 1rem; /* Adjust margins */
    padding: 0.5rem;
    width: 100%; /* Ensure text takes full width */
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-break: break-word;
    font-weight: bold;
}

.bottom-left-container {
    grid-area: 7 / 1 / 11 / 5;
    background-color: white;
    display: flex;
    flex-direction: column;
    align-items: left;
    justify-content: space-between;
    padding: 1rem;
    overflow: hidden;
    min-width: 0;
}

.bottom-left-container > img {
    height: 50px;
    width: 50px;
    margin-left: 0.5rem;
    margin-top: 1rem;
}

/* Update bottom-left-container > p styles */
.bottom-left-container > p {
    font-size: clamp(0.8rem, 1.5vw, 1.5rem); /* Adjust font scaling */
    margin: 0.5rem 0.5rem;
    padding: 0.5rem;
    width: 100%;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-break: break-word;
}

.personal-picture {
    grid-area: 2 / 6 / 7 / 9;
    background-color: #CBAA83 !important;
    background-image: url(./images/thanos_park.jpg);
    background-size: cover; 
    background-position: 50% 20%;
    background-repeat: no-repeat; 
}

.contact-information {
    grid-area: 7 / 5 / 11 / 9;
    background-color: #CBAA83 !important;
    display: grid;
    grid-template: repeat(4, 1fr) / repeat(4, 1fr);
    align-items: center;
    justify-items: center;
}

.contact-information > a {
    grid-area: 1 / 4 / 2 / 5;
}
.contact-information > a > img {
    height: 4rem;
    width: 4rem;
    padding: 0px 0px;
    margin: 0px 0px;
    transition: 0.3s ease-in;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.contact-information > a > img:hover {
    transform: scale(1.2) rotate(5deg);
}

.contact-information > h1 {
    grid-area: 4 / 1 / 5 / 3;
    padding: 0px 0px;
    margin: 0px 0px;
}

.middle-right-container {
    grid-area: 2 / 9 / 10/ 13;
    background-color: white;
    display: flex;
    flex-direction: column;
}

.middle-right-container > h1 {
    margin: 5% 0 0 5%;
    flex-shrink: 1;
}

/* Carousel For Projects */

.carousel-container {
    flex: 5 1 0;
    display:flex;
    align-items: center;
}

.left-button, .right-button {
    flex: 0.25 1 0;
    font-size: 2rem;
    padding: 8px 8px;
    margin: 0px 2px;
    text-align: center;
    position: relative;
    bottom: 5%;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: 0.6s ease;
    align-self: center;
}

.carousel-content {
    display: flex;
    flex: 5 1 0;
}
.mySlides {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.mySlides > img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 2rem;
}

.mySlides > a > button {
    cursor: pointer;
    margin-top: 0.25rem;
    padding: 0.9rem 1.5rem;
    background-color: #D8D0C4;
    border: 2px solid;
    border-radius: 0.5rem;
    font-family: 'Times New Roman', Times, serif;
    font-weight: 500;
    color: black;
    font-size: 1rem;
}
.mySlides > a > button:hover {
    transform: scale(1.1);
    background-color: #CBAA83;
    color: white;
}

.right-button:hover, .left-button:hover {
    background-color: #CBAA83;
    color: white;
}

.fade {
    animation-name: fade;
    animation-duration: 1.5s;
}

@keyframes fade {
    from {opacity: .4}
    to {opacity: 1}
}

/* End Carousel */ 

.personal-links {
    grid-area: 10 / 9 / 11 / 13;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5rem;
}

.personal-links > a > img{
    height: 3rem;
    width: 3rem;
    transition: transform 0.25s ease-in-out;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.personal-links > a > img:hover {
    transform: scale(1.2) rotate(5deg);
}

@media (max-width: 600px) {
    .main-layout {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }

    .main-layout>div {
        width: 100%;
        padding: 0.5rem;
        box-sizing: border-box;
    }

    .navbar {
        grid-area: auto;
        order: 0;
    }

        .middle-left-container {
            order: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            min-height: 200px;
            /* Add a min height */
            overflow: visible;
            /* Prevent collapse */
        }

    .personal-picture {
        grid-area: auto;
        order: 2;
        min-height: 40vh;
        background-size: cover;
        background-position: 50% 20%;
        background-repeat: no-repeat;
    }

    .bottom-left-container {
        order: 3;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        min-height: 150px;
        /* Add a min height */
        overflow: visible;
    }

    .contact-information {
        grid-area: auto;
        order: 4;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        padding: 1rem;
    }

    .middle-right-container {
        grid-area: auto;
        order: 5;
    }

    .personal-links {
        grid-area: auto;
        order: 6;
        gap: 2rem;
        justify-content: center;
        align-items: center;
    }

    .middle-left-container>p {
        font-size: clamp(0.8rem, 4vw, 1.5rem);
        margin: 0.25rem;
        padding: 0.25rem;
    }

    .bottom-left-container>p {
        font-size: clamp(0.7rem, 3vw, 1rem);
        margin: 0.25rem;
        padding: 0.25rem;
    }

    .contact-information>a>img {
        height: 3rem;
        width: 3rem;
    }

    .personal-links>a>img {
        height: 2.5rem;
        width: 2.5rem;
    }
}
