/**
 * Image Viewer Modal Styles
 * Full-screen modal for displaying keyword images with parallel chat
 */

.image-viewer-modal {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    height: auto;
    z-index: 9999;
    max-width: 90vw;
    max-height: 70vh;
}

.image-viewer-overlay {
    position: relative;
    width: 100%;
    height: 100%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.image-viewer-container {
    width: auto;
    max-width: 500px;
    height: auto;
    max-height: 400px;
    background: rgba(30, 30, 30, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
}

/* Left side - Image display */
.image-viewer-left {
    flex: 2;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.image-viewer-header {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    background: rgba(0, 0, 0, 0.1);
}

.image-viewer-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px;
    overflow: hidden;
}

.image-viewer-img {
    width: 100%;
    height: auto;
    max-height: 350px;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}



/* Right side - Parallel chat */
.image-viewer-right {
    flex: 1;
    min-width: 350px;
    max-width: 450px;
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

/* Image only mode - hide chat */
.image-viewer-modal.image-only .image-viewer-right {
    display: none;
}

.image-viewer-modal.image-only .image-viewer-left {
    flex: 1;
}



@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.image-viewer-chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.image-viewer-chat-history {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.image-viewer-chat-history::-webkit-scrollbar {
    width: 6px;
}

.image-viewer-chat-history::-webkit-scrollbar-track {
    background: transparent;
}

.image-viewer-chat-history::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.image-viewer-chat-history::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}



/* Responsive design for compact preview */
@media (max-width: 768px) {
    .image-viewer-modal {
        bottom: 10px;
        max-width: 95vw;
        max-height: 60vh;
    }
    
    .image-viewer-container {
        max-width: 90vw;
        max-height: 300px;
    }
    
    .image-viewer-img {
        max-height: 250px;
    }
    
    .image-viewer-content {
        padding: 8px;
    }
    
    .image-viewer-header {
        padding: 6px 10px;
    }
}
    
    .image-viewer-content {
        padding: 15px;
    }
    
    .image-viewer-header {
        padding: 15px 20px;
    }
    

}

@media (max-width: 480px) {
    .image-viewer-overlay {
        padding: 5px;
    }
    
    .image-viewer-container {
        border-radius: 10px;
    }
    

}

/* Animation for modal appearance */
.image-viewer-modal {
    opacity: 0;
    animation: fadeIn 0.3s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.image-viewer-container {
    transform: scale(0.95);
    animation: scaleIn 0.3s ease-out forwards;
}

@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Close button styling */
#close-image-viewer {
    background: rgba(220, 53, 69, 0.8) !important;
    border: 1px solid rgba(220, 53, 69, 0.9) !important;
    color: white !important;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

#close-image-viewer:hover {
    background: rgba(220, 53, 69, 1) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}