/* ==========================================================================
   DCMS-Social Forum - Стили для картинок в сообщениях и буфера обмена
   (Не затрагивает оригинальный дизайн и стили темы форума)
   ========================================================================== */

/* 1. Блок и ссылки изображения в сообщениях форума */
.forum-img-wrapper {
    display: block;
    margin: 6px 0;
    max-width: 100%;
    clear: both;
}

.forum-img-link {
    display: inline-block;
    max-width: 100%;
    text-decoration: none;
    border: none !important;
}

.forum-inline-img {
    max-width: 100%;
    max-height: 480px;
    height: auto;
    border-radius: 4px;
    border: 1px solid #d5dce2;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    cursor: zoom-in;
    vertical-align: middle;
    background-color: #fafafa;
}

.forum-inline-img:hover {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.16);
}

/* 2. Подсветка поля при перетаскивании файла (Drag & Drop) */
.forum-textarea-dragover {
    background-color: #f1f8ff !important;
    outline: 2px dashed #007bff !important;
    outline-offset: -2px;
}

/* 3. Компактное уведомление о загрузке из буфера (Toast) */
.forum-upload-toast {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    margin: 4px 0;
    font-family: inherit;
    animation: forumFadeIn 0.2s ease-in-out;
}

.forum-upload-toast.loading {
    display: flex;
    background: #e8f4fd;
    border: 1px solid #b8daff;
    color: #004085;
}

.forum-upload-toast.success {
    display: flex;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.forum-upload-toast.error {
    display: flex;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.forum-upload-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(0, 64, 133, 0.2);
    border-top-color: #004085;
    border-radius: 50%;
    animation: forumSpin 0.8s linear infinite;
}

@keyframes forumSpin {
    to { transform: rotate(360deg); }
}

@keyframes forumFadeIn {
    from { opacity: 0; transform: translateY(-2px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 4. Полоса миниатюр загруженных картинок под полем */
.forum-img-tray {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 4px 0;
}

.forum-img-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #dcdcdc;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
}

.forum-img-chip img {
    width: 28px;
    height: 28px;
    object-fit: cover;
    border-radius: 3px;
    margin-right: 5px;
}

.forum-img-chip .chip-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #555555;
}

.forum-img-chip .chip-del {
    margin-left: 5px;
    background: #f1f1f1;
    color: #cc0000;
    border: none;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
}

.forum-img-chip .chip-del:hover {
    background: #cc0000;
    color: #ffffff;
}

/* 5. Полноэкранный Lightbox для просмотра картинок */
.forum-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    cursor: zoom-out;
    padding: 16px;
    box-sizing: border-box;
}

.forum-lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.forum-lightbox-img {
    max-width: 95vw;
    max-height: 92vh;
    border-radius: 4px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
    object-fit: contain;
    cursor: default;
}

.forum-lightbox-close {
    position: absolute;
    top: 14px;
    right: 20px;
    color: #ffffff;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
    line-height: 1;
    z-index: 1000000;
}

.forum-lightbox-close:hover {
    color: #ff5555;
}
