/**
 * GLightbox Custom Styling for AvPro Theme
 *
 * @package AvPro
 * @since 1.0.0
 */

/* ==========================================================================
   GLIGHTBOX OVERLAY & CONTAINER
   ========================================================================== */

.glightbox-container {
    background: rgba(0, 0, 0, 0.95) !important;
}

/* ==========================================================================
   NAVIGATION BUTTONS (Previous/Next)
   ========================================================================== */

.gslide-title {
    font-family: inherit;
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.5rem;
}

.gslide-desc {
    font-family: inherit;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
}

/* Navigation Arrows - Theme Primary Color */
.gnext,
.gprev {
    background: var(--avpro-primary, #007bff) !important;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.gnext:hover,
.gprev:hover {
    background: var(--avpro-primary-dark, #0056b3) !important;
    transform: scale(1.1);
}

.gnext svg,
.gprev svg {
    width: 24px;
    height: 24px;
    fill: #fff;
}

/* ==========================================================================
   CLOSE BUTTON
   ========================================================================== */

.gclose {
    background: var(--avpro-primary, #007bff) !important;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    top: 20px;
    right: 20px;
}

.gclose:hover {
    background: var(--avpro-primary-dark, #0056b3) !important;
    transform: scale(1.1) rotate(90deg);
}

.gclose svg {
    width: 28px;
    height: 28px;
    stroke: #fff;
}

/* ==========================================================================
   LOADER
   ========================================================================== */

.gloader {
    border-top-color: var(--avpro-primary, #007bff) !important;
}

/* ==========================================================================
   ZOOM CONTROLS
   ========================================================================== */

.zoomer {
    background: var(--avpro-primary, #007bff);
    border-radius: 4px;
    padding: 8px;
}

.zoomer button {
    background: transparent;
    color: #fff;
    border: none;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.zoomer button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

/* ==========================================================================
   THUMBNAILS
   ========================================================================== */

.gslide-thumbnail {
    border: 3px solid transparent;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.gslide-thumbnail.active,
.gslide-thumbnail:hover {
    border-color: var(--avpro-primary, #007bff);
}

/* ==========================================================================
   VIDEO PLAYER
   ========================================================================== */

.gvideo-wrapper {
    border-radius: 12px;
    overflow: hidden;
}

/* ==========================================================================
   MOBILE OPTIMIZATIONS
   ========================================================================== */

@media (max-width: 768px) {
    .gnext,
    .gprev {
        width: 40px;
        height: 40px;
    }

    .gnext svg,
    .gprev svg {
        width: 20px;
        height: 20px;
    }

    .gclose {
        width: 40px;
        height: 40px;
        top: 10px;
        right: 10px;
    }

    .gclose svg {
        width: 24px;
        height: 24px;
    }

    .gslide-title {
        font-size: 1.1rem;
    }

    .gslide-desc {
        font-size: 0.85rem;
    }
}

/* ==========================================================================
   INLINE CONTENT
   ========================================================================== */

.ginlined-content {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    max-width: 900px;
    margin: 0 auto;
}

/* ==========================================================================
   CUSTOM ANIMATIONS
   ========================================================================== */

.gslide-media {
    animation: glightboxFadeIn 0.3s ease-in-out;
}

@keyframes glightboxFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */

.glightbox-container:focus {
    outline: none;
}

.gnext:focus,
.gprev:focus,
.gclose:focus {
    outline: 3px solid var(--avpro-primary, #007bff);
    outline-offset: 2px;
}

/* ==========================================================================
   WOOCOMMERCE SPECIFIC STYLING
   ========================================================================== */

/* Product gallery images should have cursor pointer */
.woocommerce div.product div.images .glightbox-product {
    cursor: pointer;
    display: block;
    position: relative;
}

.woocommerce div.product div.images .glightbox-product:hover {
    opacity: 0.9;
}

/* Add subtle zoom indication on hover */
.woocommerce div.product div.images .glightbox-product {
    position: relative;
    overflow: hidden;
}

.woocommerce div.product div.images .glightbox-product::before {
    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;
    z-index: 1;
}

.woocommerce div.product div.images .glightbox-product:hover::before {
    background: rgba(0, 0, 0, 0.1);
}

/* Optional: Add magnify icon on hover */
.woocommerce div.product div.images .glightbox-product::after {
    content: '\f52d'; /* bi-zoom-in icon */
    font-family: 'bootstrap-icons';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 2;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.woocommerce div.product div.images .glightbox-product:hover::after {
    opacity: 0.8;
}

/* ==========================================================================
   NEWSLETTER IFRAME LIGHTBOX
   ========================================================================== */

/* Ensure iframe lightbox has proper styling */
.gslide-iframe {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
}

/* iframe container */
.gslide-media.gslide-external {
    border-radius: 12px;
    overflow: hidden;
}

/* Newsletter form iframe specific styling */
.gslide-media iframe {
    border: none;
    width: 100%;
    height: 100%;
    border-radius: 12px;
}

/* Loading state for iframe */
.gslide-media.gslide-loading {
    background: #fff;
}

/* Mobile optimization for newsletter iframe */
@media (max-width: 768px) {
    /* Adjust iframe size on mobile */
    .gslide-iframe .gslide-media {
        max-width: 95vw !important;
        max-height: 90vh !important;
    }

    .gslide-media iframe {
        max-width: 100% !important;
        max-height: 85vh !important;
    }

    /* Adjust container on mobile */
    .gslide-iframe {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .gslide-media iframe {
        max-height: 80vh !important;
    }
}
