/**
 * Product Gallery Modal Styles
 * Modal für Produktbilder-Galerie
 *
 * @author 4Unit Systems Integration GmbH
 * @version 1.0.0
 * @date 2024-12-28
 */

/* ==================== GALLERY MODAL OVERLAY ==================== */
#product-gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background-color: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
}

#product-gallery-modal.active {
    display: flex;
}

/* ==================== GALLERY CONTAINER ==================== */
.gallery-container {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    max-height: 800px;
    display: flex;
    flex-direction: column;
}

/* ==================== GALLERY HEADER ==================== */
.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 12px 12px 0 0;
}

.gallery-title {
    color: white;
    font-size: 18px;
    font-weight: 600;
}

.gallery-close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 4px 12px;
    transition: all 0.2s ease;
    border-radius: 8px;
}

.gallery-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ==================== MAIN IMAGE DISPLAY ==================== */
.gallery-main-display {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.gallery-main-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

/* ==================== NAVIGATION ARROWS ==================== */
.gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    color: #111827;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.gallery-nav-btn:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

.gallery-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.gallery-nav-btn.prev {
    left: 20px;
}

.gallery-nav-btn.next {
    right: 20px;
}

/* ==================== THUMBNAILS ==================== */
.gallery-thumbnails {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 0 0 12px 12px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.gallery-thumbnails::-webkit-scrollbar {
    height: 8px;
}

.gallery-thumbnails::-webkit-scrollbar-track {
    background: transparent;
}

.gallery-thumbnails::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.gallery-thumbnail {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s ease;
}

.gallery-thumbnail:hover {
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.gallery-thumbnail.active {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

/* ==================== IMAGE COUNTER ==================== */
.gallery-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10;
}

/* ==================== MOBILE RESPONSIVE ==================== */
@media (max-width: 768px) {
    .gallery-container {
        width: 100%;
        height: 100vh;
        max-height: none;
        border-radius: 0;
    }

    .gallery-header {
        border-radius: 0;
        padding: 12px 16px;
    }

    .gallery-title {
        font-size: 16px;
    }

    .gallery-thumbnails {
        border-radius: 0;
        padding: 12px 16px;
        gap: 8px;
    }

    .gallery-thumbnail {
        width: 60px;
        height: 60px;
    }

    .gallery-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .gallery-nav-btn.prev {
        left: 10px;
    }

    .gallery-nav-btn.next {
        right: 10px;
    }

    .gallery-counter {
        bottom: 10px;
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

#product-gallery-modal.active {
    animation: fadeIn 0.2s ease;
}

.gallery-main-image {
    animation: zoomIn 0.3s ease;
}

/* ==================== LOADING STATE ==================== */
.gallery-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 18px;
}

.gallery-loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
