/* ==================================================
   WP Media Gallery Pro - Lightbox Styles
   Version: 2.0.0
   ================================================== */

/* ------------------------------------------------
   Lightbox Container
------------------------------------------------ */
.wpmg-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    cursor: pointer;
}

.wpmg-lightbox.active {
    opacity: 1;
    visibility: visible;
}

/* ------------------------------------------------
   Lightbox Content
------------------------------------------------ */
.wpmg-lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.wpmg-lightbox.active .wpmg-lightbox-content {
    transform: scale(1);
}

/* ------------------------------------------------
   Lightbox Close Button
------------------------------------------------ */
.wpmg-lightbox-close {
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 28px;
    color: white;
    cursor: pointer;
    z-index: 10;
    background: rgba(0, 0, 0, 0.6);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.wpmg-lightbox-close:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: rotate(90deg);
}

/* ------------------------------------------------
   Lightbox Navigation Buttons
------------------------------------------------ */
.wpmg-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(4px);
}

.wpmg-lightbox-nav:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.wpmg-lightbox-prev {
    left: 20px;
}

.wpmg-lightbox-next {
    right: 20px;
}

/* ------------------------------------------------
   Lightbox Image Container
------------------------------------------------ */
.wpmg-lightbox-image-container {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    min-height: 300px;
}

.wpmg-lightbox-content img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* ------------------------------------------------
   Lightbox Caption
------------------------------------------------ */
.wpmg-lightbox-caption {
    padding: 20px;
    background: white;
    border-top: 1px solid #eee;
}

.wpmg-lightbox-caption h3 {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.wpmg-lightbox-caption p {
    margin: 0 0 15px;
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
}

/* ------------------------------------------------
   Lightbox Stats
------------------------------------------------ */
.wpmg-lightbox-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 13px;
}

.wpmg-lightbox-stats span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.wpmg-lightbox-stats i {
    color: #667eea;
    font-size: 14px;
}

/* ------------------------------------------------
   Lightbox Download Button
------------------------------------------------ */
.wpmg-lightbox-download {
    padding: 10px 24px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.wpmg-lightbox-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.wpmg-lightbox-download:active {
    transform: translateY(0);
}

/* ------------------------------------------------
   Lightbox Share Section
------------------------------------------------ */
.wpmg-lightbox-share {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.wpmg-lightbox-share span {
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
}

.wpmg-lightbox-share a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #64748b;
    text-decoration: none;
    transition: all 0.3s ease;
}

.wpmg-lightbox-share a:hover {
    transform: translateY(-2px);
}

.wpmg-lightbox-share .share-facebook:hover {
    background: #1877f2;
    color: white;
}

.wpmg-lightbox-share .share-twitter:hover {
    background: #1da1f2;
    color: white;
}

.wpmg-lightbox-share .share-pinterest:hover {
    background: #e60023;
    color: white;
}

.wpmg-lightbox-share .share-whatsapp:hover {
    background: #25d366;
    color: white;
}

/* ------------------------------------------------
   Lightbox Counter
------------------------------------------------ */
.wpmg-lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    backdrop-filter: blur(4px);
    z-index: 10;
}

/* ------------------------------------------------
   Lightbox Loading State
------------------------------------------------ */
.wpmg-lightbox-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 5;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ------------------------------------------------
   Video Lightbox Modal
------------------------------------------------ */
.wpmg-video-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wpmg-video-lightbox .wpmg-lightbox-content {
    max-width: 900px;
    background: black;
}

.wpmg-video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.wpmg-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.wpmg-video-lightbox .wpmg-lightbox-close {
    top: -40px;
    right: 0;
    background: rgba(0, 0, 0, 0.5);
}

/* ------------------------------------------------
   Responsive Lightbox
------------------------------------------------ */
@media (max-width: 768px) {
    .wpmg-lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .wpmg-lightbox-prev {
        left: 10px;
    }
    
    .wpmg-lightbox-next {
        right: 10px;
    }
    
    .wpmg-lightbox-caption h3 {
        font-size: 16px;
    }
    
    .wpmg-lightbox-caption p {
        font-size: 13px;
    }
    
    .wpmg-lightbox-stats {
        gap: 15px;
        font-size: 11px;
        flex-wrap: wrap;
    }
    
    .wpmg-lightbox-share {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .wpmg-lightbox-close {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 24px;
    }
}

@media (max-width: 576px) {
    .wpmg-lightbox-content {
        width: 95%;
    }
    
    .wpmg-lightbox-caption {
        padding: 15px;
    }
    
    .wpmg-lightbox-download {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .wpmg-lightbox-share a {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
}

/* ------------------------------------------------
   Animations
------------------------------------------------ */
@keyframes lightboxFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes lightboxZoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.wpmg-lightbox.fade-in {
    animation: lightboxFadeIn 0.3s ease;
}

.wpmg-lightbox-content.zoom-in {
    animation: lightboxZoomIn 0.3s ease;
}

/* ------------------------------------------------
   Accessibility
------------------------------------------------ */
.wpmg-lightbox-close:focus,
.wpmg-lightbox-nav:focus,
.wpmg-lightbox-download:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* ------------------------------------------------
   Print Styles
------------------------------------------------ */
@media print {
    .wpmg-lightbox {
        display: none !important;
    }
}