/* =========================================
   PORTFOLIO PAGE STYLES (css/portfolio.css)
   ========================================= */

/* Use a 3D space for the whole page to help with perspective */
/* FIXED: Moving perspective to section instead of body to prevent Model/Fixed positioning issues */
body {
    overflow-x: hidden;
}

/* Page Header is now GLOBAL in style.css */


/* Portfolio Section */
.section-padding {
    padding: 80px 0;
    background-color: var(--color-white);
    /* Safe scope for 3D perspective */
    perspective: 2000px;
}

/* Filter buttons */
#gallery-filters {
    margin-bottom: 40px;
    /* Fade in filters */
    opacity: 0;
    animation: fadeInUp 1s ease-out forwards 0.7s;
}

/* Floating animation for filters */
.filter-btn {
    background: white;
    /* Card-like buttons */
    border: 1px solid #eee;
    font-family: var(--font-body);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Elastic ease */
    padding: 12px 28px;
    margin: 0 8px 15px;
    border-radius: 50px;
    /* Pill shape */
    position: relative;
    overflow: hidden;
    z-index: 1;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.filter-btn:after {
    content: '';
    position: absolute;
    width: 0%;
    height: 100%;
    bottom: 0;
    left: 50%;
    background-color: rgba(184, 134, 11, 0.08);
    /* Gold tint */
    transition: all 0.4s ease;
    z-index: -1;
    transform: translateX(-50%);
}

.filter-btn:hover {
    color: var(--color-text-primary);
    border-color: var(--color-gold);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(184, 134, 11, 0.15);
}

.filter-btn:hover:after {
    width: 100%;
}

.filter-btn.active {
    color: var(--color-text-primary);
    font-weight: 700;
    border-color: var(--color-gold);
    background-color: rgba(184, 134, 11, 0.1);
    box-shadow: 0 5px 15px rgba(184, 134, 11, 0.2);
}

/* Ripple Effect Styles for JS */
.ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: ripple 0.6s linear;
    background-color: rgba(184, 134, 11, 0.3);
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}


/* Portfolio Card Container 3D Setup */
.gallery-item {
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.6s ease;
    /* We'll use JS to assign transition delays based on index or position */
}


/* Portfolio Card */
.portfolio-card {
    cursor: pointer;
    transition: transform 0.1s ease-out, box-shadow 0.3s ease;
    /* Fast transform for JS Tilt */
    background: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 8px;

    /* 3D Context */
    transform-style: preserve-3d;
    perspective: 1000px;
    will-change: transform;
}

/* Idle Hover Animation (Floating) */
.portfolio-card:not(:hover) {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-6px);
    }

    100% {
        transform: translateY(0px);
    }
}

.portfolio-card:hover {
    /* JS will handle transform-rotate, CSS handles list & shadow */
    box-shadow: 0 25px 50px rgba(184, 134, 11, 0.25);
    /* GOLD BACKGROUND GLOW */
    z-index: 10;
}

/* Shine/Light Sweep Effect */
.portfolio-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0) 100%);
    transform: skewX(-25deg);
    transition: none;
    pointer-events: none;
    z-index: 15;
}

.portfolio-card:hover::after {
    animation: shine 1.2s ease-in-out forwards;
}

@keyframes shine {
    100% {
        left: 200%;
    }
}

.portfolio-img {
    height: 280px;
    object-fit: cover;
    transition: transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    /* Cinematic slow zoom */
    width: 100%;
    transform-origin: center center;
    will-change: transform;
}

.portfolio-card:hover .portfolio-img {
    transform: scale(1.15);
    /* Slower, deeper zoom */
}

.portfolio-card-content {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    /* Ensure content sits 'above' the image in 3D space */
    transform: translateZ(20px);
    background: #fff;
    position: relative;
    z-index: 20;
}

.portfolio-card:hover .portfolio-card-content {
    background-color: #fff;
    /* Keep white for cleanliness */
}

.portfolio-card-content h4 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
    position: relative;
    display: inline-block;
}

/* Text Underline Reveal */
.portfolio-card-content h4::before {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: var(--color-text-primary);
    transition: width 0.4s ease;
}

.portfolio-card:hover .portfolio-card-content h4::before {
    width: 100%;
}

.text-gold {
    color: var(--color-gold);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    transition: letter-spacing 0.4s ease, opacity 0.4s ease;
    display: inline-block;
}

.portfolio-card:hover .text-gold {
    letter-spacing: 2.5px;
    opacity: 0.8;
}


/* WhatsApp Float Button */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 40px;
    right: 40px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.25);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    animation: pulse 3s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(37, 211, 102, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

.whatsapp-float:hover {
    background-color: #128C7E;
    color: white;
    transform: scale(1.1) rotate(10deg);
}

/* =========================================
   ENHANCED LIGHTBOX / MODAL STYLES
   ========================================= */

/* Backdrop with blur */
.modal-backdrop.show {
    opacity: 0.85;
    /* Darken */
    backdrop-filter: blur(8px);
    /* The "Glass" effect */
    -webkit-backdrop-filter: blur(8px);
    background-color: rgba(10, 10, 10, 0.9);
}

/* Modal Dialog Animation & Positioning */
.modal-dialog {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100% - 3.5rem);
    /* Ensure vertically center */
    margin: 1.75rem auto;
}

.modal.fade .modal-dialog {
    transform: scale(0.95) translateY(20px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.modal.show .modal-dialog {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.modal-content {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    width: 100%;
}

/* Large Close Button "Premium" */
.btn-close-white {
    width: 40px;
    height: 40px;
    background-size: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    opacity: 0.8;
}

.btn-close-white:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg) scale(1.1);
    opacity: 1;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

/* Carousel Control Aesthetics */
.carousel-control-prev,
.carousel-control-next {
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.05);
    /* very subtle */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    /* Hide by default, show on modal hover */
    transition: all 0.3s ease;
    margin: 0 20px;
}

/* Show arrows when modal body is hovered */
.modal-body:hover .carousel-control-prev,
.modal-body:hover .carousel-control-next {
    opacity: 1;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    background-color: var(--color-gold);
    border-color: var(--color-gold);
    transform: translateY(-50%) scale(1.1);
}

/* Image Presentation */
.carousel-item img {
    border-radius: 4px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    max-height: 85vh;
    object-fit: contain;
    /* Animate image entrance */
    animation: zoomInImage 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes zoomInImage {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

#modalTitle {
    font-size: 2rem;
    font-weight: 300;
    /* Lighter weight for elegance */
    letter-spacing: 2px;
    /* Cinematic spacing */
    color: var(--color-white);
    text-transform: uppercase;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    margin-top: 20px;
    animation: fadeInUp 0.5s ease 0.2s forwards;
    opacity: 0;
}

/* Helper Classes for JS Reveal */
.reveal-item {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.reveal-item.reveal-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Animations Keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* Mobile Responsiveness Overrides */
@media (max-width: 992px) {
    .portfolio-img {
        height: 240px;
    }
}

@media (max-width: 768px) {
    .page-header {
        padding: 120px 0 60px;
    }

    .page-header h1 {
        font-size: 2.5rem;
    }

    .portfolio-card:not(:hover) {
        animation: none;
        /* Disable float on mobile to save battery/perf */
    }
}