/**
 * Recent Portfolios Shortcode Styles
 *
 * @package Fotoshopcu Core
 */

.fotoshopcu-recent-portfolios {
    margin: 40px 0;
    overflow: hidden;
    padding-left: 20px;
    padding-right: 20px;
}

/* Grid Layout */
.recent-portfolios-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

/* Portfolio Item Styles */
.recent-portfolios-grid .portfolio-item {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: #000;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.recent-portfolios-grid .portfolio-item.animated {
    opacity: 1;
    transform: translateY(0);
}

.recent-portfolios-grid .portfolio-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.recent-portfolios-grid .portfolio-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.recent-portfolios-grid .portfolio-thumbnail {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1/1;
    border-radius: 12px;
}

.recent-portfolios-grid .portfolio-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    border-radius: 12px;
}

.recent-portfolios-grid .portfolio-item:hover .portfolio-thumbnail img {
    transform: scale(1.05);
}

/* Before/After Preview Styles */
.recent-portfolios-grid .before-after-preview {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 12px;
    overflow: hidden;
}

.recent-portfolios-grid .before-image,
.recent-portfolios-grid .after-image {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: all 0.3s ease;
}

.recent-portfolios-grid .before-image {
    left: 0;
    background-position: left center;
    width: 100%;
    z-index: 1;
}

.recent-portfolios-grid .after-image {
    right: 0;
    background-position: right center;
    width: 100%;
    z-index: 2;
    clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% 100%);
}

/* Add mini before/after labels to recent portfolios thumbnails */
.recent-portfolios-grid .before-image::before,
.recent-portfolios-grid .after-image::before {
    content: '';
    position: absolute;
    top: 5px;
    background-color: #FFCC00;
    color: #000000;
    font-size: 8px;
    padding: 2px 4px;
    border-radius: 2px;
    z-index: 5;
    font-weight: bold;
    opacity: 0.9;
}

.recent-portfolios-grid .before-image::before {
    content: 'Ö';
    left: 5px;
}

.recent-portfolios-grid .after-image::before {
    content: 'S';
    right: 5px;
}

.recent-portfolios-grid .divider-line {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background-color: #FFCC00;
    z-index: 3;
    transition: left 0.3s ease;
    transform: translateX(-50%);
    cursor: ew-resize;
    border: none !important;
    outline: none !important;
}

.recent-portfolios-grid .divider-line:hover,
.recent-portfolios-grid .divider-line:active,
.recent-portfolios-grid .divider-line:focus {
    border: none !important;
    outline: none !important;
    background-color: #FFCC00 !important;
}

.recent-portfolios-grid .divider-line:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    background-color: #FFCC00;
    border-radius: 50%;
    border: none !important;
    outline: none !important;
}

.recent-portfolios-grid .divider-line:before:hover,
.recent-portfolios-grid .divider-line:before:active,
.recent-portfolios-grid .divider-line:before:focus {
    border: none !important;
    outline: none !important;
    background-color: #FFCC00 !important;
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.recent-portfolios-grid .divider-line:after {
    content: '⟷';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #000;
    font-size: 18px;
    font-weight: bold;
    pointer-events: none;
}

/* Overlay Styles */
.recent-portfolios-grid .portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    opacity: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
    border-radius: 12px;
    z-index: 4;
}

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

