/* ==========================================
   CHAT IMAGE MESSAGES STYLES
   Styles für Bild-Nachrichten im Chat
   ========================================== */

/* Message Image Wrapper */
.message-image-wrapper {
    margin: 8px 0;
    border-radius: 12px;
    overflow: hidden;
    max-width: 100%;
}

/* Message Image */
.message-image {
    width: 100%;
    max-width: 300px;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    display: block;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.message-image:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

/* Message mit Bild - Anpassungen */
.message.own .message-image,
.message.other .message-image {
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Text unter Bild (falls vorhanden) */
.message.own .message-image-wrapper + .message-text,
.message.other .message-image-wrapper + .message-text {
    margin-top: 8px;
}

/* Bild-Upload Button im Input */
.chat-input-btn {
    transition: all 0.2s ease;
}

.chat-input-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.chat-input-btn:active {
    transform: scale(0.95);
}

/* Loading State für Bild-Upload */
.message-image[src=""] {
    min-height: 200px;
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Mobile Optimierungen */
@media (max-width: 767px) {
    .message-image {
        max-width: 100%;
        max-height: 300px;
    }
    
    .message-image-wrapper {
        margin: 6px 0;
    }
}

/* Landscape auf Mobile */
@media (max-width: 767px) and (orientation: landscape) {
    .message-image {
        max-height: 200px;
    }
}

/* High-DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .message-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}