.portfolio-section {
    padding: 60px 0;
    background: var(--background-color-light);
    /* background-color: red; */
    /* padding: 20px 60px; */
    padding: 0 30px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.portfolio-title {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 30px;
    text-align: center;
    letter-spacing: 2px;
    color: var(--secondary-color);
    animation: fadeInDown 1s;
    margin-top: 40px;
    font-family: var(--title-font-family);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.portfolio-filters {
    display: flex;
    gap: 10px 25px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    justify-content: center;
    font-family: var(--description-font-family);
}

.portfolio-filters button {
    background: #fff;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 10px 24px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    outline: none;
}

.portfolio-filters button.active,
.portfolio-filters button:hover {
    background: var(--primary-color);
    color: #fff;
}

.portfolio-grid {
    display: flex;
    flex-wrap: wrap;
    /* gap: 40px; */
    gap: 40px 0;
    justify-content: center;
    align-items: center;
}

.portfolio-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    width: 320px;
    height: 340px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    margin: 0 auto;
    animation: rotateIn 1.2s cubic-bezier(.68, -0.55, .27, 1.55);
    transition: transform 0.3s;
}

.portfolio-card:hover {
    transform: scale(1.05) rotate(-2deg);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
}

@keyframes rotateIn {
    from {
        transform: rotateY(-90deg) scale(0.7);
        opacity: 0;
    }

    to {
        transform: rotateY(0deg) scale(1);
        opacity: 1;
    }
}

.portfolio-card .portfolio-card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 20px 20px 0 0;
    transition: transform 0.4s;
}

.portfolio-card:hover .portfolio-card-img {
    transform: scale(1.08) rotate(2deg);
}

.portfolio-card .portfolio-card-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 18px 0 8px 0;
    text-align: center;
    color: var(--secondary-color);
}

.portfolio-card .portfolio-card-category {
    font-size: 1rem;
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 8px;
}

.portfolio-card .portfolio-card-desc {
    font-size: 0.98rem;
    color: #555;
    text-align: center;
    padding: 0 18px;
}

.portfolio-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    align-items: center;
    justify-content: center;
    animation: fadeInModal 0.5s;
}

@keyframes fadeInModal {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.portfolio-modal.active {
    display: flex;
}

.portfolio-modal-content {
    background: #fff;
    border-radius: 18px;
    max-width: 900px;
    width: 95vw;
    min-height: 420px;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    animation: modalPop 0.6s cubic-bezier(.68, -0.55, .27, 1.55);
}

@keyframes modalPop {
    from {
        transform: scale(0.7) rotateY(30deg);
    }

    to {
        transform: scale(1) rotateY(0);
    }
}

.portfolio-modal-slideshow {
    flex: 1.2;
    /* background: var(--secondary-color); */
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-width: 0;
}

.portfolio-modal-slideshow img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 0 0 0 18px;
    object-fit: contain;
    background: var(--secondary-color);
    transition: opacity 0.4s;
}

.portfolio-modal-slideshow .portfolio-slide-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 2.2rem;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: background 0.2s;
}

.portfolio-modal-slideshow .portfolio-slide-arrow:hover {
    /* background: #007bff; */
    background: var(--primary-color);
}

.portfolio-slide-arrow.left {
    left: 10px;
}

.portfolio-slide-arrow.right {
    right: 10px;
}

.portfolio-modal-details {
    flex: 1;
    padding: 36px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.portfolio-modal-details .portfolio-modal-title {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 12px;
}

.portfolio-modal-details .portfolio-modal-category {
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.portfolio-modal-details .portfolio-modal-desc {
    font-size: 1.05rem;
    color: #444;
    margin-bottom: 18px;
}

.portfolio-modal-close {
    position: absolute;
    top: 18px;
    right: 24px;
    font-size: 2rem;
    color: #cecece;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s;
}

.portfolio-modal-close:hover {
    /* color: var(--secondary-color); */
    opacity: 0.5;
}

.portfolio-see-more-wrapper {
    display: flex;
    justify-content: center;
    background: var(--background-color-light);
    padding-top: 30px;
}

/* #seeMorePortfolioModal .see-more-modal-content {
    max-width: 400px;
    text-align: center;
} */


@media (max-width: 900px) {
    .portfolio-grid {
        gap: 24px;
    }

    .portfolio-card {
        width: 90vw;
        max-width: 350px;
    }

    .portfolio-see-more-wrapper {
        padding-top: 0;
    }
}

@media (max-width: 700px) {
    .portfolio-modal-content {
        flex-direction: column;
        min-height: 0;
        max-width: 98vw;
    }

    .portfolio-modal-slideshow {
        min-height: 180px;
        border-radius: 18px 18px 0 0;
    }

    .portfolio-modal-details {
        padding: 22px 16px;
    }
}

@media (max-width: 600px) {
    .portfolio-section {
        padding: 30px 0;
    }

    .portfolio-title {
        font-size: 2rem;
        margin-top: auto;
    }

    .portfolio-card {
        height: 320px;
    }
}