.projects-container {
    width: 90%;
    max-width: none;
    margin: 40px auto;
    padding: 0;
}

.project-panel {
    display: block;
    background: #000;
    border: 1px solid #333;
    margin-bottom: 40px;
    opacity: 0;
    height: 300px;
    transition: opacity 0.5s, transform 0.5s;
}

.project-panel.left {
    margin-right: auto;
    margin-left: 0;
    width: 90%;
    transform: translateX(-100%);
}

.project-panel.right {
    margin-left: auto;
    margin-right: 0;
    width: 90%;
    transform: translateX(100%);
}

.project-panel.visible {
    opacity: 1;
    transform: translateX(0);
}

.project-panel-link {
    display: flex;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.project-panel.right .project-panel-link {
    flex-direction: row-reverse;
}

.project-image {
    width: 300px;
    min-width: 300px;
    height: 300px;
    background: #222;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    border: 1px solid #444;
    overflow: hidden;
    flex-shrink: 0;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-info {
    padding: 30px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    transition: transform 0.2s ease;
    min-width: 0; /* Allows text to wrap properly */
    overflow-wrap: break-word;
    word-wrap: break-word;
    overflow-y: auto;
    max-height: 100%;
    position: relative;
}

.project-title {
    font-size: 32px;
    margin: 0 0 20px;
    color: #fff;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.project-description {
    font-size: 18px;
    color: #ccc;
    line-height: 1.5;
    transition: transform 0.2s ease;
    flex-grow: 1;
    overflow-y: auto;
}

/* Custom scrollbar styling for project info */
.project-info::-webkit-scrollbar,
.project-description::-webkit-scrollbar {
    width: 6px;
}

.project-info::-webkit-scrollbar-track,
.project-description::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.project-info::-webkit-scrollbar-thumb,
.project-description::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.project-info::-webkit-scrollbar-thumb:hover,
.project-description::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.project-panel-link:hover .project-info {
    transform: translateY(-5px);
}

.project-panel-link:visited {
    color: inherit;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Staggered animation */
.project-panel:nth-child(1) { animation-delay: 0.2s; }
.project-panel:nth-child(2) { animation-delay: 0.4s; }

/* Large tablets and small desktops */
@media screen and (max-width: 1200px) {
    .project-panel {
        width: 95%;
        height: 280px; /* Restore larger height since we have scrolling */
    }

    .project-panel.left,
    .project-panel.right {
        width: 95%;
    }

    .project-image {
        width: 280px;
        min-width: 280px;
        height: 280px;
    }

    .project-info {
        padding: 25px;
    }

    .project-title {
        font-size: 26px;
        margin: 0 0 15px;
    }

    .project-description {
        font-size: 16px;
        line-height: 1.4;
    }
}

/* Medium tablets */
@media screen and (max-width: 1024px) {
    .project-panel {
        height: 260px;
    }

    .project-image {
        width: 260px;
        min-width: 260px;
        height: 260px;
    }

    .project-info {
        padding: 20px;
    }

    .project-title {
        font-size: 24px;
    }

    .project-description {
        font-size: 15px;
    }
}

/* Small tablets */
@media screen and (max-width: 900px) {
    .project-panel {
        height: 240px;
    }

    .project-image {
        width: 240px;
        min-width: 240px;
        height: 240px;
    }

    .project-info {
        padding: 20px;
    }

    .project-title {
        font-size: 22px;
        margin: 0 0 15px;
    }

    .project-description {
        font-size: 15px;
        line-height: 1.4;
    }
}

/* Mobile and very small tablets */
@media screen and (max-width: 768px) {
    .projects-container {
        width: 95%;
        margin: 30px auto;
    }

    .project-panel {
        width: 100% !important;
        height: auto;
        margin: 20px auto !important;
        min-height: auto;
    }

    .project-panel.left,
    .project-panel.right {
        margin-left: auto !important;
        margin-right: auto !important;
        transform: translateY(50px);
    }

    .project-panel.visible {
        transform: translateY(0);
    }

    .project-panel-link {
        flex-direction: column !important;
        height: auto;
    }

    .project-image {
        width: 100%;
        min-width: 100%;
        height: 250px;
    }

    .project-info {
        padding: 20px;
    }

    .project-title {
        font-size: 22px;
        margin: 0 0 15px;
    }

    .project-description {
        font-size: 15px;
        line-height: 1.4;
    }
}

/* Very small mobile screens */
@media screen and (max-width: 480px) {
    .projects-container {
        width: 100%;
        margin: 20px 0;
        padding: 0 10px;
    }

    .project-panel {
        margin-bottom: 20px;
    }

    .project-image {
        height: 200px;
    }

    .project-info {
        padding: 15px;
    }

    .project-title {
        font-size: 20px;
        margin: 0 0 10px;
    }

    .project-description {
        font-size: 14px;
        line-height: 1.3;
    }
}