/* Message Wall Stílusok */

.mw-wrapper {
    max-width: 100%;
    /* Engedjük, hogy kitöltse a rendelkezésre álló helyet, vagy az inline style korlátozza */
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f0f2f5;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.mw-header {
    background: #075e54;
    color: #fff;
    padding: 15px;
    border-bottom: 1px solid #ddd;
    width: 100%;
    box-sizing: border-box;
}

.mw-header h3 {
    margin: 0;
    font-size: 18px;
    width: 100%;
}

.mw-message-container {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #e5ddd5;
    min-height: 0;
}

/* Saját vs. más üzenetek – igazítás és szélesség */
.mw-message-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}

.mw-message-row.mw-theirs {
    align-items: flex-start;
}

.mw-message-row.mw-mine {
    align-items: flex-end;
}

.mw-message-row .mw-message-box {
    max-width: 95%;
}

/* Chat téma - WhatsApp stílus */
.mw-theme-chat .mw-message-container {
    background: #e5ddd5;
}

.mw-theme-chat .mw-message-row {
    margin-bottom: 12px;
}

.mw-theme-chat .mw-chat-meta {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.mw-theme-chat .mw-chat-author {
    font-weight: bold;
    margin-right: 8px;
}

.mw-theme-chat .mw-message-box {
    background: #dcf8c6;
    padding: 8px 12px;
    border-radius: 2px 8px 8px 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.mw-theme-chat .mw-mine .mw-message-box {
    background: #d1f5b0;
    border-radius: 8px 2px 8px 8px;
}

.mw-theme-chat .mw-admin-msg .mw-message-box,
.mw-theme-chat .mw-admin-msg.mw-mine .mw-message-box {
    background: #fdf6d3;
}

.mw-theme-chat .mw-message-content {
    font-size: 15px;
    line-height: 1.4;
    word-wrap: break-word;
}

.mw-theme-chat .mw-date {
    font-size: 11px;
    color: #999;
}

/* Messenger téma */
.mw-theme-messenger .mw-message-container {
    background: #fff;
}

.mw-theme-messenger .mw-message-row {
    margin-bottom: 10px;
}

.mw-theme-messenger .mw-message-box {
    background: #e4e6eb;
    color: #050505;
    padding: 10px 14px;
    border-radius: 2px 18px 18px 18px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.mw-theme-messenger .mw-mine .mw-message-box {
    background: #d6eaff;
    color: #050505;
    border-radius: 18px 2px 18px 18px;
}

.mw-theme-messenger .mw-admin-msg .mw-message-box {
    background: #fdf6d3;
}

.mw-theme-messenger .mw-admin-msg.mw-mine .mw-message-box {
    background: #fdf6d3;
}

.mw-theme-messenger .mw-mine .mw-message-meta,
.mw-theme-messenger .mw-mine .mw-date {
    text-align: right;
}

.mw-theme-messenger .mw-message-content {
    font-size: 15px;
    line-height: 1.4;
    word-wrap: break-word;
}

.mw-theme-messenger .mw-message-meta {
    font-size: 11px;
    color: #65676b;
    margin-top: 4px;
}

.mw-theme-messenger .mw-messenger-author {
    font-weight: bold;
}

.mw-theme-messenger .mw-date {
    font-size: 11px;
}

/* Minimalist téma - Tiszta, egyszerű */
.mw-theme-minimalist .mw-wrapper {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: none;
}

.mw-theme-minimalist .mw-header {
    background: #f9f9f9;
    color: #333;
    border-bottom: 1px solid #e0e0e0;
    padding: 12px;
}

.mw-theme-minimalist .mw-message-container {
    background: #ffffff;
    padding: 12px;
}

.mw-theme-minimalist .mw-message-row {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.mw-theme-minimalist .mw-message-row:last-child {
    border-bottom: none;
}

.mw-theme-minimalist .mw-message-box {
    background: transparent;
    padding: 0;
}

.mw-theme-minimalist .mw-mine .mw-message-content {
    text-align: right;
}

.mw-theme-minimalist .mw-message-content {
    font-size: 15px;
    color: #333;
    line-height: 1.6;
}

.mw-theme-minimalist .mw-message-meta {
    font-size: 12px;
    color: #999;
    margin-top: 6px;
}

.mw-theme-minimalist .mw-messenger-author,
.mw-theme-minimalist .mw-chat-author {
    font-weight: 600;
    color: #666;
}

.mw-theme-minimalist .mw-date {
    color: #aaa;
}

/* Compact téma - Sűrű elrendezés */
.mw-theme-compact .mw-wrapper {
    background: #fafafa;
    border: 1px solid #ddd;
}

.mw-theme-compact .mw-header {
    background: #555;
    color: #fff;
    padding: 8px 12px;
}

.mw-theme-compact .mw-header h3 {
    font-size: 14px;
}

.mw-theme-compact .mw-message-container {
    background: #fafafa;
    padding: 8px;
}

.mw-theme-compact .mw-message-row {
    margin-bottom: 4px;
}

.mw-theme-compact .mw-message-box {
    background: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.mw-theme-compact .mw-mine .mw-message-box {
    background: #eaf4ff;
    border-color: #b3d4f5;
}

.mw-theme-compact .mw-admin-msg .mw-message-box,
.mw-theme-compact .mw-admin-msg.mw-mine .mw-message-box {
    background: #fdf6d3;
    border-color: #f0e08a;
}

.mw-theme-compact .mw-message-content {
    font-size: 13px;
    line-height: 1.3;
    color: #333;
}

.mw-theme-compact .mw-message-meta,
.mw-theme-compact .mw-chat-meta {
    font-size: 10px;
    color: #888;
    margin-top: 2px;
}

.mw-theme-compact .mw-messenger-author,
.mw-theme-compact .mw-chat-author {
    font-weight: 600;
    color: #555;
    margin-right: 6px;
}

.mw-theme-compact .mw-date {
    color: #999;
}

/* Frontend Input Area */
.mw-wrapper {
    /* Ensure relative positioning for absolute children if needed */
    position: relative;
}

.mw-message-container {
    /* Add padding bottom to prevent content being hidden behind input if it was fixed */
    /* But we use flex, so it is fine. Just ensure min-h-0 for flex scrolling */
}

.mw-input-area {
    padding: 10px;
    background-color: #f0f2f5;
    /* Light gray background like Messenger */
    border-top: 1px solid #ddd;
    flex-shrink: 0;
    /* Prevent shrinking */
}

.mw-frontend-form {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    max-width: 100%;
}

.mw-frontend-form textarea {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 20px;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    max-height: 100px;
    height: 38px;
    overflow-y: hidden;
}

.mw-frontend-form textarea:focus {
    border-color: #0084ff;
}

.mw-emoji-toggle {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.mw-emoji-toggle:hover {
    transform: scale(1.1);
    background: transparent !important;
}

.mw-send-btn {
    background-color: transparent;
    color: #0084ff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    padding: 0;
    position: relative;
    flex-shrink: 0;
}

.mw-send-btn:hover {
    transform: scale(1.2);
    color: #0056b3;
    background: transparent !important;
}

.mw-send-btn .dashicons {
    font-size: 20px;
}

.mw-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mw-send-btn::before {
    content: '➤';
    /* Unicode arrow as fallback */
    font-size: 32px;
    font-weight: bold;
    position: absolute;
}

.mw-send-btn:has(.dashicons) ::before {
    display: none;
    /* Hide fallback if dashicons loads */
}

/* Karakter számláló */
.mw-char-counter {
    font-size: 12px;
    color: #999;
    text-align: right;
    padding: 5px 10px 0;
    margin-top: -5px;
}

/* Kicsit igazítsunk a message containeren, hogy ne érjen bele a formba */
.mw-theme-messenger .mw-message-container,
.mw-theme-chat .mw-message-container {
    /* Már flex-ben van, így a padding-bottom felesleges, de ha fixre váltanánk az input-area-t, akkor kéne */
}

/* Emoji Picker */
.mw-emoji-picker {
    display: none;
    position: absolute;
    bottom: 60px;
    left: 10px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    max-width: 300px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    grid-template-columns: repeat(8, 1fr);
    gap: 5px;
}

.mw-emoji-item {
    cursor: pointer;
    font-size: 20px;
    padding: 5px;
    text-align: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.mw-emoji-item:hover {
    background: #f0f0f0;
}

/* Reply idézet blokk (üzeneten belül, ha ez válasz) */
.mw-reply-quote {
    display: block;
    border-left: 3px solid #0084ff;
    background: rgba(0, 132, 255, 0.07);
    border-radius: 0 6px 6px 0;
    padding: 5px 10px;
    margin-bottom: 6px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
    cursor: pointer;
}

.mw-reply-quote:hover {
    background: rgba(0, 132, 255, 0.14);
}

.mw-reply-quote-author {
    display: block;
    font-weight: bold;
    font-size: 12px;
    color: #0084ff;
    margin-bottom: 2px;
}

.mw-reply-quote-text {
    display: block;
    font-size: 12px;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

/* Admin akció gombok (szerkesztés, törlés) */
.mw-admin-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.mw-message-row:hover .mw-admin-actions {
    opacity: 1;
}

.mw-admin-edit-btn,
.mw-admin-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 5px;
    border-radius: 4px;
    transition: background 0.2s;
    line-height: 1;
}

.mw-admin-edit-btn:hover {
    background: rgba(0, 132, 255, 0.12);
}

.mw-admin-delete-btn:hover {
    background: rgba(220, 53, 69, 0.12);
}

/* Inline szerkesztő */
.mw-admin-edit-textarea {
    width: 100%;
    min-height: 60px;
    padding: 6px 8px;
    border: 1px solid #0084ff;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    box-sizing: border-box;
    outline: none;
}

.mw-admin-edit-btns {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.mw-admin-save-btn,
.mw-admin-cancel-btn {
    padding: 4px 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
}

.mw-admin-save-btn {
    background: #0084ff;
    color: #fff;
}

.mw-admin-save-btn:hover {
    background: #0069d9;
}

.mw-admin-cancel-btn {
    background: #e4e6eb;
    color: #333;
}

.mw-admin-cancel-btn:hover {
    background: #ccd0d5;
}

/* Reply gomb az üzeneteken */
.mw-reply-btn {
    display: inline-block;
    background: none;
    border: none;
    color: #0084ff;
    font-size: 12px;
    cursor: pointer;
    padding: 2px 4px;
    margin-top: 4px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
}

.mw-message-row:hover .mw-reply-btn {
    opacity: 1;
}

.mw-reply-btn:hover {
    background: rgba(0, 132, 255, 0.1);
}

/* Reply indikátor sáv az input felett */
.mw-reply-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 132, 255, 0.08);
    border-left: 3px solid #0084ff;
    padding: 6px 10px;
    margin-bottom: 6px;
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    color: #333;
}

.mw-reply-snippet {
    color: #777;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    max-width: 200px;
}

.mw-cancel-reply {
    background: none;
    border: none;
    color: #999;
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    margin-left: auto;
    flex-shrink: 0;
}

.mw-cancel-reply:hover {
    color: #333;
}

/* Responsive */
@media (max-width: 600px) {
    .mw-message-row .mw-message-box {
        max-width: 95%;
    }

    .mw-reply-btn,
    .mw-admin-actions {
        opacity: 1;
    }
}