/* Image Upload Styles */

/* Drag and drop effects for prompt wrapper */
.prompt-wrapper.drag-over {
    border-color: #667eea !important;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2) !important;
    background: rgba(102, 126, 234, 0.05) !important;
}

/* Textarea container with camera icon */
.textarea-container {
    position: relative;
    display: flex;
    align-items: flex-end;
}

.textarea-container textarea {
    flex: 1;
    padding-bottom: 35px !important; /* Make room for camera icon at bottom */
}

/* Image previews inside input field */
.image-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 0.75rem 0.5rem 0.75rem;
    max-height: 120px;
    overflow-y: auto;
}

.image-previews:empty {
    display: none;
    padding: 0;
}

.image-preview {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    background: #2a2a40;
    border: 1px solid #3d3d54;
    transition: all 0.3s ease;
}

.image-preview:hover {
    border-color: #667eea;
}

.image-preview.loading {
    border-color: #f39c12;
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
}

.preview-filename {
    display: none; /* Hide filename to save space */
}

.preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #e74c3c;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 10px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.5);
    transition: all 0.2s ease;
}

.preview-remove:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.preview-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #f39c12;
    font-size: 0.9rem;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #3d3d54;
    border-top: 2px solid #f39c12;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 0.5rem;
}

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

/* Camera icon positioned in bottom-left of textarea */
.image-upload-btn {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    opacity: 0.6;
    z-index: 10;
}

.image-upload-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    opacity: 1;
}

.image-upload-btn svg {
    width: 16px;
    height: 16px;
    color: #667eea;
}

.prompt-wrapper {
    background: #1a1a2e;
    border-radius: 8px;
    border: 1px solid #3d3d54;
    transition: all 0.3s ease;
}

.prompt-wrapper:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.prompt-wrapper textarea {
    background: none;
    border: none;
    border-radius: 0 0 8px 8px;
    outline: none;
}

/* Submit button disabled state for uploading */
.submit-btn.uploading {
    background: #666;
    cursor: not-allowed;
}

.submit-btn.uploading:hover {
    background: #666;
    transform: none;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .image-preview {
        width: 100px;
        height: 100px;
    }
    
    .image-previews {
        gap: 0.5rem;
        padding: 0 0.5rem 0.5rem 0.5rem;
    }
}