/* ========================= Project Selector ========================= */
.project-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    justify-content: center;
    gap: 32px;
    width: 100%;
    padding: 40px 20px;
    max-width: calc(5 * 320px + 4 * 32px);
    margin: 0 auto;
}

@media (max-width: 768px) {
    .project-card {
        padding: 16px;
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    .project-card .content {
        text-align: left;
        align-items: flex-start;
    }
}

/* ========================= Project Card ========================= */
.project-card {
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    background-color: rgba(var(--light-gray-color-rgb), 0.5);
    border-radius: 12px;
    padding: 20px;
    gap: 12px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInFromLeft 0.5s ease-out forwards;
    animation-delay: var(--proj-anim-delay, 0s);
    opacity: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.project-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 6px 24px rgba(var(--white-color-rgb), 0.5);
}

.project-card h3 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--secondary-accent-color);
}

.project-card img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 12px;
    aspect-ratio: 1;
}

.project-card p {
    font-size: 1rem;
    color: var(--white-color);
    line-height: 1.6;
    margin: 0;
    flex: 1;
}

/* ========================= Active Project ========================= */
#project-content {
    width:  100%;
    height: 100%;
    color: var(--white-color);
    position: relative;
    overflow: hidden;
}

.project-content::before,
.project-content::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 50px;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.project-content.has-bottom-fade::after,
.project-content.has-top-fade::before {
    opacity: 1;
}

.project-content::before {
    top: 0;
    background: linear-gradient(to bottom, var(--dark-gray-color), transparent);
}

.project-content::after {
    bottom: 0;
    background: linear-gradient(to top, var(--dark-gray-color), transparent);
}

#project-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.flex {
    display: flex;
}

.modal-container {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 100%;
    max-width: 1700px;
    height: 95%;
    transform: translate(-50%, -50%) scale(0.8);
    background: var(--dark-gray-color);
    border-radius: 12px;
    padding: 0 20px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.7);
    opacity: 0;
    transition:
        transform 0.3s ease,
        opacity 0.3s ease,
        width 0.3s ease,
        height 0.3s ease;
    backface-visibility: hidden;
    will-change: transform, visibility;
}

.modal-overlay.open .modal-container {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.modal-overlay.closing .modal-container {
    transform: translate(-50%, -50%) scale(0.5);
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.content-wrapper {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    scrollbar-width: none;
    padding-top: 20px;
    padding-bottom: 50px;
    scroll-behavior: smooth;
}

.content-wrapper.slide-out-left {
    animation: slideOutLeft 0.3s ease forwards;
}
.content-wrapper.slide-out-right {
    animation: slideOutRight 0.3s ease forwards;
}

.content-wrapper.slide-in-left {
    animation: slideInLeft 0.3s ease forwards;
}
.content-wrapper.slide-in-right {
    animation: slideInRight 0.3s ease forwards;
}

/* ========================= Project Modal Content ========================= */
.modal-header {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.modal-header button {
    background: transparent;
    border: none;
    font-size: 1.4rem;
    color: #fff;
    cursor: pointer;
    border: none;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.15);
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 
        transform 0.3s ease,
        background 0.3s ease,
        box-shadow 0.3s ease;
}

.modal-header button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.2);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

.modal-nav {
    position: absolute;
    top: 50%;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--dark-gray-color);
    border: none;
    color: white;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: 
        transform 0.3s ease,
        background 0.3s ease,
        box-shadow 0.3s ease;
}

.modal-nav:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.2);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

.modal-nav.prev {
    left: -60px;
}

.modal-nav.next {
    right: -60px;
}

@media (max-width: 1820px) {
    .modal-nav {
        display: none;
    }
}

.modal-nav.hidden {
    display: none !important;
}

/* Disables scolling when the modal is open */
body.disable-scroll {
    overflow: hidden;
}

.project-title {
    padding: 20px;
    color: var(--primary-accent-color);
}

.project-title::after {
    content: '';
    display: block;
    width: 100%;
    height: 3px;
    background: linear-gradient(to right, rgba(var(--primary-accent-color-rgb), 1), rgba(var(--light-gray-color-rgb), 0));
    border-radius: 2px;
    margin-top: 8px;
}

/* ========== Layered Picture Section ========== */
#project-section {
    width: 100%;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(1000px, 1fr));
    justify-content: center;
    justify-items: center;
    gap: 50px;
}

