/* ========================================
   Apartment Gallery Lightbox Styles
   Premium design for per-apartment galleries
   ======================================== */

/* Main Lightbox Container */
.apt-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.apt-lightbox.active {
    opacity: 1;
    visibility: visible;
}

/* Overlay */
.apt-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
}

/* Container */
.apt-lightbox-container {
    position: relative;
    width: 95%;
    max-width: 1200px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

/* Close Button */
.apt-lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.apt-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Main Image Area */
.apt-lightbox-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 0;
}

/* Navigation Buttons */
.apt-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 5;
}

.apt-lightbox-prev {
    left: 1rem;
}

.apt-lightbox-next {
    right: 1rem;
}

.apt-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) scale(1.1);
}

.apt-lightbox-nav:active {
    transform: translateY(-50%) scale(0.95);
}

/* Image Wrapper */
.apt-lightbox-image-wrapper {
    max-width: calc(100% - 140px);
    max-height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.apt-lightbox-image-wrapper img {
    max-width: 100%;
    max-height: calc(90vh - 180px);
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    opacity: 1;
    transition: opacity 0.3s ease;
}

.apt-lightbox-image-wrapper.loading img {
    opacity: 0.3;
}

/* Loading Spinner */
.apt-lightbox-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.apt-lightbox-image-wrapper.loading .apt-lightbox-loading {
    opacity: 1;
}

.apt-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Info Bar */
.apt-lightbox-info {
    text-align: center;
    padding: 1.5rem 0;
    color: white;
}

.apt-lightbox-info h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.apt-lightbox-info p {
    font-size: 1rem;
    opacity: 0.8;
    margin-bottom: 0.25rem;
}

.apt-lightbox-info span {
    font-size: 0.875rem;
    opacity: 0.6;
}

/* Thumbnails Strip */
.apt-lightbox-thumbnails {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 0;
    overflow-x: auto;
    justify-content: center;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}

.apt-lightbox-thumbnails::-webkit-scrollbar {
    height: 4px;
}

.apt-lightbox-thumbnails::-webkit-scrollbar-track {
    background: transparent;
}

.apt-lightbox-thumbnails::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
}

.apt-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.apt-thumb:hover {
    opacity: 0.8;
}

.apt-thumb.active {
    opacity: 1;
    border-color: #667eea;
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.apt-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Apartment Image Click Indicator */
.apartment-image {
    position: relative;
}

.apartment-image[data-apartment] {
    cursor: pointer;
}

.apartment-image[data-apartment]::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    pointer-events: none;
}

.apartment-image[data-apartment]:hover::after {
    background: rgba(0, 0, 0, 0.15);
}

/* Gallery Icon on Hover */
.apartment-image[data-apartment]::before {
    content: '📷 Δείτε Gallery';
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(255, 255, 255, 0.95);
    color: #1a202c;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 5;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

.apartment-image[data-apartment]:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Responsive Styles */
@media (max-width: 768px) {
    .apt-lightbox-container {
        width: 100%;
        height: 100vh;
        padding: 1rem;
    }
    
    .apt-lightbox-close {
        top: 1rem;
        right: 1rem;
    }
    
    .apt-lightbox-nav {
        width: 44px;
        height: 44px;
    }
    
    .apt-lightbox-prev {
        left: 0.5rem;
    }
    
    .apt-lightbox-next {
        right: 0.5rem;
    }
    
    .apt-lightbox-image-wrapper {
        max-width: calc(100% - 100px);
    }
    
    .apt-lightbox-image-wrapper img {
        max-height: calc(100vh - 250px);
        border-radius: 8px;
    }
    
    .apt-lightbox-info h3 {
        font-size: 1.25rem;
    }
    
    .apt-lightbox-info p {
        font-size: 0.9rem;
    }
    
    .apt-thumb {
        width: 60px;
        height: 45px;
    }
    
    .apartment-image[data-apartment]::before {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .apt-lightbox-nav {
        width: 36px;
        height: 36px;
    }
    
    .apt-lightbox-image-wrapper {
        max-width: calc(100% - 80px);
    }
    
    .apt-thumb {
        width: 50px;
        height: 38px;
    }
}
