/**
 * WLIQ Chatbot - Image Upload Styles
 * 
 * Styles for image upload and preview functionality
 * 
 * @package wliq-chatbot
 */

/* Image Upload Preview Styles */
.chatbot-image-message {
    padding: 10px !important;
    margin: 10px 15px !important;
    background: transparent !important;
}

.image-preview-container {
    position: relative;
    display: inline-block;
    max-width: 300px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.chatbot-uploaded-image {
    display: block;
    width: 100%;
    height: auto;
    max-width: 300px;
    max-height: 300px;
    object-fit: contain;
    background: #f5f5f5;
}

.image-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.image-name {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-size {
    opacity: 0.8;
    font-size: 11px;
}

/* Hover effect */
.image-preview-container:hover {
    cursor: zoom-in;
    transform: scale(1.02);
    transition: transform 0.2s ease;
}

/* Dark theme compatibility */
#chatbot-chatgpt.dark-theme .chatbot-uploaded-image {
    background: #2d3748;
}

/* User message with image */
.user-message .chatbot-uploaded-image {
    margin: 5px 0;
}

/* Bot response about image */
.bot-message.image-response {
    font-style: italic;
    opacity: 0.9;
}

/* Upload button active state */
#chatbot-chatgpt-upload-file.uploading {
    opacity: 0.6;
    pointer-events: none;
}

/* Progress indicator */
.upload-progress {
    position: absolute;
    bottom: 40px;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.upload-progress-bar {
    height: 100%;
    background: #4299e1;
    width: 0;
    transition: width 0.3s ease;
}

/* Lightbox for full image view */
.chatbot-image-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    animation: fadeIn 0.3s ease;
}

.chatbot-image-fullscreen img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Close button for lightbox */
.chatbot-image-fullscreen::after {
    content: "✕";
    position: absolute;
    top: 20px;
    right: 40px;
    color: white;
    font-size: 40px;
    font-weight: 300;
    cursor: pointer;
}

/* Multiple image gallery */
.chatbot-image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
}

.chatbot-image-gallery .image-preview-container {
    max-width: 150px;
}

.chatbot-image-gallery .chatbot-uploaded-image {
    max-width: 150px;
    max-height: 150px;
}

/* Image loading state */
.image-loading {
    position: relative;
    min-height: 100px;
    background: #f0f0f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-loading::after {
    content: "Loading...";
    color: #666;
    font-size: 14px;
}

/* Image error state */
.image-error {
    background: #fee;
    color: #c33;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .chatbot-uploaded-image,
    .image-preview-container {
        max-width: 200px;
    }
    
    .chatbot-image-gallery .image-preview-container,
    .chatbot-image-gallery .chatbot-uploaded-image {
        max-width: 100px;
        max-height: 100px;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* File type icons */
.file-type-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 5px;
    vertical-align: middle;
}

/* Vision indicator */
.vision-processing {
    display: inline-block;
    margin-left: 10px;
    font-size: 12px;
    color: #4299e1;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}
