/**
 * Portfolio Archive Styles
 *
 * @package Fotoshopcu Core
 */

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

/* Portfolio Item Styles */
.portfolio-grid .portfolio-item {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 8px 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(30px);
    animation: fadeInUp 0.6s ease forwards;
    perspective: 1000px;
    margin: 0;
    padding: 0;
}

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

.portfolio-grid .portfolio-link {
    display: block;
    text-decoration: none;
    color: inherit;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
}

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

.portfolio-grid .portfolio-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

/* Before/After Preview Styles */
.portfolio-grid .before-after-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

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

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

.portfolio-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 portfolio archive thumbnails */
.portfolio-grid .before-image::before,
.portfolio-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;
}

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

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

.portfolio-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;
}

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

.portfolio-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;
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.portfolio-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 */
.portfolio-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: 10px;
    z-index: 4;
}

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

.portfolio-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: 2px solid rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.portfolio-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);
}

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

.portfolio-grid .portfolio-item:hover .portfolio-view {
    transform: translateY(0);
    background-color: #FFCC00;
    color: #000;
    border-color: rgba(255, 255, 255, 0.8);
}

.portfolio-grid .view-text {
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.5px;
    margin-right: 8px;
}

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

/* Pagination */
.navigation.pagination {
    margin: 40px auto;
    text-align: center;
}

.pagination .nav-links {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #000;
    color: #e0e0e0;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.pagination .page-numbers.current {
    background-color: var(--main-color, #FFCC00);
    color: #000;
}

.pagination .page-numbers:hover:not(.current) {
    background-color: #3a3a3a;
}

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

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

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

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

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

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

.portfolio-grid .portfolio-item:nth-child(6) {
    animation-delay: 0.6s;
}

.portfolio-grid .portfolio-item:nth-child(7) {
    animation-delay: 0.7s;
}

.portfolio-grid .portfolio-item:nth-child(8) {
    animation-delay: 0.8s;
}

.portfolio-grid .portfolio-item:nth-child(9) {
    animation-delay: 0.9s;
}

.portfolio-grid .portfolio-item:nth-child(10) {
    animation-delay: 1s;
}

.portfolio-grid .portfolio-item:nth-child(n+11) {
    animation-delay: 1s;
}

/* Enhanced animation for active slider */
.portfolio-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 */
}

.portfolio-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);
    }
}

/* Responsive Styles */
@media (max-width: 1400px) {
    .portfolio-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }
}

@media (max-width: 1200px) {
    .portfolio-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
}

@media (max-width: 991px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
        width: 100%;
        box-sizing: border-box;
        padding: 0;
        margin: 0 auto;
        gap: 10px;
    }
    
    .portfolio-grid .portfolio-item {
        width: 100%;
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }
    
    /* Adjust aspect ratio for better fit on mobile */
    .portfolio-grid .portfolio-thumbnail {
        aspect-ratio: 1/1;
    }
    
    /* Increase touchable area for buttons */
    .portfolio-grid .portfolio-view {
        padding: 8px 16px;
    }
}

@media (max-width: 480px) {
    /* Better spacing on mobile */
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin: 0 auto 25px;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Remove margin below the grid */
    .portfolio-grid {
        margin-bottom: 25px;
    }
    
    /* Smaller text on buttons */
    .portfolio-grid .portfolio-view {
        padding: 8px 16px;
    }
    
    .portfolio-grid .view-text {
        font-size: 13px;
    }
}

@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; }
} 