/* ==========================================================================
   Image Lightbox Component
   ========================================================================== */

/* Clickable image styling */
.lightbox-image {
    cursor: zoom-in;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lightbox-image:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.lightbox-image:focus {
    outline: 2px solid var(--theme-primary, #6366f1);
    outline-offset: 2px;
}

/* Modal content styling */
.lightbox-modal-content {
    background-color: var(--theme-bg-secondary, #1f2937);
    border: none;
    border-radius: 0.75rem;
    overflow: hidden;
}

.lightbox-modal-header {
    background-color: var(--theme-bg-tertiary, #111827);
    border-bottom: 1px solid var(--theme-border-color, rgba(255, 255, 255, 0.1));
    padding: 0.75rem 1rem;
}

.lightbox-modal-title {
    color: var(--theme-text-primary, #f9fafb);
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: calc(100% - 40px);
}

.lightbox-modal-body {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--theme-bg-primary, #030712);
    min-height: 200px;
    max-height: 80vh;
    overflow: hidden;
}

.lightbox-modal-image {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

.lightbox-modal-footer {
    background-color: var(--theme-bg-tertiary, #111827);
    border-top: 1px solid var(--theme-border-color, rgba(255, 255, 255, 0.1));
    padding: 0.75rem 1rem;
}

.lightbox-caption {
    color: var(--theme-text-secondary, #9ca3af);
    font-size: 0.875rem;
    text-align: center;
    width: 100%;
}

/* Light mode overrides */
[data-bs-theme="light"] .lightbox-modal-content {
    background-color: var(--theme-bg-secondary, #ffffff);
}

[data-bs-theme="light"] .lightbox-modal-header {
    background-color: var(--theme-bg-tertiary, #f3f4f6);
    border-bottom-color: var(--theme-border-color, #e5e7eb);
}

[data-bs-theme="light"] .lightbox-modal-header .btn-close {
    filter: none;
}

[data-bs-theme="light"] .lightbox-modal-title {
    color: var(--theme-text-primary, #111827);
}

[data-bs-theme="light"] .lightbox-modal-body {
    background-color: var(--theme-bg-primary, #f9fafb);
}

[data-bs-theme="light"] .lightbox-modal-footer {
    background-color: var(--theme-bg-tertiary, #f3f4f6);
    border-top-color: var(--theme-border-color, #e5e7eb);
}

[data-bs-theme="light"] .lightbox-caption {
    color: var(--theme-text-secondary, #6b7280);
}

[data-bs-theme="light"] .lightbox-image:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Modal backdrop enhancement */
#imageLightboxModal .modal-dialog {
    max-width: 90vw;
}

/* Animation */
#imageLightboxModal.fade .modal-dialog {
    transform: scale(0.95);
    transition: transform 0.2s ease-out;
}

#imageLightboxModal.show .modal-dialog {
    transform: scale(1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #imageLightboxModal .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    .lightbox-modal-body {
        max-height: 70vh;
    }

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

/* Accessibility - reduce motion */
@media (prefers-reduced-motion: reduce) {
    .lightbox-image {
        transition: none;
    }

    #imageLightboxModal.fade .modal-dialog {
        transition: none;
    }
}