.recent-portfolios-grid .portfolio-view {
    color: #fff;
    text-align: center;
    transform: translateY(20px);
    transition: transform 0.3s ease, background-color 0.3s ease;
    padding: 12px 25px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 30px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.recent-portfolios-grid .slider-hint {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(15px);
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 13px;
    padding: 8px 15px;
    border-radius: 20px;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    text-align: center;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.recent-portfolios-grid .portfolio-item:hover .slider-hint {
    opacity: 0.9;
    transform: translateX(-50%) translateY(0);
    transition-delay: 0.2s;
}

.recent-portfolios-grid .portfolio-item:hover .portfolio-view {
    transform: translateY(0);
    background-color: #FFCC00;
    color: #000;
    border: none;
}

.recent-portfolios-grid .view-text {
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.5px;
}

/* Empty State */
.recent-portfolios-grid .no-thumbnail {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000;
    color: #666;
    font-size: 36px;
    border-radius: 12px;
}

/* Footer & Show More Button */
.recent-portfolios-footer {
    text-align: center;
    margin-top: 40px;
    margin-bottom: 20px;
}

.show-more-button,
.show-more-button.freelancer-faq-show-more {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    padding: 1rem 2rem !important; /* px-8 py-4 */
    font-size: 1rem !important; /* text-base */
    font-weight: 600 !important; /* font-semibold */
}

.show-more-button:hover {
    text-decoration: none;
}

/* Ensure SVG icon size matches */
.show-more-button svg,
.show-more-button.freelancer-faq-show-more svg {
    width: 1.25rem !important; /* w-5 */
    height: 1.25rem !important; /* h-5 */
    margin-left: 0.5rem !important; /* ml-2 */
}

.show-more-button.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Animations */
.animated-item {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
    perspective: 1000px;
}

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

/* Staggered entrance animations for portfolio items */
.recent-portfolios-grid .portfolio-item:nth-child(1) {
    animation-delay: 0.1s;
}

.recent-portfolios-grid .portfolio-item:nth-child(2) {
    animation-delay: 0.2s;
}

.recent-portfolios-grid .portfolio-item:nth-child(3) {
    animation-delay: 0.3s;
}

.recent-portfolios-grid .portfolio-item:nth-child(4) {
    animation-delay: 0.4s;
}

.recent-portfolios-grid .portfolio-item:nth-child(5) {
    animation-delay: 0.5s;
}

/* Enhanced animation for active slider */
.recent-portfolios-grid .auto-animating {
    box-shadow: 0 0 20px rgba(255, 204, 0, 0.3);
    z-index: 10;
    transition: all 0.3s ease;
    transform: translateZ(0); /* Force hardware acceleration for smoother animations */
}

.recent-portfolios-grid .auto-animating::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid #FFCC00;
    border-radius: 10px;
    animation: borderGlow 1.2s infinite alternate;
    pointer-events: none;
    z-index: 5;
}

@keyframes borderGlow {
    0% { 
        opacity: 0.4; 
        box-shadow: 0 0 8px rgba(255, 204, 0, 0.2);
    }
    100% { 
        opacity: 0.9; 
        box-shadow: 0 0 15px rgba(255, 204, 0, 0.5);
    }
}

.recent-portfolios-grid .auto-animating .divider-line {
    z-index: 5;
    filter: drop-shadow(0 0 8px rgba(255, 204, 0, 0.8));
}

/* Modern enhanced divider */
.recent-portfolios-grid .auto-animating .divider-line:before {
    background-color: #FFCC00;
    border: none !important;
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.8), inset 0 0 8px rgba(255, 204, 0, 0.4);
}

.recent-portfolios-grid .auto-animating .divider-line:after {
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    animation: arrowPulse 0.8s infinite alternate;
}

@keyframes arrowPulse {
    0% { transform: translate(-50%, -50%) scale(0.9); }
    100% { transform: translate(-50%, -50%) scale(1.2); }
}

/* Wave animation effect */
.recent-portfolios-grid .portfolio-item.wave-animate .before-after-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(255,204,0,0) 0%, rgba(255,204,0,0.3) 50%, rgba(255,204,0,0) 100%);
    z-index: 4;
    pointer-events: none;
    animation: waveEffect 1.2s ease-in-out;
}

@keyframes waveEffect {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* All-together animation enhancement */
.all-together .before-after-preview {
    position: relative;
    overflow: hidden;
}

.all-together .before-after-preview::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,204,0,0.4) 0%, rgba(255,204,0,0) 70%);
    opacity: 0;
    z-index: 3;
    pointer-events: none;
    animation: pulseGlow 1.4s infinite alternate;
}

@keyframes pulseGlow {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 0.7; transform: scale(1.2); }
}

/* Improved animation transitions */
.recent-portfolios-grid .before-after-preview {
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

.recent-portfolios-grid .before-after-preview.fast-transition .divider-line,
.recent-portfolios-grid .before-after-preview.fast-transition .after-image {
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1) !important;
}

/* Responsive Styles */
@media (max-width: 1200px) {
    .recent-portfolios-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 991px) {
    .recent-portfolios-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .fotoshopcu-recent-portfolios {
        padding-left: 15px;
        padding-right: 15px;
    }
}

