.portfolio-section {
    padding: 50px 0;
    background-image: url(/BackgroundImages/FaqBg.png);
    background-repeat: no-repeat;
    margin-top: 80px;
    background-size: contain;
    opacity: 0;
    animation: fadeIn 1s forwards;
    padding-bottom: 300px;
}

.portfolio-heading {
    text-align: center;
    font-family: 'Poppins', sans-serif;
    font-size: 36px;
    color: white;
    margin-bottom: 40px;
    opacity: 0;
    animation: fadeIn 1s forwards;
    animation-delay: 0.5s;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    padding: 0 15px;
}

.portfolio-card {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border-radius: 16px;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    opacity: 0;
    animation: fadeInCard 0.5s forwards;
}

.designcards {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    transition: transform 0.3s ease-in-out;
    border-radius: 16px;
}
.designcarded {
    height: 360px;
}
.portfolio-card:hover {
    transform: scale(1.07);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

.portfolio-img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease-in-out;
    border-radius: 16px;
}

.portfolio-info {
    position: absolute;
    bottom: -50px;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    text-align: center;
    transition: bottom 0.4s ease-in-out;
}

.portfolio-card:hover .portfolio-info {
    bottom: 0;
}

.portfolio-title {
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    margin: 0;
}

.gallery-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(15px);
    transition: opacity 0.4s ease;
}

.project-details {
    text-align: center;
    color: white;
    margin-top: 25px;
}

.project-details h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 30px;
    margin-bottom: 12px;
    opacity: 0;
    animation: fadeIn 0.5s forwards;
}

.project-details p {
    font-family: 'Roboto', sans-serif;
    font-size: 18px;
    opacity: 0;
    animation: fadeIn 0.6s forwards;
    animation-delay: 0.3s;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

@keyframes fadeInCard {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 10px;
    margin-top: -25px;
    color: white;
    font-weight: bold;
    font-size: 38px;
    transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease;
    user-select: none;
    border: 2px solid transparent;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
}

.prev {
    left: 15px;
}

.next {
    right: 15px;
}

.prev:hover, .next:hover {
    background-color: rgba(255, 255, 255, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.5);
    transform: scale(1.12);
}

.gallery-content {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 85%;
    position: relative;
    overflow: hidden;
}

.gallery-img-container {
    display: flex;
    flex-direction: row;
    transition: transform 0.5s ease;
}

.gallery-img {
    max-width: 100%;
    max-height: 85%;
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.gallery-img:first-child {
    display: block;
    opacity: 1;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    transition: transform 0.3s ease;
    z-index: 20000;
}

.close-modal:hover {
    transform: rotate(90deg);
}

@media (max-width: 768px) {
    .portfolio-section {
        margin-top: 90px;
    }

    .portfolio-heading {
        font-size: 32px;
    }

    .portfolio-grid {
        gap: 15px;
    }

    .portfolio-card {
        border-radius: 10px;
    }

    .project-details h2 {
        font-size: 24px;
    }

    .project-details p {
        font-size: 16px;
    }

    .gallery-img {
        max-width: 90%;
        max-height: 75%;
    }

    .prev, .next {
        font-size: 30px;
        padding: 6px;
    }
}

@media (max-width: 480px) {
    .portfolio-heading {
        font-size: 28px;
    }

    .portfolio-grid {
        gap: 12px;
    }

    .portfolio-card {
        border-radius: 8px;
    }

    .project-details h2 {
        font-size: 22px;
    }

    .project-details p {
        font-size: 14px;
    }

    .gallery-img {
        max-width: 85%;
        max-height: 70%;
    }

    .prev, .next {
        font-size: 28px;
        padding: 5px;
    }
}
