/**
 * Portfolio Static Slider Styles
 *
 * @package Fotoshopcu Core
 */

/* Remove the box shadow and border */
.portfolio-grid .portfolio-item {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06) !important;
    border: none !important;
    background-color: transparent !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Remove hover effects */
.portfolio-grid .portfolio-item:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1) !important;
}

/* Reset thumbnail styling */
.portfolio-grid .portfolio-thumbnail {
    border-radius: 10px !important;
    overflow: hidden;
    aspect-ratio: 1/1;
    margin: 0;
    padding: 0;
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 100%; /* Creates a perfect square */
}

/* Update overlay styling */
.portfolio-grid .portfolio-overlay {
    border-radius: 10px !important;
}

/* Portfolio thumbnail images should also have rounded corners */
.portfolio-grid .portfolio-item img,
.portfolio-grid .before-after-preview,
.portfolio-grid .no-thumbnail {
    border-radius: 10px !important;
    overflow: hidden;
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin: 0;
    padding: 0;
}

/* Clean up the view button */
.portfolio-grid .portfolio-view {
    background-color: rgba(0, 0, 0, 0.7);
    border: none;
    box-shadow: none;
    padding: 8px 16px;
}

/* Hide the slider hint */
.portfolio-grid .slider-hint {
    display: none !important;
}

/* Static Slider Core Styles - Fix spacing issues */
.portfolio-grid .static-slider {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

/* Fix slider in the center */
.portfolio-grid .static-slider .before-image,
.portfolio-grid .static-slider .after-image {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background-size: cover !important;
    background-position: center !important;
    box-sizing: border-box !important;
}

.portfolio-grid .static-slider .after-image {
    z-index: 2 !important;
    clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% 100%) !important;
}

.portfolio-grid .static-slider .divider-line {
    left: 50% !important;
    z-index: 4 !important;
}

/* Remove any transitions that might cause layout issues */
.portfolio-grid .static-slider,
.portfolio-grid .static-slider .before-image,
.portfolio-grid .static-slider .after-image,
.portfolio-grid .static-slider .divider-line {
    transition: none !important;
}