@media (max-width: 768px) {
    .recent-portfolios-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .fotoshopcu-recent-portfolios {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Hide items beyond mobile_count using class */
    .recent-portfolios-grid .portfolio-item:not(.visible-on-mobile) {
        display: none;
    }
    
    /* Adjust animation timing for mobile */
    .recent-portfolios-grid .portfolio-item:nth-child(1) {
        animation-delay: 0.1s;
    }
    
    .recent-portfolios-grid .portfolio-item:nth-child(2) {
        animation-delay: 0.2s;
    }
    
    .recent-portfolios-grid .portfolio-item:nth-child(3) {
        animation-delay: 0.3s;
    }
    
    .recent-portfolios-grid .portfolio-item:nth-child(4) {
        animation-delay: 0.4s;
    }
    
    /* Adjust divider line appearance on mobile */
    .recent-portfolios-grid .divider-line:before {
        width: 30px;
        height: 30px;
    }
    
    .recent-portfolios-grid .divider-line:after {
        font-size: 16px;
    }
    
    /* Optimize animations for mobile */
    .recent-portfolios-grid .auto-animating::after {
        border-width: 1px;
    }
}

@media (max-width: 480px) {
    .recent-portfolios-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .fotoshopcu-recent-portfolios {
        padding-left: 5px;
        padding-right: 5px;
        margin: 20px 0;
    }
    
    /* Smaller thumbnails on very small screens */
    .recent-portfolios-grid .portfolio-thumbnail {
        aspect-ratio: 1/1.1;
    }
    
    /* Smaller text on buttons */
    .recent-portfolios-grid .portfolio-view {
        padding: 8px 15px;
    }
    
    .recent-portfolios-grid .view-text {
        font-size: 13px;
    }
    
    .show-more-button,
    .show-more-button.freelancer-faq-show-more,
    a.show-more-button,
    a.freelancer-faq-show-more,
    .hero-primary-button.show-more-button,
    .hero-primary-button.freelancer-faq-show-more {
        padding: 0.75rem 1.5rem !important; /* Override px-8 py-4 */
        font-size: 0.875rem !important; /* Override text-base */
        font-weight: 600 !important; /* Override font-semibold */
        min-height: auto !important;
        height: auto !important;
        line-height: 1.5 !important;
    }
    
    .show-more-button svg,
    .show-more-button.freelancer-faq-show-more svg,
    .hero-primary-button.show-more-button svg,
    .hero-primary-button.freelancer-faq-show-more svg {
        width: 1rem !important; /* Override w-5 */
        height: 1rem !important; /* Override h-5 */
        margin-left: 0.5rem !important; /* Override ml-2 */
    }
}

@media (max-width: 480px) {
    .show-more-button,
    .show-more-button.freelancer-faq-show-more,
    a.show-more-button,
    a.freelancer-faq-show-more,
    .hero-primary-button.show-more-button,
    .hero-primary-button.freelancer-faq-show-more {
        padding: 0.625rem 1.25rem !important;
        font-size: 0.8125rem !important;
    }
    
    /* Even smaller divider for very small screens */
    .recent-portfolios-grid .divider-line:before {
        width: 26px;
        height: 26px;
    }
    
    .recent-portfolios-grid .divider-line:after {
        font-size: 14px;
    }
    
    /* Hide slider hint on very small screens */
    .recent-portfolios-grid .slider-hint {
        display: none;
    }
}

/* Active Animation Styles */
.recent-portfolios-grid .auto-animating {
    box-shadow: 0 0 20px rgba(255, 204, 0, 0.3);
}

.recent-portfolios-grid .auto-animating .divider-line {
    z-index: 5;
}

.recent-portfolios-grid .auto-animating .divider-line:before {
    background-color: #FFCC00;
    animation: pulsingDivider 1.5s infinite;
}

.recent-portfolios-grid .auto-animating .divider-line:after {
    animation: fadeInOut 1.5s infinite;
}

.recent-portfolios-grid .portfolio-item .active-slider-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #FFCC00;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 6;
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.6);
}

.recent-portfolios-grid .auto-animating .active-slider-indicator {
    opacity: 1;
    animation: pulseIndicator 0.8s infinite;
}

@keyframes pulseIndicator {
    0% { transform: scale(0.8); }
    50% { transform: scale(1.2); }
    100% { transform: scale(0.8); }
}

@keyframes pulsingDivider {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

@keyframes fadeInOut {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
} 