/* ---------------------------------------------------------
   UNIVERSAL CHAT CONTENT LAYER
   (Images, embeds, links, system messages)
--------------------------------------------------------- */

/* ---------------------------------------------------------
   SYSTEM MESSAGES (unified)
--------------------------------------------------------- */
.hoh-system-message {
    text-align: center;
    font-size: 13px;
    opacity: 0.7;
    background: transparent;
    border: none;
    padding: 6px 0;
    color: var(--hoh-text-muted);
}


/* ---------------------------------------------------------
   LINKS (inherit room theme colors)
--------------------------------------------------------- */
.hoh-message-body a {
    font-weight: 600;
    text-decoration: underline;
    word-break: break-word;
    transition: opacity 0.2s ease;
    color: var(--hoh-purple);
}

.hoh-message-body a:hover {
    opacity: 0.8;
}


/* ---------------------------------------------------------
   MESSAGE BUBBLES — Sanctuary‑Soft Token Edition
--------------------------------------------------------- */
.hoh-message {
    background: var(--hoh-white-bg);
    border-radius: var(--hoh-radius-lg);
    padding: var(--hoh-space-sm);
    margin: var(--hoh-space-xs) 0;
    box-shadow: var(--hoh-shadow-soft);
    border: 1px solid var(--hoh-border-soft);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hoh-message-meta {
    font-size: 13px;
    opacity: 0.65;
    font-weight: 500;
    color: var(--hoh-text-muted);
    letter-spacing: 0.2px;
}

.hoh-message-body {
    font-size: 15px;
    line-height: 1.55;
    color: var(--hoh-text-main);
    white-space: pre-wrap;
    word-break: break-word;
    font-family: var(--hoh-font-sans);
}


/* ---------------------------------------------------------
   MESSAGE CONTROLS (edit/delete)
--------------------------------------------------------- */
.hoh-message-controls {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.hoh-message-controls button {
    background: transparent;
    border: none;
    font-size: 13px;
    padding: 4px 6px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease, background 0.2s ease;
    border-radius: var(--hoh-radius-sm);
    color: var(--hoh-text-muted);
}

.hoh-message-controls button:hover {
    opacity: 1;
    background: var(--hoh-lavender-hover);
}

.hoh-message-controls button[data-action="delete"] {
    color: var(--hoh-heart-red);
}


/* ---------------------------------------------------------
   IMAGES (unified renderer)
--------------------------------------------------------- */
.chat-image {
    width: 100%;
    max-width: 480px;
    border-radius: var(--hoh-radius-lg);
    overflow: hidden;
    margin-top: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.25s ease;
    box-shadow: var(--hoh-shadow-soft);
}

.chat-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.chat-image:hover {
    transform: translateY(-2px);
    box-shadow: var(--hoh-shadow-deep);
}


/* ---------------------------------------------------------
   EMBED PREVIEW (thumbnail-first)
--------------------------------------------------------- */
.embed-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-size: cover;
    background-position: center;
    border-radius: var(--hoh-radius-lg);
    overflow: hidden;
    margin-top: 8px;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: var(--hoh-shadow-soft);
}

.embed-preview:hover {
    transform: translateY(-2px);
    box-shadow: var(--hoh-shadow-deep);
}

.embed-play-btn {
    position: absolute;
    bottom: 12px;
    left: 12px;
    width: 46px;
    height: 46px;
    background: var(--hoh-purple-whisper);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.embed-play-btn:hover {
    background: var(--hoh-lavender-hover);
    transform: scale(1.05);
}


/* ---------------------------------------------------------
   EMBED PLAYER (after click)
--------------------------------------------------------- */
.embed-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--hoh-radius-lg);
    overflow: hidden;
    margin-top: 8px;
    background: #000;
}

.embed-container iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}


/* ---------------------------------------------------------
   FULLSCREEN IMAGE VIEWER
--------------------------------------------------------- */
.image-viewer {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    padding: 20px;
    backdrop-filter: blur(4px);
    transition: opacity 0.25s ease;
}

.image-viewer.hidden {
    opacity: 0;
    pointer-events: none;
}

.image-viewer img {
    max-width: 100%;
    max-height: 100%;
    border-radius: var(--hoh-radius-lg);
    box-shadow: var(--hoh-shadow-deep);
    object-fit: contain;
}


/* ---------------------------------------------------------
   RESPONSIVE TWEAKS
--------------------------------------------------------- */
@media (max-width: 900px) {
    .chat-image {
        max-width: 100%;
    }

    .embed-play-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}
