/**
 * MyChooz Lightbox Styles
 *
 * @package MyChooz_Core
 * @since 0.0.21
 */

/* Lightbox Container */
.mychooz-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
}

.mychooz-lightbox.active {
    display: block;
}

/* Overlay */
.mychooz-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mychooz-lightbox.active .mychooz-lightbox-overlay {
    opacity: 1;
}

/* Container */
.mychooz-lightbox-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

/* Content */
.mychooz-lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Image */
.mychooz-lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    display: block;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.3s ease;
}

.mychooz-lightbox.active .mychooz-lightbox-image {
    opacity: 1;
    transform: scale(1);
}

/* Caption */
.mychooz-lightbox-caption {
    color: #fff;
    text-align: center;
    padding: 15px 20px;
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.5;
    max-width: 600px;
    display: none;
}

/* Navigation Buttons */
.mychooz-lightbox-close,
.mychooz-lightbox-prev,
.mychooz-lightbox-next {
    position: absolute;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.mychooz-lightbox-close:hover,
.mychooz-lightbox-prev:hover,
.mychooz-lightbox-next:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.mychooz-lightbox-close {
    top: 20px;
    right: 20px;
}

.mychooz-lightbox-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.mychooz-lightbox-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.mychooz-lightbox-prev:hover,
.mychooz-lightbox-next:hover {
    transform: translateY(-50%) scale(1.1);
}

/* SVG Icons */
.mychooz-lightbox button svg {
    width: 24px;
    height: 24px;
    display: block;
}

/* Counter */
.mychooz-lightbox-counter {
    position: absolute;
    top: 20px;
    left: 20px;
    color: #fff;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 12px;
    border-radius: 4px;
}

/* Loader */
.mychooz-lightbox-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
}

.mychooz-lightbox-loader.active {
    display: block;
}

.mychooz-lightbox-loader .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: mychooz-spin 0.8s linear infinite;
}

@keyframes mychooz-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .mychooz-lightbox-container {
        padding: 10px;
    }

    .mychooz-lightbox-close {
        top: 10px;
        right: 10px;
    }

    .mychooz-lightbox-prev {
        left: 10px;
    }

    .mychooz-lightbox-next {
        right: 10px;
    }

    .mychooz-lightbox-counter {
        top: 10px;
        left: 10px;
        font-size: 12px;
        padding: 6px 10px;
    }

    .mychooz-lightbox-caption {
        font-size: 13px;
        padding: 10px 15px;
    }
}

/* Animation Classes */
.mychooz-lightbox.fade-in .mychooz-lightbox-overlay {
    animation: fadeIn 0.3s ease;
}

.mychooz-lightbox.fade-out .mychooz-lightbox-overlay {
    animation: fadeOut 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Prevent body scroll when lightbox is open */
body.mychooz-lightbox-open {
    overflow: hidden;
}

/* Gallery Group Indication */
a[data-mychooz-lightbox] {
    cursor: zoom-in;
}

a[data-mychooz-lightbox] img {
    transition: transform 0.2s ease;
}

a[data-mychooz-lightbox]:hover img {
    transform: scale(1.05);
}