/* AI Gallery Styles - Galleria 4x2 con Filtro Blu */

/* Project Gallery Container */
.project-gallery {
    margin-top: 20px;
}

/* Gallery Grid Layout - 4x2 Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

/* Individual Gallery Image Container */
.gallery-image {
    position: relative;
    height: 80px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0;
}

/* Gallery Image Styling */
.gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0;
}

/* Filtro Blu usando #008eb4 - SEMPRE ATTIVO di default */
.gallery-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #008eb4;
    mix-blend-mode: color;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0;
    opacity: 0.8;
}

/* Hover Effects - Rimuove il filtro e applica zoom */
.gallery-image:hover::after,
.gallery-image.no-filter::after {
    opacity: 0;
}

.gallery-image:hover {
    transform: scale(1.05);
    z-index: 10;
    box-shadow: 0 8px 25px rgba(0, 142, 180, 0.3);
}

.gallery-image:hover img {
    transform: scale(1.1);
}

/* Active State - quando corrisponde allo slide attivo */
.gallery-image.active {
    transform: scale(1.02);
    z-index: 5;
    box-shadow: 0 4px 15px rgba(0, 142, 180, 0.25);
    border: 2px solid #008eb4;
}

.gallery-image.active::after {
    opacity: 0;
}

/* Active hover combinato */
.gallery-image.active:hover {
    transform: scale(1.08);
    border-color: #006d91;
}

/* Animation Classes - per sincronizzazione con slider */
.gallery-image.slide-sync {
    animation: slideSync 0.5s ease-in-out;
}

@keyframes slideSync {
    0% { 
        transform: scale(1.02); 
        box-shadow: 0 4px 15px rgba(0, 142, 180, 0.25); 
    }
    50% { 
        transform: scale(1.12); 
        box-shadow: 0 8px 30px rgba(0, 142, 180, 0.4); 
    }
    100% { 
        transform: scale(1.02); 
        box-shadow: 0 4px 15px rgba(0, 142, 180, 0.25); 
    }
}

/* Loading States */
.gallery-image.loading img {
    opacity: 0.5;
    filter: blur(2px);
}

.gallery-image.loaded img {
    opacity: 1;
    filter: none;
}

/* Accessibility */
.gallery-image:focus {
    outline: 3px solid #008eb4;
    outline-offset: 3px;
}

.gallery-image:focus::after {
    opacity: 0.3;
}

/* Responsive Design - Mobile: diventa 2x4 */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .gallery-image {
        height: 60px;
    }
    
    .project-gallery {
        margin-top: 15px;
    }
    
    /* Riduci effetti hover su mobile */
    .gallery-image:hover {
        transform: scale(1.02);
    }
    
    .gallery-image:hover img {
        transform: scale(1.05);
    }
}

@media (max-width: 576px) {
    .gallery-image {
        height: 50px;
    }
    
    .gallery-grid {
        gap: 4px;
    }
    
    .project-gallery {
        margin-top: 10px;
    }
}

/* Modifiche al slider esistente per sincronizzazione */
.research-slider {
    position: relative;
    height: 400px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-radius: 0;
    margin-bottom: 0;
}

.slider-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.slider-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.slide {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.slide.active {
    display: block;
    opacity: 1;
}

.slide-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

/* Filtro blu anche per le slide quando non attive */
.slide::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #008eb4;
    mix-blend-mode: color;
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.5s ease;
    opacity: 0.7;
}

/* Slide attiva o con classe no-filter ha meno/nessun filtro */
.slide.active::after,
.slide.no-filter::after {
    opacity: 0;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: transparent;
    color: white;
    border: none;
    padding: 15px 20px;
    font-size: 18px;
    cursor: pointer;
    border-radius: 4px;
    z-index: 10;
    transition: all 0.3s ease;
}

.slider-btn:hover {
    color: #008eb4;
    transform: translateY(-50%) scale(1.1);
}

.slider-btn.prev {
    left: 15px;
}

.slider-btn.next {
    right: 15px;
}

.slider-indicators {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active,
.indicator:hover {
    background-color: #008eb4;
    transform: scale(1.2);
}



/* Project Content Container */
.project-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Design Project Section */
.design-project {
    margin-bottom: 20px;
}

.design-project-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.design-project-description {
    font-size: 16px;
    color: var(--secondary-color);
    line-height: 1.5;
    margin-bottom: 0;
}

/* Project Gallery - Reset margin */
.project-gallery {
    margin-top: 0;
}

/* Align thumbnails nicely */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

/* Assicura che tutto sia allineato */
.row.align-items-start {
    align-items: flex-start;
}

/* Responsive: Stack su mobile */
@media (max-width: 991px) {
    .project-content {
        margin-top: 20px;
    }
    
    .design-project {
        margin-bottom: 15px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
}

@media (max-width: 576px) {
    .design-project-title {
        font-size: 18px;
    }
    
    .design-project-description {
        font-size: 14px;
    }
    
    .gallery-image {
        height: 50px;
    }
}