/**
 * Review Photo Gallery Styles
 * Amazon-style thumbnail strip with lightbox
 * 
 * @package WC_Gemini_Auto_Reviews
 * @since 3.2.0
 */

/* ==========================================================================
   Gallery Strip
   ========================================================================== */

.wcgar-photo-gallery {
    margin: 2rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, #fafbfc 0%, #f0f2f5 100%) !important;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.wcgar-gallery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.wcgar-gallery-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a2e;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wcgar-gallery-title::before {
    content: '📷';
    font-size: 1.2em;
}

.wcgar-gallery-see-all {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #667eea;
    background: transparent;
    border: 1px solid #667eea;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wcgar-gallery-see-all:hover {
    background: #667eea;
    color: white;
}

/* Thumbnail Strip */
.wcgar-gallery-strip {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.wcgar-gallery-thumb {
    position: relative;
    width: 80px;
    height: 80px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    background: #e0e0e0;
    transition: all 0.2s ease;
}

.wcgar-gallery-thumb:hover {
    transform: scale(1.05);
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.wcgar-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wcgar-thumb-hidden {
    display: none;
}

.wcgar-gallery-strip.wcgar-expanded .wcgar-thumb-hidden {
    display: block;
}

.wcgar-thumb-more {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Load More Button */
.wcgar-gallery-load-more-wrap {
    margin-top: 1.5rem;
    text-align: center;
}

.wcgar-gallery-load-more {
    padding: 0.75rem 2rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: #667eea;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.wcgar-gallery-load-more:hover {
    border-color: #667eea;
    background: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(102, 126, 234, 0.15);
}

.wcgar-gallery-load-more:disabled {
    opacity: 0.7;
    cursor: wait;
}

/* Spinner */
.wcgar-load-more-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: wcgarSpin 1s linear infinite;
}

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

/* ==========================================================================
   Lightbox
   ========================================================================== */

.wcgar-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a !important;
}

.wcgar-lightbox[hidden] {
    display: none;
}

.wcgar-lightbox-overlay {
    position: absolute;
    inset: 0;
    background: #1a1a1a !important;
    opacity: 1 !important;
}

.wcgar-lightbox-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    height: 90vh;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

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

.wcgar-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

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

.wcgar-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.wcgar-lightbox-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.wcgar-nav-prev {
    left: 1rem;
}

.wcgar-nav-next {
    right: 1rem;
}

/* Content Area */
.wcgar-lightbox-content {
    flex: 1;
    display: flex;
    gap: 2rem;
    padding: 0 4rem;
    min-height: 0;
}

.wcgar-lightbox-image-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.wcgar-lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* Review Details Sidebar */
.wcgar-lightbox-details {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.85) !important;
    border-radius: 12px;
    color: white;
    overflow-y: auto;
}

.wcgar-lightbox-rating {
    display: flex;
    gap: 2px;
}

.wcgar-lightbox-author {
    font-weight: 600;
    font-size: 1rem;
}

.wcgar-lightbox-date {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
}

.wcgar-lightbox-review {
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

/* Thumbnail Strip in Lightbox */
.wcgar-lightbox-thumbs {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    padding: 1rem 0;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.wcgar-lightbox-thumb {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s ease;
}

.wcgar-lightbox-thumb:hover,
.wcgar-lightbox-thumb.active {
    opacity: 1;
    border-color: #667eea;
}

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

/* Stars in Lightbox */
.wcgar-stars {
    display: flex;
    gap: 2px;
}

.wcgar-star {
    flex-shrink: 0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .wcgar-photo-gallery {
        padding: 1rem;
        margin: 1rem 0;
    }

    .wcgar-gallery-thumb {
        width: 64px;
        height: 64px;
    }

    .wcgar-lightbox-content {
        flex-direction: column;
        padding: 0 1rem;
    }

    .wcgar-lightbox-details {
        width: 100%;
        max-height: 30vh;
    }

    .wcgar-lightbox-nav {
        width: 40px;
        height: 40px;
    }

    .wcgar-nav-prev {
        left: 0.5rem;
    }

    .wcgar-nav-next {
        right: 0.5rem;
    }
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes wcgarFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes wcgarSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wcgar-lightbox:not([hidden]) {
    animation: wcgarFadeIn 0.3s ease;
}

.wcgar-lightbox:not([hidden]) .wcgar-lightbox-container {
    animation: wcgarSlideUp 0.3s ease;
}

/* ==========================================================================
   Print
   ========================================================================== */

@media print {
    .wcgar-photo-gallery {
        display: none;
    }

    .wcgar-lightbox {
        display: none !important;
    }
}