.project {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;

    width: 80%;
    min-height: 400px; /* Add a minimum height to ensure the container has a defined size */

    margin-top: 15px;
    margin-bottom: 15px;

    background-color: rgb(34, 35, 37);
    box-sizing: border-box;

    box-shadow: 0 4px 5px rgba(0, 0, 0, 0.35);
}

.project .banner {
    margin: 15px;
    box-shadow: 0 0px 10px rgba(0, 0, 0, 0.5);

    height: 400px;
    width: auto;

    object-fit: cover;

    user-select: none; /* Prevent text from being highlighted. */
    pointer-events: none; /* Prevent logo from being dragged. */
}

.project .context {
    display: flex;
    flex-direction: column;
    justify-content: left;
    align-items: start;
    
    flex: 1; /* Take up remaining space in the .project container */

    padding-left: 10px;
    padding-top: 15px;
    padding-bottom: 15px;
    padding-right: 5px;

    background-color: rgb(34, 35, 37);

    overflow: hidden; /* Prevent overflow */
}

.project h2 {
    font-size: 30px;
    font-weight: normal;
    color: rgb(255, 255, 255);

    margin-bottom: 10px;

    background-color: rgb(34, 35, 37);
}

.project p{
    font-size: 22px;
    color: rgba(255, 255, 255, 0.6);

    background-color: rgb(34, 35, 37);

    line-height: 1.8;
}

/* Libraries */
.project .libraries{
    display: inline-flex;
    align-items: center;
    gap: 16px;

    margin-top: 15px; /* Push libraries to the bottom */

    padding: 5px 10px;

    background-color: rgba(0, 0, 0, 0.1);
    border: solid 1px rgba(255, 255, 255, 0.1);
    border-width: 2px;
    border-radius: 10px;
}

.project .itch img{
    width: 40px;
    height: auto;

    transform: translateY(2px);

    transition: transform 0.2s ease; /* Smooth transition */

    user-select: none; /* Prevent text from being highlighted. */
}

.project .itch img:hover{
    transform: translateY(2px) scale(1.1);
}

/* Buttons & Icons */
.project .compatible{
    opacity: 0.5;

    margin-left: 10px;
    margin-right: 5px;

    width: 22px;
    height: auto;
    
    transform: translateY(3px);

    user-select: none; /* Prevent text from being highlighted. */
    pointer-events: none; /* Prevent logo from being dragged. */
}

.project .buttons {
    display: inline-flex;
    align-items: center;
    gap: 20px; /* Keep the gap, but ensure it behaves well */
    flex-wrap: wrap; /* Allow buttons to wrap to the next line if needed */
    margin-top: 10px;
}


.project .buttons div{
    font-size: 0;
}

.project .play{
    display: inline-flex; /* Use flexbox for alignment */
    align-items: center; /* Vertically center the icon */
    gap: 8px; /* Optional: Add some space between the text and the icon */

    font-size: 22px;
    color: white;

    padding: 5px 20px;

    border-radius: 10px;

    text-decoration: none;
    background-color: rgb(134, 87, 172);

    user-select: none; /* Prevent text from being highlighted. */

    white-space: nowrap;
    overflow: hidden;

    transition: background-color 0.3s ease; /* Smooth transition */
}

.project .play:hover{
    background-color: rgb(134, 87, 172, 0.65);
}

.project .download{
    display: inline-flex; /* Use flexbox for alignment */
    align-items: center; /* Vertically center the icon */
    gap: 6px; /* Optional: Add some space between the text and the icon */

    font-size: 22px;
    color: white;

    padding: 5px 20px;
    padding-right: 15px;

    border-radius: 10px;

    text-decoration: none;
    background-color: rgb(87, 114, 172);

    user-select: none; /* Prevent text from being highlighted. */

    white-space: nowrap;
    overflow: hidden;

    transition: background-color 0.3s ease; /* Smooth transition */
}

.project .download:hover{
    background-color: rgb(87, 114, 172, 0.65);
}

/* Link */
#projects .link{
    background-color: rgb(34, 35, 37);

    text-decoration: none;

    white-space: nowrap; 

    -webkit-user-drag: none; /* Prevent link from being dragged. */
    position: relative; /* Required for the pseudo-element */
}

/* GMTK */
#projects .gmtk{
    color: #ff7b22;
}

#projects .gmtk::after {
    background-color: #ffb74b;
}

/* Link Animation */
#projects .link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px; /* Thickness of the underline */
    opacity: 0;

    z-index: 10; /* Ensure the underline is above the text */

    transform: scaleX(0); /* Start with no width */
    transform-origin: bottom left;
    
    transition: transform 0.3s ease, opacity 0.3s linear; /* Smooth transition */
}

#projects .link:hover::after {
    opacity: 1;
    transform: scaleX(1); /* Scale to full width */
    transform-origin: bottom left;
}

/* Media Query for Larger Screens */
@media ((min-width: 768px) and (min-aspect-ratio: 7/10)) {
    .project{
        width: 60%;
        max-width: 1000px;
    }
}

/* Projects Vertical Layout */
@media ((min-width: 1300px)) {
    .project{
        flex-direction: row;
    }

    .project .libraries{
        margin-top: auto; /* Push libraries to the bottom */
    }
}