/**
 * Gallery Styles
 * Galerie foto generală și lightbox
 */

/* --- GALERIE GENERALĂ --- */
.gallery-container {
    max-width: 1000px;
    margin: 0 auto;
}

/* Imaginea mare preview */
.gallery-main {
    width: 100%;
    height: 500px;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    position: relative;
    background: #f5f5f5;
}

.gallery-main:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(0,0,0,0.15);
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-main img.loading {
    opacity: 0.5;
}

.gallery-main:hover img {
    transform: scale(1.05);
}

/* Grid thumbnails */
.gallery-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.gallery-thumb {
    height: 120px;
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
}

.gallery-thumb:hover {
    border-color: #a07d50;
    transform: translateY(-3px);
}

.gallery-thumb.active {
    border-color: #a07d50;
    box-shadow: 0 5px 15px rgba(160,125,80,0.3);
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-thumb:hover img {
    transform: scale(1.1);
}

/* --- LIGHTBOX --- */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 5px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

/* Butoane navigare lightbox */
.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 15px 20px;
    transition: all 0.3s ease;
    border-radius: 5px;
    backdrop-filter: blur(10px);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.lightbox-close {
    top: 20px;
    right: 20px;
    font-size: 2.5rem;
    padding: 10px 20px;
}

.lightbox-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-prev:hover {
    transform: translateY(-50%) scale(1.1);
}

.lightbox-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next:hover {
    transform: translateY(-50%) scale(1.1);
}

/* Counter poze */
.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    font-size: 0.9rem;
}

/* --- LOADING SPINNER --- */
.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #a07d50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.lazy-image {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lazy-image.loaded {
    opacity: 1;
}

/* --- RESPONSIVE GALLERY --- */
@media (max-width: 768px) {
    .gallery-main {
        height: 300px;
    }

    .gallery-thumbnails {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .gallery-thumb {
        height: 80px;
    }

    .lightbox-prev,
    .lightbox-next {
        font-size: 1.5rem;
        padding: 10px 15px;
    }

    .lightbox-close {
        font-size: 2rem;
        padding: 8px 15px;
        top: 10px;
        right: 10px;
    }

    .lightbox-counter {
        bottom: 10px;
        padding: 8px 15px;
        font-size: 0.8rem;
    }
}
