/* Image Upload Styles */
.image-upload-container {
    margin-bottom: 1rem;
}

.image-upload-box {
    border: 2px dashed #cbd5e1;
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #f8fafc;
}

.image-upload-box:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.image-upload-box.dragover {
    border-color: #2563eb;
    background: #dbeafe;
}

.image-upload-input {
    display: none;
}

.image-upload-icon {
    font-size: 2.5rem;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

.image-upload-text {
    font-size: 0.875rem;
    color: #475569;
}

.image-upload-hint {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

.image-preview-container {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.image-preview-item {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 2px solid #e2e8f0;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-remove {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.75rem;
}

.image-preview-remove:hover {
    background: rgba(220, 38, 38, 1);
}

.image-upload-progress {
    margin-top: 0.5rem;
    background: #e2e8f0;
    border-radius: 0.25rem;
    height: 4px;
    overflow: hidden;
    display: none;
}

.image-upload-progress.active {
    display: block;
}

.image-upload-progress-bar {
    height: 100%;
    background: #3b82f6;
    transition: width 0.3s ease;
}

/* Message Images in Chat */
.message-images {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.message-image-thumb {
    display: block;
    width: 100px;
    height: 100px;
    border-radius: 0.375rem;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s;
}

.message-image-thumb:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.message-image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Live Chat Specific Styles */
#live-chat-image-upload .image-upload-box,
#chat-initial-image-upload .image-upload-box {
    padding: 0.75rem;
}

#live-chat-image-upload .image-upload-icon,
#chat-initial-image-upload .image-upload-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

#live-chat-image-upload .image-upload-text,
#chat-initial-image-upload .image-upload-text {
    font-size: 0.75rem;
}

#live-chat-image-upload .image-upload-hint,
#chat-initial-image-upload .image-upload-hint {
    font-size: 0.65rem;
}

#live-chat-image-upload .image-preview-item,
#chat-initial-image-upload .image-preview-item {
    width: 80px;
    height: 80px;
}

/* Compact Mode - Image Upload Button */
.image-upload-container.compact {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.image-upload-compact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: #64748b;
    color: white;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    padding: 0;
    margin: 0;
}

.image-upload-compact-btn i {
    font-size: 1.4rem;
    display: block;
}

.image-upload-compact-btn:hover {
    background: #475569;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.image-upload-compact-btn:active {
    transform: translateY(0);
}

.image-upload-progress.compact {
    position: absolute;
    bottom: 100%;
    right: 0;
    width: 200px;
    z-index: 1001;
    background: white;
    padding: 0.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 0.5rem;
}

.image-preview-container.compact {
    position: absolute;
    bottom: 100%;
    right: 0;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
    z-index: 1001;
    max-width: 250px;
    margin-bottom: 0.5rem;
}

.image-preview-container.compact .image-preview-item {
    width: 60px;
    height: 60px;
}

/* Special styling for chat windows - position relative to parent */
#chat-initial-image-upload,
#live-chat-image-upload {
    position: relative;
}

/* Chat buttons - match style and size of chat buttons */
#chat-initial-image-upload .image-upload-compact-btn,
#live-chat-image-upload .image-upload-compact-btn {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    align-self: center;
    margin-top: 3px;
}

#chat-initial-image-upload .image-upload-compact-btn:hover,
#live-chat-image-upload .image-upload-compact-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

#chat-initial-image-upload .image-upload-compact-btn i,
#live-chat-image-upload .image-upload-compact-btn i {
    font-size: 1.1rem;
    display: block;
}

/* For tekniker backend - keep inline */
#tekniker-reply-image-upload,
#note-image-upload {
    position: relative;
}

