/**
 * MyGroceryPlan Plugin - Lightbox Styles
 * 
 * This file contains the CSS styles for the Lightbox on MyGroceryPlan WordPress plugin.
 *
 * @package   MyGroceryPlan
 * @version   1.0.0
 * @author    Shawn Pick
 * @license   GPL-2.0+
 * @link      https://mygroceryplan.ca
 * @since     1.0.0
 */


/* Lightbox Overlay */
.mgp-lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mgp-lightbox-overlay.active {
    display: flex;
    opacity: 1;
    align-items: center;
    justify-content: center;
}

/* Lightbox Container */
body.elementor-kit-6 .mgp-lightbox-container {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: scale(0.8);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.mgp-lightbox-overlay.active .mgp-lightbox-container {
    transform: scale(1);
}

/* Lightbox Header */
body.elementor-kit-6 .mgp-lightbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

body.elementor-kit-6  .mgp-lightbox-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: #333;
}

body.elementor-kit-6 .mgp-lightbox-close {
    height: 24px;
    width: 24px;
    font-size: 2.3em;
    line-height: 10px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    box-shadow: none;
}

body.elementor-kit-6 .mgp-lightbox-close:hover {
    background-color: #e9ecef;
    color: #333;
}

/* Lightbox Content */
body.elementor-kit-6 .mgp-lightbox-content {
    text-align: center;
    padding: 0px;
    max-height: 70vh;
    max-width: 95vw;
    overflow-y: auto;
}
body.elementor-kit-6 .mgp-lightbox-content img {
    max-width: 89vw;
}

/* Lightbox Footer */
body.elementor-kit-6 .mgp-lightbox-footer {
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    text-align: right;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mgp-lightbox-container {
        max-width: 95%;
        max-height: 95%;
        margin: 10px;
    }
    
    .mgp-lightbox-content {
        max-height: 60vh;
        padding: 15px;
    }
    
    .mgp-lightbox-header,
    .mgp-lightbox-footer {
        padding: 10px 15px;
    }
}

/* Animation for content loading */
.mgp-lightbox-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.mgp-lightbox-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: mgp-spin 1s linear infinite;
}

@keyframes mgp-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* allow scripts to handle horizontal gestures */
.mgp-lightbox-content {
  touch-action: pan-y;     /* allow vertical scroll (if any), capture horizontal for swipe */
  -ms-touch-action: pan-y; /* legacy Edge/IE */
}

/* optional: prevent image dragging ghost effect */
.mgp-lightbox-content img {
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
}
