/**
 * TP Simple Lightbox CSS
 * Clean and modern lightbox styling
 */

.tp-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tp-lightbox.tp-lightbox-active {
    opacity: 1;
}

.tp-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.tp-lightbox-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tp-lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    text-align: center;
}

.tp-lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    opacity: 1;
    transition: opacity 0.3s ease;
}

.tp-lightbox-caption {
    color: #fff;
    font-size: 16px;
    margin-top: 15px;
    padding: 0 20px;
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 4px;
    display: inline-block;
    max-width: 100%;
    word-wrap: break-word;
}

.tp-lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: none;
    border: none;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.tp-lightbox-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.tp-lightbox-prev,
.tp-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #fff;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
    z-index: 10001;
}

.tp-lightbox-prev {
    left: 30px;
}

.tp-lightbox-next {
    right: 30px;
}

.tp-lightbox-prev:hover,
.tp-lightbox-next:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.tp-lightbox-counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 10001;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .tp-lightbox-close {
        top: 10px;
        right: 15px;
        font-size: 30px;
        width: 40px;
        height: 40px;
    }
    
    .tp-lightbox-prev,
    .tp-lightbox-next {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .tp-lightbox-prev {
        left: 15px;
    }
    
    .tp-lightbox-next {
        right: 15px;
    }
    
    .tp-lightbox-content {
        max-width: 95%;
        max-height: 95%;
    }
    
    .tp-lightbox-image {
        max-height: 70vh;
    }
    
    .tp-lightbox-caption {
        font-size: 14px;
        margin-top: 10px;
        padding: 8px 15px;
    }
    
    .tp-lightbox-counter {
        bottom: 20px;
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* Animation for image loading */
.tp-lightbox-image {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tp-lightbox-image.loaded {
    opacity: 1;
}

/* Hide navigation when only one image */
.tp-lightbox-prev[style*="display: none"],
.tp-lightbox-next[style*="display: none"] {
    display: none !important;
}

/* Accessibility improvements */
.tp-lightbox-close:focus,
.tp-lightbox-prev:focus,
.tp-lightbox-next:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Smooth transitions */
.tp-lightbox * {
    box-sizing: border-box;
}

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