/* =================================
   Portfolio Gallery Styles - Bootstrap
   ================================= */

/* Filter Tab Active State */
.filter-tab.active {
    background-color: var(--bs-primary) !important;
    color: white !important;
    border-color: var(--bs-primary) !important;
}

/* Portfolio Item Transitions */
.portfolio-item {
    opacity: 1;
    transform: scale(1);
    transition: all 0.5s ease-out;
}

.portfolio-item.filtering {
    opacity: 0;
    transform: scale(0.95);
}

.portfolio-item.hidden-item {
    display: none !important;
}

/* Portfolio Card */
.portfolio-card {
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.portfolio-card:hover {
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important;
    transform: translateY(-5px);
}

/* Portfolio Image Wrapper */
.portfolio-image-wrapper {
    position: relative;
    overflow: hidden;
    /* aspect-ratio is set dynamically via jQuery CONFIG */
}

/* Portfolio Image */
.portfolio-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 0.5s ease-out;
}

.portfolio-card:hover .portfolio-image {
    transform: scale(1.1);
}

/* Portfolio description */
.portfolio-desc {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.5) 60%);
    opacity: 1;
    display: flex;
    flex-direction: column; 
    align-self: end;
    padding: 20px; 
}

/* Portfolio Overlay */
.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;    
    justify-content: center;
}

.portfolio-card:hover .portfolio-overlay {
    opacity: 1;
}
.portfolio-card:hover .portfolio-desc {
    opacity: 0;
}

/* Portfolio Overlay Content */
.portfolio-overlay-content {
    padding: 20px;
    transform: translateY(1rem);
    transition: transform 0.3s ease;
}

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

/* Pagination Active State */
.pagination .page-item.active .page-link {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

/* No Items Message */
.no-items-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 0;
    color: var(--bs-secondary);
    font-size: 1.125rem;
}

/* Loading State */
.portfolio-grid.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Modal Carousel Image */
.portfolio .carousel-item img {
    max-height: 70vh;
    object-fit: contain;
    width: 100%;
    margin: 0 auto;
}

/* Carousel Info Overlay */
.portfolio .carousel-caption {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem 1.5rem 1.5rem;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Fade Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

/* Responsive Adjustments */
@media (max-width: 576px) {
    .portfolio-overlay-content {
        padding: 1rem;
    }
    
    .portfolio-overlay-content h5 {
        font-size: 1rem;
    }
}
