/* ===================================
   GALLERY LIGHTBOX STYLES
   Dedicated file for all lightbox functionality
   =================================== */

/* Basic Lightbox Modal - Generic gallery lightbox */
.lightbox-overlay {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgb(0 0 0 / 90%);
    backdrop-filter: blur(5px);
}

.lightbox-container {
    position: relative;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff !important;
    font-size: 3rem;
    font-weight: 300;
    cursor: pointer;
    z-index: 10001;
    line-height: 1;
    transition: opacity 0.2s ease;
    background: none !important;
    border: none !important;
    display: block !important;
    opacity: 1;
    text-shadow: 0 0 5px rgb(0 0 0 / 50%);
}

.lightbox-close:hover,
.lightbox-close:focus {
    opacity: 0.7;
    outline: none;
}

#lightbox-image {
    max-width: 90%;
    max-height: 80%;
    object-fit: contain;
    border-radius: 8px;
}

/* Lightbox Video Container */
#lightbox-video {
    max-width: 90%;
    max-height: 80%;
    display: none;
}

.lightbox-video-container iframe,
.lightbox-video-container video {
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgb(255 255 255 / 10%);
    color: white;
    border: none;
    font-size: 2rem;
    padding: 15px 20px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    z-index: 10001;
}

.lightbox-nav:hover {
    background: rgb(255 255 255 / 20%);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgb(0 0 0 / 70%);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
}

/* Single Property Lightbox - Enhanced version with sp- prefixes */
.sp-lightbox-overlay {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgb(0 0 0 / 90%);
}

.sp-lightbox-container {
    position: relative;
    width: 90%;
    max-width: 1000px;
    height: 90%;
    margin: 2.5% auto;
    background-color: #fff !important;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sp-lightbox-header {
    padding: 20px;
    background-color: #f8f9fa !important;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sp-lightbox-header h3 {
    margin: 0;
    color: #333 !important;
    font-size: 1.5rem;
}

.sp-lightbox-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #666 !important;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sp-lightbox-close:hover {
    color: #000 !important;
}

.property-lightbox-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.property-lightbox-image-container {
    flex: 2;
    position: relative;
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.property-lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.property-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgb(255 255 255 / 80%);
    border: none;
    font-size: 1.5rem;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 5px;
    color: #333 !important;
}

.property-lightbox-nav:hover {
    background-color: rgb(255 255 255 / 100%);
}

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

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

.property-lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgb(255 255 255 / 90%);
    padding: 5px 15px;
    border-radius: 15px;
    color: #333 !important;
    font-size: 0.9rem;
}

.property-lightbox-info {
    flex: 1;
    padding: 20px;
    background-color: #fff !important;
    overflow-y: auto;
    border-left: 1px solid #dee2e6;
}

.property-lightbox-price {
    font-size: 2rem;
    font-weight: bold;
    color: #28a745 !important;
    margin-bottom: 15px;
}

.property-lightbox-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.property-lightbox-stat {
    background-color: #f8f9fa !important;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
}

.property-lightbox-stat-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333 !important;
}

.property-lightbox-stat-label {
    font-size: 0.8rem;
    color: #666 !important;
    text-transform: uppercase;
}

.property-lightbox-mls {
    background-color: #e9ecef !important;
    padding: 15px;
    border-radius: 5px;
    margin-top: 15px;
}

.property-lightbox-mls strong {
    color: #333 !important;
}

/* Responsive Design for Lightbox */
@media (width <= 768px) {
    .lightbox-nav {
        font-size: 1.5rem;
        padding: 10px 15px;
    }

    .lightbox-close,
    .sp-lightbox-close {
        font-size: 2rem;
        top: 15px;
        right: 20px;
    }

    .property-lightbox-body {
        flex-direction: column;
    }

    .property-lightbox-image-container {
        flex: 1;
    }

    .property-lightbox-info {
        flex: 1;
        border-left: none;
        border-top: 1px solid #dee2e6;
    }
}

/* Single Property Enhanced Lightbox Navigation - Enhanced sp- prefixed version */
.sp-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgb(0 0 0 / 70%);
    color: white;
    border: 2px solid rgb(255 255 255 / 30%);
    font-size: 2.5rem;
    padding: 15px 20px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 10001;
    font-weight: bold;
    line-height: 1;
    min-width: 60px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgb(0 0 0 / 30%);
}

.sp-lightbox-nav:hover {
    background: rgb(255 255 255 / 90%);
    color: #333;
    border-color: rgb(255 255 255 / 80%);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgb(0 0 0 / 40%);
}

.sp-lightbox-nav:active {
    transform: translateY(-50%) scale(0.95);
}

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

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

.sp-lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 3rem;
    font-weight: 300;
    cursor: pointer;
    z-index: 10001;
    line-height: 1;
    background: rgb(0 0 0 / 70%);
    border: 2px solid rgb(255 255 255 / 30%);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgb(0 0 0 / 30%);
}

.sp-lightbox-close:hover {
    background: rgb(255 255 255 / 90%);
    color: #333;
    border-color: rgb(255 255 255 / 80%);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgb(0 0 0 / 40%);
}

.sp-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgb(0 0 0 / 95%);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    backdrop-filter: blur(5px);
}

.sp-lightbox-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sp-lightbox-overlay.active {
    display: flex;
}

.sp-lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgb(0 0 0 / 70%);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
}

/* Accessibility improvements */
.lightbox-close:focus,
.lightbox-nav:focus,
.sp-lightbox-close:focus,
.sp-lightbox-nav:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}