/* Override animations */
.portfolio-grid .portfolio-item {
    animation: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.portfolio-grid .portfolio-item.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Disable any attempt to animate the slider */
.portfolio-grid .static-slider {
    transition: none !important;
}

.portfolio-grid .static-slider .divider-line,
.portfolio-grid .static-slider .after-image {
    transition: none !important;
}

/* Disable the auto-animating styles */
.auto-animating {
    box-shadow: none !important;
    z-index: auto !important;
}

.auto-animating::after {
    display: none !important;
}

.auto-animating .divider-line:before {
    animation: none !important;
}

/* Keep entry animations */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered entry delay classes */
.portfolio-grid .portfolio-item:nth-child(1) { transition-delay: 0.1s; }
.portfolio-grid .portfolio-item:nth-child(2) { transition-delay: 0.2s; }
.portfolio-grid .portfolio-item:nth-child(3) { transition-delay: 0.3s; }
.portfolio-grid .portfolio-item:nth-child(4) { transition-delay: 0.4s; }
.portfolio-grid .portfolio-item:nth-child(5) { transition-delay: 0.5s; }
.portfolio-grid .portfolio-item:nth-child(6) { transition-delay: 0.6s; }
.portfolio-grid .portfolio-item:nth-child(7) { transition-delay: 0.7s; }
.portfolio-grid .portfolio-item:nth-child(8) { transition-delay: 0.8s; }
.portfolio-grid .portfolio-item:nth-child(9) { transition-delay: 0.9s; }
.portfolio-grid .portfolio-item:nth-child(n+10) { transition-delay: 1s; }

/* Add support for the animate-once class */
.animate-once {
    transition: all 0.5s ease;
}

.animate-once .divider-line {
    transition: left 1.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.animate-once .after-image {
    transition: clip-path 1.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* Add a subtle glow effect to the divider during animation */
.animating-sliders .before-after-preview .divider-line:before {
    box-shadow: 0 0 15px 3px rgba(255, 204, 0, 0.7);
    transition: box-shadow 0.3s ease;
}

/* Add a subtle highlight to the slider while animating */
.animating-sliders .before-after-preview {
    box-shadow: 0 0 20px rgba(255, 204, 0, 0.3);
}

/* Ensure portfolio items have no unwanted space */
.portfolio-grid .portfolio-item {
    margin: 0 !important;
    padding: 0 !important;
}

/* Ensure thumbnails fill the container */
.portfolio-grid .portfolio-thumbnail {
    margin: 0;
    padding: 0;
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 100%; /* Creates a perfect square */
    overflow: hidden;
}

/* Ensure the before-after preview fills the container */
.portfolio-grid .before-after-preview {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .portfolio-grid .portfolio-thumbnail {
        border-radius: 8px !important;
    }
    
    .portfolio-grid .portfolio-item,
    .portfolio-grid .before-after-preview,
    .portfolio-grid .portfolio-item img,
    .portfolio-grid .portfolio-overlay,
    .portfolio-grid .no-thumbnail {
        border-radius: 8px !important;
    }
    
    .portfolio-grid .divider-line, 
    .fotoshopcu-recent-portfolios .divider-line {
        cursor: pointer !important;
        width: 6px !important; /* Slightly wider for easier tapping */
        z-index: 10 !important; /* Ensure it's above all other elements */
    }
    
    .portfolio-grid .divider-line:before, 
    .fotoshopcu-recent-portfolios .divider-line:before {
        width: 40px !important; /* Larger tap target */
        height: 40px !important;
        background-color: var(--main-color, #FFCC00) !important;
        border: none !important;
        outline: none !important;
        box-shadow: 0 0 10px rgba(255, 204, 0, 0.5) !important;
    }
    
    .portfolio-grid .divider-line:before:hover,
    .portfolio-grid .divider-line:before:active,
    .portfolio-grid .divider-line:before:focus,
    .fotoshopcu-recent-portfolios .divider-line:before:hover,
    .fotoshopcu-recent-portfolios .divider-line:before:active,
    .fotoshopcu-recent-portfolios .divider-line:before:focus {
        border: none !important;
        outline: none !important;
        background-color: var(--main-color, #FFCC00) !important;
    }
    
    /* Always show the divider icon on mobile - use fa-arrows-alt-h to match desktop */
    .portfolio-grid .divider-line:after,
    .fotoshopcu-recent-portfolios .divider-line:after {
        content: '\f337' !important; /* Font Awesome arrows-alt-h icon - horizontal arrows used in desktop */
        font-family: 'Font Awesome 5 Free' !important;
        font-weight: 900 !important;
        font-size: 16px !important;
        color: #000 !important;
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        z-index: 31 !important;
        display: block !important;
    }
    
    .portfolio-grid .divider-line.mobile-clickable:before,
    .fotoshopcu-recent-portfolios .divider-line.mobile-clickable:before {
        animation: pulse-divider 2s infinite alternate;
    }
    
    /* After element to display correct slider icon - keeping this for backward compatibility */
    .portfolio-grid .divider-line.mobile-clickable:after,
    .fotoshopcu-recent-portfolios .divider-line.mobile-clickable:after {
        content: '\f337' !important; /* Font Awesome arrows-alt-h icon - matching desktop version */
        font-family: 'Font Awesome 5 Free' !important;
        font-weight: 900 !important;
        font-size: 16px !important;
        color: #000 !important;
    }
    
    @keyframes pulse-divider {
        0% {
            transform: translate(-50%, -50%) scale(1);
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
        }
        100% {
            transform: translate(-50%, -50%) scale(1.1);
            box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
        }
    }
    
    /* Tap effect for portfolio items */
    .portfolio-grid .portfolio-item.tapped,
    .fotoshopcu-recent-portfolios .portfolio-item.tapped {
        opacity: 0.8 !important;
        transform: scale(0.97) !important;
        transition: all 0.2s ease !important;
    }
    
    /* Make portfolio items with dividers look more interactive */
    .portfolio-grid .portfolio-item.mobile-tap-enabled .divider-line,
    .fotoshopcu-recent-portfolios .portfolio-item.mobile-tap-enabled .divider-line {
        position: absolute !important;
        z-index: 20 !important; /* Ensure it's above other elements */
    }
    
    .portfolio-grid .portfolio-item.mobile-tap-enabled .portfolio-view,
    .fotoshopcu-recent-portfolios .portfolio-item.mobile-tap-enabled .portfolio-view {
        z-index: 15 !important;
    }
    
    /* Ensure the divider has the highest z-index for mobile */
    .portfolio-grid .portfolio-item.mobile-tap-enabled .divider-line:before,
    .fotoshopcu-recent-portfolios .portfolio-item.mobile-tap-enabled .divider-line:before {
        z-index: 30 !important;
    }
}

@media (max-width: 480px) {
    /* Smaller devices - adjust size */
    .portfolio-grid .divider-line:before,
    .fotoshopcu-recent-portfolios .divider-line:before {
        width: 36px !important;
        height: 36px !important;
    }
} 