/* ===================================
   Lightbox Image Viewer Styles
   تنسيقات عارض الصور المكبرة
   =================================== */

/* Lightbox Container */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

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

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

/* Close Button */
.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    color: white;
    font-size: 45px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    line-height: 1;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Navigation Arrows */
.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    user-select: none;
}

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

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

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

/* Caption */
.lightbox-caption {
    color: white;
    text-align: center;
    padding: 20px;
    font-size: 18px;
    font-weight: 500;
    max-width: 800px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Counter */
.lightbox-counter {
    position: absolute;
    top: -50px;
    left: 0;
    color: white;
    font-size: 16px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .lightbox-content {
        max-width: 95%;
        max-height: 95%;
    }

    .lightbox-image {
        max-height: 75vh;
    }

    .lightbox-close {
        top: -40px;
        font-size: 35px;
        width: 40px;
        height: 40px;
    }

    .lightbox-prev,
    .lightbox-next {
        font-size: 30px;
        width: 50px;
        height: 50px;
        padding: 15px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

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

    .lightbox-counter {
        top: 10px;
        left: 10px;
        font-size: 14px;
        padding: 8px 15px;
    }
}

@media (max-width: 480px) {
    .lightbox-image {
        max-height: 70vh;
    }

    .lightbox-prev,
    .lightbox-next {
        font-size: 25px;
        width: 45px;
        height: 45px;
        padding: 12px;
        opacity: 0.7;
    }

    .lightbox-prev:hover,
    .lightbox-next:hover {
        opacity: 1;
    }

    .lightbox-caption {
        font-size: 14px;
        padding: 10px;
    }
}

/* Loading State */
.lightbox-image[src=""] {
    display: none;
}

/* Cursor hint for clickable images */
.timeline-image,
.cert-image,
.article-view-content img,
.article-view-featured-image {
    cursor: zoom-in;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-image:hover,
.cert-image:hover,
.article-view-content img:hover,
.article-view-featured-image:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Prevent text selection during navigation */
.lightbox.active {
    user-select: none;
}

/* Add zoom icon overlay hint */
.timeline-item,
.cert-item {
    position: relative;
}

.timeline-item::after,
.cert-item::after {
    content: '\f00e'; /* Font Awesome zoom icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(46, 125, 140, 0.9);
    color: white;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.timeline-item:hover::after,
.cert-item:hover::after {
    display: flex;
    animation: zoomPulse 1.5s infinite;
}

@keyframes zoomPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* RTL Support */
html[dir="rtl"] .lightbox-prev {
    left: auto;
    right: -80px;
}

html[dir="rtl"] .lightbox-next {
    right: auto;
    left: -80px;
}

html[dir="rtl"] .lightbox-counter {
    left: auto;
    right: 0;
}

@media (max-width: 768px) {
    html[dir="rtl"] .lightbox-prev {
        right: 10px;
    }

    html[dir="rtl"] .lightbox-next {
        left: 10px;
    }

    html[dir="rtl"] .lightbox-counter {
        right: 10px;
    }
}

/* Print: Hide lightbox */
@media print {
    .lightbox {
        display: none !important;
    }
}

/* Accessibility */
.lightbox-close:focus,
.lightbox-prev:focus,
.lightbox-next:focus {
    outline: 2px solid white;
    outline-offset: 4px;
}

/* Smooth transitions */
.lightbox * {
    transition: all 0.3s ease;
}
