/* Advanced Portfolio Gallery Styles */

.apg-portfolio-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Filters */
.apg-filters {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.apg-filter-btn {
    background: #f5f5f5;
    border: 2px solid #ddd;
    padding: 10px 25px;
    margin: 5px;
    cursor: pointer;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    color: #333;
}

.apg-filter-btn:hover {
    background: #e8e8e8;
    border-color: #999;
    transform: translateY(-2px);
}

.apg-filter-btn.active {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

/* Grid Layout */
.apg-grid {
    display: grid;
    gap: 25px;
    margin-top: 30px;
}

.apg-grid.apg-columns-2 {
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
}

.apg-grid.apg-columns-3 {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.apg-grid.apg-columns-4 {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

/* Portfolio Items - Isotope Style */
.apg-item {
    opacity: 1;
    transform: scale(1);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform;
}

/* Hidden state with isotope-style animation */
.apg-item.hidden {
    opacity: 0;
    transform: scale(0.7) translateY(20px);
    pointer-events: none;
    position: absolute;
    visibility: hidden;
}

/* Smooth appearance animation */
.apg-item:not(.hidden) {
    animation: itemAppear 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes itemAppear {
    0% {
        opacity: 0;
        transform: scale(0.85) translateY(30px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.apg-item-inner {
    position: relative;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.apg-item-inner:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

/* Image Container */
.apg-item-inner a {
    display: block;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.apg-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.apg-item-inner:hover .apg-image {
    transform: scale(1.1);
}

/* Placeholder για videos/tours χωρίς εικόνα */
.apg-placeholder {
    width: 100%;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.apg-icon-large {
    font-size: 80px;
    opacity: 0.9;
}

/* Overlay */
.apg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.apg-item-inner a:hover .apg-overlay {
    opacity: 1;
}

.apg-icon {
    font-size: 48px;
    color: white;
    transform: scale(0.5);
    transition: transform 0.3s ease;
}

.apg-item-inner a:hover .apg-icon {
    transform: scale(1);
}

/* Content */
.apg-content {
    padding: 20px;
}

.apg-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.apg-excerpt {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

/* Lightbox */
.apg-lightbox-overlay {
    display: none;
    position: fixed;
    z-index: 9999;
    padding: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.95);
    animation: fadeIn 0.3s ease;
}

.apg-lightbox-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.apg-lightbox-content {
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 50px rgba(255, 255, 255, 0.1);
}

.apg-lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.apg-lightbox-close:hover,
.apg-lightbox-close:focus {
    color: #bbb;
}

.apg-lightbox-title {
    color: white;
    text-align: center;
    padding: 20px;
    font-size: 18px;
    font-weight: 500;
}

/* Universal Modal for Images, Videos, and Virtual Tours */
.apg-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.95);
    animation: fadeIn 0.3s ease;
}

.apg-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.apg-modal-content {
    position: relative;
    background-color: transparent;
    margin: auto;
    padding: 0;
    width: 95%;
    max-width: 1400px;
    max-height: 95vh;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.apg-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    z-index: 100001;
}

.apg-modal-close:hover,
.apg-modal-close:focus {
    color: #ff6b6b;
}

.apg-modal-title {
    color: white;
    text-align: center;
    padding: 15px 0;
    font-size: 20px;
    font-weight: 500;
    position: absolute;
    top: -70px;
    left: 0;
    right: 60px;
}

.apg-modal-body {
    width: 100%;
    position: relative;
}

/* Modal Image */
.apg-modal-image {
    width: 100%;
    height: auto;
    max-height: 90vh;
    object-fit: contain;
    display: block;
    border-radius: 8px;
}

/* Video Wrapper */
.apg-video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    background: #000;
    border-radius: 8px;
}

.apg-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Virtual Tour Wrapper */
.apg-tour-wrapper {
    position: relative;
    padding-bottom: 75%; /* 4:3 aspect ratio for virtual tours */
    height: 0;
    overflow: hidden;
    background: #000;
    border-radius: 8px;
    min-height: 600px;
}

.apg-tour-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Placeholder Updates */
.apg-placeholder-video {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.apg-placeholder-tour {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* Responsive */
@media (max-width: 768px) {
    .apg-grid.apg-columns-2,
    .apg-grid.apg-columns-3,
    .apg-grid.apg-columns-4 {
        grid-template-columns: 1fr;
    }
    
    .apg-filter-btn {
        padding: 8px 15px;
        font-size: 12px;
        margin: 3px;
    }
    
    .apg-image,
    .apg-placeholder {
        height: 250px;
    }
    
    .apg-lightbox-overlay {
        padding: 20px;
    }
    
    .apg-lightbox-close {
        font-size: 40px;
        top: 10px;
        right: 20px;
    }
    
    .apg-modal-content {
        width: 98%;
        max-height: 90vh;
    }
    
    .apg-modal-close {
        font-size: 35px;
        top: -45px;
    }
    
    .apg-modal-title {
        font-size: 16px;
        top: -75px;
        right: 50px;
    }
    
    .apg-video-wrapper,
    .apg-tour-wrapper {
        padding-bottom: 75%;
        min-height: 400px;
    }
}

@media (max-width: 480px) {
    .apg-portfolio-wrapper {
        padding: 10px;
    }
    
    .apg-filters {
        margin-bottom: 20px;
    }
    
    .apg-image,
    .apg-placeholder {
        height: 200px;
    }
    
    .apg-content {
        padding: 15px;
    }
    
    .apg-title {
        font-size: 16px;
    }
    
    .apg-excerpt {
        font-size: 13px;
    }
    
    .apg-modal-content {
        width: 100%;
    }
    
    .apg-modal-close {
        font-size: 30px;
        top: -40px;
    }
    
    .apg-modal-title {
        font-size: 14px;
        top: -65px;
        padding: 10px 0;
    }
    
    .apg-video-wrapper,
    .apg-tour-wrapper {
        min-height: 300px;
        padding-bottom: 100%;
    }
}

/* Animation για το filtering */
@keyframes itemAppear {
    0% {
        opacity: 0;
        transform: scale(0.85) translateY(30px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}