#project-section h2 {
    color: var(--secondary-accent-color);
}

.project-layered-section {
    width: 100%;
    display: flex;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(var(--light-gray-color-rgb), 0.5), rgba(50, 50, 50, 0.5));
    padding: 40px;
    overflow: visible;
    position: relative;
    margin-bottom: 5%;
}

.project-layered-section p {
    color: var(--white-color);
}

.project-layered-content ul {
    color: var(--white-color);
    list-style-type: disc inside;
    font-size: 1.2rem;
    margin-left: 20px;
    line-height: 1.4;
}

.project-layered-content h2 {
    margin-bottom: 0.5rem;
    font-size: 2rem;
    position: relative;
}

.project-layered-content h2::after {
    content: '';
    display: block;
    width: 100%;
    height: 3px;
    background: linear-gradient(to right, rgba(var(--secondary-accent-color-rgb), 1), rgba(var(--light-gray-color-rgb), 0));
    border-radius: 2px;
    margin-top: 8px;
}

.project-layered-content p {
    margin-bottom: 0;
    opacity: 0.9;
}

.project-layered-content {
    padding: 40px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.2rem;
    line-height: 1.6;
}

.project-image-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.6);
    margin-bottom: -10%;
    border-radius: 50px;
}

.project-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.project-image-wrapper:hover img {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.rev {
    flex-direction: row-reverse;
}

@media (max-width: 950px) {
    #project-content {
        padding: 5px;
        width: 100%;
        margin: 0;
    }
    
    #project-section {
        display: block;
        padding: 5px;
    }

    .project-layered-section {
        padding: 20px;
        flex-direction: column;
        font-size: 0.9rem;
        margin-bottom: 15%;
    }

    .project-layered-content ul {
        padding-left: 20px;
        font-size: 1rem;
        margin-left: 20px;
    }

    .project-image-wrapper {
        padding: 5px;
        margin-top: 20px;
    }

    .project-image-wrapper img {
        margin: 0;
    }
}

/* ========================= Keyframes ========================= */
@keyframes fadeInFromLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutLeft {
    from { transform: translateX(0) scale(1); opacity: 1; }
    to   { transform: translateX(-100%) scale(0.8); opacity: 0; }
}

@keyframes slideOutRight {
    from { transform: translateX(0) scale(1); opacity: 1; }
    to   { transform: translateX(100%) scale(0.8); opacity: 0; }
}

@keyframes slideInLeft {
    from { transform: translateX(-100%) scale(0.8); opacity: 0; }
    to   { transform: translateX(0) scale(1); opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(100%) scale(0.8); opacity: 0; }
    to   { transform: translateX(0) scale(1); opacity: 1; }
}

/* ========================= Description and Project Info ========================= */
.overview-container {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
}

.project-info {
    margin-left: auto;
    flex: 0 0 250px;
    width: 800px;
    background: linear-gradient(135deg, rgba(var(--light-gray-color-rgb), 0.5), rgba(50, 50, 50, 0.5));
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
}

.project-info a {
    color: var(--primary-accent-color);
    text-decoration: none;
    font-weight: bold;
}

.description-container a {
    color: var(--primary-accent-color);
    text-decoration: none;
    font-weight: bold;
}

.description-container,
.key-features-container {
    margin: 0 20px;
}

.key-features-container ul{
    list-style-type: disc inside;
    font-size: 1.2rem;
    margin-left: 20px;
    line-height: 1.4;
}

.key-features-container hr {
    height: 3px;
    background: linear-gradient(to right, rgba(var(--primary-accent-color-rgb), 1), rgba(var(--light-gray-color-rgb), 0));
    border: none;
}

.screenshot-container {
    margin-left: auto;
}

.img-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    width: 100vw;
    max-width: 100%;
    box-sizing: border-box;
    padding: 20px;
}

.img-grid img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    image-rendering: pixelated;
    border-radius: 20px;
    box-shadow: 10px 10px 20px rgba(var(--primary-accent-color-rgb), 0.6);
    will-change: transform;
}

.tutorial-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    font-family: Arial, sans-serif;
}

.tutorial-container h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.tutorial-container p {
    margin-bottom: 2rem;
    line-height: 1.5;
}

.step {
    margin-bottom: 3rem;
}

.step h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.step img {
    display: block;
    max-width: 100%;
    margin: 0.5rem 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}
