/* ===== ARTICLES LIGHTBOX STYLES ===== */

/* Modal Overlay */
.articles-lightbox-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10060;
    cursor: pointer;
    overflow: hidden;
}

.articles-lightbox-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-in-out;
}

/* Modal Content Container */
.articles-lightbox-content {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: default;
    user-select: none;
}

/* Close Button */
.articles-lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    z-index: 10061;
    padding: 10px;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.articles-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

/* Main Image Container */
.articles-lightbox-image-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: 80vh;
}

.articles-lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.articles-lightbox-image.loading {
    opacity: 0;
}

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

/* Loading Spinner */
.articles-lightbox-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
}

.articles-lightbox-loading.show {
    display: block;
}

.articles-lightbox-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Navigation Controls */
.articles-lightbox-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 10061;
}

.articles-lightbox-prev,
.articles-lightbox-next {
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 15px 20px;
    border-radius: 50%;
    transition: all 0.3s ease;
    pointer-events: auto;
    backdrop-filter: blur(10px);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.articles-lightbox-prev {
    margin-left: -80px;
}

.articles-lightbox-next {
    margin-right: -80px;
}

.articles-lightbox-prev:hover,
.articles-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.articles-lightbox-prev:disabled,
.articles-lightbox-next:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.articles-lightbox-prev:disabled:hover,
.articles-lightbox-next:disabled:hover {
    background: rgba(0, 0, 0, 0.5);
    transform: none;
}

/* Image Counter */
.articles-lightbox-counter {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

/* Image Info */
.articles-lightbox-info {
    position: absolute;
    bottom: -60px;
    left: 0;
    right: 0;
    color: white;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.articles-lightbox-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.articles-lightbox-description {
    font-size: 0.9rem;
    opacity: 0.8;
    line-height: 1.4;
}

/* Thumbnail Strip */
.articles-lightbox-thumbnails {
    position: absolute;
    bottom: -120px;
    left: 0;
    right: 0;
    height: 80px;
    overflow-x: auto;
    overflow-y: hidden;
}

.articles-lightbox-thumbnails.show {
    display: block;
}

.thumbnails-container {
    display: flex;
    gap: 10px;
    padding: 10px;
    justify-content: center;
    align-items: center;
    min-width: 100%;
}

.thumbnail-item {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.thumbnail-item.active {
    border-color: #007bff;
    transform: scale(1.1);
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-item:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Touch Area for Mobile */
.articles-lightbox-touch-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9998;
}

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

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

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .articles-lightbox-content {
        max-width: 100vw;
        max-height: 100vh;
        padding: 20px;
    }

    .articles-lightbox-image {
        max-height: 70vh;
    }

    .articles-lightbox-close {
        top: 20px;
        right: 20px;
        position: fixed;
    }

    .articles-lightbox-counter {
        top: 20px;
        left: 20px;
        transform: none;
        position: fixed;
    }

    .articles-lightbox-prev,
    .articles-lightbox-next {
        margin: 0;
        position: absolute;
    }

    .articles-lightbox-prev {
        left: 20px;
    }

    .articles-lightbox-next {
        right: 20px;
    }

    .articles-lightbox-info {
        bottom: 20px;
        padding: 0 20px;
        position: fixed;
    }

    .articles-lightbox-thumbnails {
        bottom: 100px;
    }
}

@media (max-width: 480px) {
    .articles-lightbox-prev,
    .articles-lightbox-next {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .articles-lightbox-close {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .articles-lightbox-counter {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
}

/* Accessibility */
.articles-lightbox-modal:focus-within {
    outline: none;
}

.articles-lightbox-prev:focus,
.articles-lightbox-next:focus,
.articles-lightbox-close:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .articles-lightbox-modal {
        background: rgb(0, 0, 0);
    }

    .articles-lightbox-prev,
    .articles-lightbox-next,
    .articles-lightbox-close {
        background: rgb(255, 255, 255);
        color: rgb(0, 0, 0);
    }

    .articles-lightbox-counter {
        background: rgb(255, 255, 255);
        color: rgb(0, 0, 0);
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .articles-lightbox-modal.show {
        animation: none;
    }

    .articles-lightbox-image,
    .articles-lightbox-prev,
    .articles-lightbox-next,
    .articles-lightbox-close,
    .thumbnail-item {
        transition: none;
    }

    .articles-lightbox-loading .spinner {
        animation: none;
        border: 4px solid white;
        border-top: 4px solid transparent;
    }
}
