.projects {
    margin: auto;
    max-width: 950px;
    display: flex;
    flex-direction: column;
}

.section-title {
    color: white;
    text-align: left;
    display: flex;
    align-items: center;
    width: 100%;
}

.section-title h3 {
    margin-right: 10px;
    font-size: 1.8rem;
    white-space: nowrap;
}

.line {
    height: 1px;
    flex-grow: 1;
    background-color: #4bb3b894;
    margin: 60px 0;
}

.projects-section {
    margin: auto;
    width: 90vw;
    padding: 40px 0;
}

.project {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.project-info {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.project-title {
    font-size: 2rem;
    color: #9eebda;
    margin-bottom: 10px;
    text-align: center;
}

.project-description {
    background-color: transparent;
    color: #F9EAFF;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

.project-description p {
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

.project-features {
    list-style-type: '• ';
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #f9eaffad;
    font-size: 1rem;
}

.project-image {
    width: 100%;
    /* This makes sure the container respects the aspect ratio of the content */
    aspect-ratio: 16 / 9;
    background-color: #181d27; /* Fallback color while image/video loads */
    border-radius: 10px;
    overflow: hidden; /* Important for keeping the border-radius on content */
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.project-image a:hover img {
    transform: scale(1.04);
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.tech-tag {
    background-color: #3e5074;
    color: #c9e3ff;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 500;
}

.project-link {
    display: inline-block;
    margin-top: 20px;
    color: #9eebda;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
}
.project-link i {
    transition: transform 0.3s ease;
}
.project-link:hover {
    color: #ffffff;
}
.project-link:hover i {
    transform: translateX(5px);
}


/* ===== START: VIDEO FACADE STYLES ===== */
.video-facade {
    position: relative;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.video-facade img {
    border-radius: 0; /* Let the container handle the radius */
    box-shadow: none; /* Let the container handle the shadow */
}

.video-facade:hover img {
    transform: scale(1.05);
}

.video-facade .play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    transition: background-color 0.3s ease;
    border: 2px solid white;
}

.video-facade .play-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 53%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 15px 0 15px 25px;
    border-color: transparent transparent transparent white;
}

.video-facade:hover .play-button {
    background-color: rgba(255, 0, 0, 0.8);
}

/* Responsive iframe container for when the video is loaded */
.project-image iframe {
    width: 100%;
    height: 100%;
    border: 0;
}
/* ===== END: VIDEO FACADE STYLES ===== */


@media screen and (min-width: 768px) {
    .project {
        flex-direction: row;
        align-items: center;
        gap: 40px;
    }
    .project-image, .project-info {
        flex: 1;
        width: 50%;
    }
    .project:nth-child(even) {
        flex-direction: row-reverse;
    }
    .project-title, .project-tech {
        text-align: left;
        justify-content: flex-start;
    }
}