/* 
   Image Lightbox Styles
   File: assets/css/image-lightbox.css
   
   This file creates styles for the image lightbox functionality
   allowing users to view enlarged images on the Vasudharini Research Foundation website.
*/

/* Container for lightbox-enabled images */
.lightbox-image {
    cursor: zoom-in;
    transition: transform 0.3s ease, filter 0.3s ease;
    position: relative;
}

.lightbox-image:hover {
    transform: scale(1.02);
}

/* Indicator that image can be enlarged */
.lightbox-image::after {
    content: '';
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6'/%3E%3Cpath d='M10 14L21 3'/%3E%3Cpath d='M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6'/%3E%3C/svg%3E");
    background-size: 14px;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.lightbox-image:hover::after {
    opacity: 1;
}

/* Lightbox overlay */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Lightbox content container */
.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lightbox-overlay.active .lightbox-content {
    transform: scale(1);
}

/* Lightbox image */
.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    display: block;
}

/* Lightbox caption */
.lightbox-caption {
    position: absolute;
    bottom: -40px;
    left: 0;
    width: 100%;
    padding: 10px;
    color: white;
    text-align: center;
    font-size: 14px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 0 0 4px 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Close button */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.lightbox-close:hover {
    background-color: rgba(255, 0, 0, 0.7);
    transform: rotate(90deg);
}

.lightbox-close::before,
.lightbox-close::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background-color: white;
}

.lightbox-close::before {
    transform: rotate(45deg);
}

.lightbox-close::after {
    transform: rotate(-45deg);
}

/* Navigation buttons */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.lightbox-nav:hover {
    background-color: rgba(0, 153, 204, 0.7);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-nav::before {
    content: '';
    display: block;
    width: 10px;
    height: 10px;
    border-top: 2px solid white;
    border-left: 2px solid white;
}

.lightbox-prev::before {
    transform: rotate(-45deg);
    margin-left: 5px;
}

.lightbox-next::before {
    transform: rotate(135deg);
    margin-right: 5px;
}

/* Zoom controls */
.lightbox-zoom {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 20px;
    padding: 5px;
}

.lightbox-zoom-button {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: white;
    font-size: 18px;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.lightbox-zoom-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.lightbox-zoom-in::before {
    content: '+';
}

.lightbox-zoom-out::before {
    content: '−';
}

.lightbox-zoom-reset::before {
    content: '⟲';
    font-size: 16px;
}

/* Loading indicator */
.lightbox-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top-color: white;
    animation: lightbox-spin 1s infinite linear;
    display: none;
}

.lightbox-loading.active {
    display: block;
}

@keyframes lightbox-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Counter for image gallery */
.lightbox-counter {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    font-size: 14px;
    background-color: rgba(0, 0, 0, 0.6);
    padding: 5px 10px;
    border-radius: 15px;
}

/* Download button */
.lightbox-download {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: rgba(0, 153, 204, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.lightbox-download:hover {
    background-color: rgba(0, 153, 204, 1);
    transform: scale(1.1);
}

.lightbox-download::before {
    content: '';
    width: 10px;
    height: 12px;
    border-left: 2px solid white;
    border-right: 2px solid white;
    border-top: 2px solid white;
    position: relative;
    top: -2px;
}

.lightbox-download::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    border-bottom: 2px solid white;
    border-right: 2px solid white;
    transform: rotate(45deg);
    top: 10px;
}

/* Animation for lightbox appearing */
@keyframes lightboxFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-animation {
    animation: lightboxFadeIn 0.3s ease;
}

/* Responsive styles */
@media (max-width: 768px) {
    .lightbox-nav {
        width: 40px;
        height: 40px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
    }
    
    .lightbox-caption {
        font-size: 12px;
        padding: 8px;
    }
    
    .lightbox-counter {
        top: 10px;
        left: 10px;
        font-size: 12px;
    }
}

/* Dark mode adjustments */
[data-theme="dark"] .lightbox-overlay {
    background-color: rgba(0, 0, 0, 0.95);
}

[data-theme="dark"] .lightbox-content img {
    border-color: rgba(0, 153, 204, 0.2);
}

[data-theme="dark"] .lightbox-nav:hover {
    background-color: rgba(51, 181, 229, 0.7);
}

[data-theme="dark"] .lightbox-download {
    background-color: rgba(51, 181, 229, 0.7);
}

[data-theme="dark"] .lightbox-download:hover {
    background-color: rgba(51, 181, 229, 1);
}