/* Portfolio Gallery Styles */
.portfolio-gallery {
    background-color: #ffffff;
    min-height: 100vh;
    padding: 0;
}

.container-fluid {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Portfolio Item Styles */
.portfolio-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.portfolio-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    border-radius: 8px;
}

.portfolio-item:hover img {
    transform: scale(1.05);
}

/* Hauteurs spécifiques pour différentes rangées */
.row:nth-child(1) .portfolio-item {
    height: 250px;
}

.row:nth-child(2) .portfolio-item {
    height: 300px;
}

.row:nth-child(3) .col-md-4 .portfolio-item {
    height: 400px;
}

.row:nth-child(3) .col-md-8 .portfolio-item {
    height: 190px;
}

.row:nth-child(4) .portfolio-item {
    height: 250px;
}

.row:nth-child(5) .col-md-8 .portfolio-item {
    height: 400px;
}

.row:nth-child(5) .col-md-4 .portfolio-item {
    height: 190px;
}

.row:nth-child(6) .portfolio-item {
    height: 300px;
}

/* Overlay Styles */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        rgba(0, 123, 255, 0.85) 0%,
        rgba(0, 86, 179, 0.85) 50%,
        rgba(0, 50, 120, 0.9) 100%
    );
    opacity: 0;
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 8px;
}

.portfolio-item:hover .overlay {
    opacity: 1;
}

/* Overlay Content */
.overlay-content {
    color: white;
    padding: 20px;
    transform: translateY(20px);
    transition: transform 0.4s ease;
}

.portfolio-item:hover .overlay-content {
    transform: translateY(0);
}

.overlay-content h5 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.overlay-content p {
    font-size: 1rem;
    margin-bottom: 0;
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .portfolio-item {
        height: 250px !important;
        margin-bottom: 15px;
    }

    .container-fluid {
        padding: 15px;
    }

    .overlay-content h5 {
        font-size: 1.3rem;
    }

    .overlay-content p {
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .portfolio-item {
        height: 200px !important;
    }

    .overlay-content h5 {
        font-size: 1.2rem;
    }

    .overlay-content p {
        font-size: 0.8rem;
    }

    .overlay-content {
        padding: 15px;
    }
}

/* Animation pour l'apparition des éléments */
.portfolio-item {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.portfolio-item:nth-child(1) {
    animation-delay: 0.1s;
}
.portfolio-item:nth-child(2) {
    animation-delay: 0.2s;
}
.portfolio-item:nth-child(3) {
    animation-delay: 0.3s;
}
.portfolio-item:nth-child(4) {
    animation-delay: 0.4s;
}
.portfolio-item:nth-child(5) {
    animation-delay: 0.5s;
}
.portfolio-item:nth-child(6) {
    animation-delay: 0.6s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Effet de brillance sur hover */
.portfolio-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s ease;
    z-index: 1;
    border-radius: 8px;
}

.portfolio-item:hover::before {
    left: 100%;
}

/* Ajustements pour les gaps entre les éléments */
.row {
    margin-bottom: 20px;
}

.row:last-child {
    margin-bottom: 0;
}

/* Style pour les colonnes imbriquées */
.col-md-8 .row .col-12 {
    margin-bottom: 15px;
}

.col-md-8 .row .col-12:last-child {
    margin-bottom: 0;
}

.col-md-4 .row .col-12 {
    margin-bottom: 15px;
}

.col-md-4 .row .col-12:last-child {
    margin-bottom: 0;
}
