/* Стили для вставки и отображения картинок на форуме DCMS-Social */

/* 1. Блок изображения в сообщениях форума */
.forum-img-wrapper {
    display: block;
    margin: 8px 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: 6px;
    border: 1px solid #d5dce2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    cursor: zoom-in;
    vertical-align: middle;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
    background-color: #fafafa;
}

.forum-inline-img:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
    filter: brightness(0.98);
}

/* 2. Панель загрузки над/под textarea */
.forum-upload-container {
    margin: 6px 0;
    font-family: inherit;
}

.forum-upload-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}

.forum-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(180deg, #f7f9fa 0%, #e9ecef 100%);
    border: 1px solid #ced4da;
    color: #495057;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
    text-decoration: none;
}

.forum-upload-btn:hover {
    background: linear-gradient(180deg, #ffffff 0%, #dfe3e6 100%);
    border-color: #adb5bd;
    color: #212529;
}

.forum-upload-btn:active {
    background: #e2e6ea;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.12);
}

.forum-upload-hint {
    font-size: 11px;
    color: #6c757d;
}

/* 3. Индикатор статуса и прогресса */
.forum-upload-status {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    margin: 4px 0;
    animation: fadeIn 0.2s ease-in-out;
}

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

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

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

.forum-upload-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid #b8daff;
    border-top-color: #004085;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

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

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

.forum-img-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 3px 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.forum-img-chip img {
    width: 38px;
    height: 38px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 6px;
}

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

.forum-img-chip .chip-del {
    margin-left: 6px;
    background: #e9ecef;
    color: #dc3545;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
}

.forum-img-chip .chip-del:hover {
    background: #dc3545;
    color: #fff;
}

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

/* 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.25s ease, visibility 0.25s 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: 6px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    object-fit: contain;
    cursor: default;
    transform: scale(0.96);
    transition: transform 0.25s ease;
}

.forum-lightbox-overlay.active .forum-lightbox-img {
    transform: scale(1);
}

.forum-lightbox-close {
    position: absolute;
    top: 14px;
    right: 18px;
    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: #ff6b6b;
}
