/**
 * Photo Lightbox Styles
 * Dark theme matching CHEFER template aesthetic
 */

/* Modal container */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 11000; /* ensure above any site navbar */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Backdrop */
.lightbox-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 1;
}

/* Container for content */
.lightbox-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    padding: 20px;
}

/* Close button */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

.lightbox-close:hover {
    background-color: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.8);
    transform: rotate(90deg);
}

/* Navigation buttons */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.lightbox-nav:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* Loading spinner */
.lightbox-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-loading .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3rem;
}

/* Content area */
.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Image */
.lightbox-image {
    max-width: 100%;
    max-height: calc(90vh - 150px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s ease;
}

/* Metadata overlay */
.lightbox-metadata {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.7));
    color: #fff;
    padding: 20px 30px;
    border-radius: 8px;
    margin-top: 10px;
    max-width: 800px;
    width: 100%;
    text-align: center; /* center text within metadata */
    margin-left: auto;
    margin-right: auto;
}

.lightbox-title {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: #ffc107;
    font-family: 'Playfair Display', serif;
}

.lightbox-info {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 10px;
    justify-content: center; /* center the info chips */
}

.lightbox-info-item {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    display: none; /* Hidden by default, shown via JS when data exists */
}

.lightbox-info-item i {
    color: #ffc107;
    margin-right: 5px;
}

.lightbox-counter {
    text-align: center;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 10px;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .lightbox-container {
        padding: 10px;
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 22px;
    }

    .lightbox-nav {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-image {
        max-height: calc(90vh - 200px);
    }

    .lightbox-metadata {
        padding: 15px 20px;
        margin-top: 15px;
    }

    .lightbox-title {
        font-size: 20px;
        margin-bottom: 10px;
    }

    .lightbox-info {
        gap: 15px;
        font-size: 13px;
    }

    /* Stack metadata items on very small screens */
    @media (max-width: 480px) {
        .lightbox-info {
            flex-direction: column;
            gap: 8px;
        }
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.lightbox-modal {
    animation: fadeIn 0.3s ease;
}

/* Touch feedback for mobile */
@media (hover: none) {
    .lightbox-nav:active,
    .lightbox-close:active {
        transform: scale(0.95);
    }
}

/* Accessibility - focus styles */
.lightbox-close:focus,
.lightbox-nav:focus {
    outline: 2px solid #ffc107;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .lightbox-backdrop {
        background-color: rgba(0, 0, 0, 1);
    }

    .lightbox-close,
    .lightbox-nav {
        border-color: #fff;
        background-color: rgba(255, 255, 255, 0.3);
    }
}
