/**
 * ImmoManager Gallery Modal Styles
 * White Theme / Windowed Mode
 */

/* Overlay */
.immo-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(5px);
    padding: 20px;
    box-sizing: border-box;
}

.immo-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Window (White Box) */
.immo-modal-window {
    width: 100%;
    max-width: 1200px;
    height: 85vh;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}

/* Maximized State */
.immo-modal-window.is-maximized {
    max-width: 100%;
    height: 100%;
    border-radius: 0;
}

/* Header */
.immo-modal-header {
    height: 60px;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    background-color: #fff;
    flex-shrink: 0;
}

.immo-modal-counter {
    color: #333;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
}

.immo-modal-actions {
    display: flex;
    gap: 10px;
}

.immo-modal-zoom,
.immo-modal-close {
    background: transparent;
    border: none;
    color: #555;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.immo-modal-zoom:hover,
.immo-modal-close:hover {
    background-color: #f5f5f5;
    color: #000;
}

/* Body (Image Area) */
.immo-modal-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background-color: #fff; /* White background for image area */
    position: relative;
    overflow: hidden;
}

/* Navigation Buttons */
.immo-modal-prev,
.immo-modal-next {
    background: #fff;
    border: 1px solid #eee;
    color: #333;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.immo-modal-prev:hover,
.immo-modal-next:hover {
    background: #f8f8f8;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.immo-modal-image-wrapper {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0 20px;
}

.immo-modal-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.immo-modal-image.fade-in {
    opacity: 1;
}

/* Loading Spinner */
.immo-modal-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ccc;
    z-index: -1;
}

.immo-modal-loading .material-symbols-outlined {
    font-size: 40px;
    animation: spin 1.0s linear infinite;
}

/* Footer (Thumbnails) */
.immo-modal-footer {
    height: 90px; /* Fixed height for footer */
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
    padding: 10px 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.immo-modal-thumbnails-inner {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 20px;
    width: 100%;
    height: 100%;
    align-items: center;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.immo-modal-thumbnails-inner::-webkit-scrollbar {
    display: none;
}

.immo-modal-thumb-item {
    background: none;
    border: 2px solid transparent;
    padding: 0;
    cursor: pointer;
    flex: 0 0 auto;
    width: 90px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.immo-modal-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.immo-modal-thumb-item:hover {
    opacity: 0.9;
}

.immo-modal-thumb-item.active {
    opacity: 1;
    border-color: #333; /* Dark border for active state in light theme */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .immo-modal-window {
        height: 100%;
        border-radius: 0; /* Full screen on mobile */
    }
    
    .immo-modal-overlay {
        padding: 0;
    }
    
    .immo-modal-prev,
    .immo-modal-next {
        width: 36px;
        height: 36px;
        background: rgba(255, 255, 255, 0.8); /* Semi-transparent on mobile */
        position: absolute;
    }
    
    .immo-modal-prev { left: 10px; }
    .immo-modal-next { right: 10px; }
    
    .immo-modal-image-wrapper {
        padding: 0;
    }
    
    .immo-modal-actions .immo-modal-zoom {
        display: none; /* Hide zoom button on mobile usually, or keep if desired */
    }
}
