/* assets/css/messenger.css */
/* Java/Button phone compatible - no flexbox, no grid */

/* ── Messenger Sub-Header ────────────────────────────────── */
.msng-header {
    background-color: #1a3a6b;
    border-bottom: 2px solid #32c9a7;
    padding: 6px 10px;
}

.msng-title {
    color: #32c9a7;
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 5px;
}

.msng-tabs {
    padding: 2px 0;
}

.msng-tabs a {
    display: inline-block;
    color: #ccc;
    font-size: 13px;
    font-weight: bold;
    padding: 4px 8px;
    margin-right: 2px;
    text-decoration: none;
    border: 1px solid #446;
    border-radius: 3px;
    background-color: #253860;
}

.msng-tabs a:hover {
    background-color: #32c9a7;
    color: #fff;
}

.msng-tab-active {
    background-color: #32c9a7 !important;
    color: #fff !important;
    border-color: #32c9a7 !important;
}

/* ── Sub-tabs (inside rooms.php) ─────────────────────────── */
.msng-subtabs {
    padding: 6px 0;
    border-bottom: 1px solid #dddfe2;
    margin-bottom: 8px;
}

.msng-subtabs a {
    display: inline-block;
    padding: 4px 10px;
    margin-right: 3px;
    font-size: 12px;
    font-weight: bold;
    color: #29487d;
    text-decoration: none;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: #fff;
}

.msng-subtab-active {
    background-color: #29487d !important;
    color: #fff !important;
}

/* ── Messenger Sub-Footer ────────────────────────────────── */
.msng-footer {
    background-color: #f0f2f5;
    border-top: 1px solid #dddfe2;
    border-bottom: 1px solid #dddfe2;
    padding: 7px 10px;
    text-align: center;
}

.msng-footer a {
    color: #29487d;
    font-size: 12px;
    font-weight: bold;
    text-decoration: none;
}

.msng-footer a:hover { text-decoration: underline; }

.msng-footer-sep {
    color: #aaa;
    margin: 0 5px;
    font-size: 12px;
}

/* ── Conversation List Items ─────────────────────────────── */
.msng-list {
    background: #fff;
    border: 1px solid #dddfe2;
    border-radius: 3px;
}

.msng-item {
    border-bottom: 1px solid #f0f2f5;
    padding: 8px;
    overflow: hidden; /* clearfix */
}

.msng-item:last-child { border-bottom: none; }

.msng-avatar {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    border: 1px solid #ccc;
    vertical-align: top;
    margin-right: 7px;
    float: left;
}

.msng-item > a {
    display: block;
    text-decoration: none;
    color: #1c1e21;
    overflow: hidden;
}

.msng-item-body {
    overflow: hidden;
}

.msng-item-top {
    margin-bottom: 2px;
}

.msng-item-name {
    font-weight: bold;
    font-size: 13px;
    color: #1c1e21;
}

.msng-item-time {
    float: right;
    font-size: 11px;
    color: #606770;
}

.msng-item-preview {
    font-size: 12px;
    color: #606770;
}

.msng-item-actions {
    margin-top: 4px;
}

/* ── Badges ──────────────────────────────────────────────── */
.msng-badge {
    font-size: 10px;
    font-weight: bold;
    padding: 1px 5px;
    border-radius: 3px;
    vertical-align: middle;
}

.msng-badge-group { background: #e7f3ff; color: #1877f2; }
.msng-badge-room  { background: #e7ffe7; color: #1a7a1a; }

/* ── Buttons ─────────────────────────────────────────────── */
.msng-btn {
    display: inline-block;
    background-color: #32c9a7;
    color: #fff;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.msng-btn:hover { background-color: #29a88d; text-decoration: none; }

.msng-btn-danger {
    background-color: #e74c3c;
}
.msng-btn-danger:hover { background-color: #c0392b; }

/* ── Messages / Status ───────────────────────────────────── */
.msng-empty {
    text-align: center;
    color: #999;
    padding: 20px;
    font-size: 13px;
}

.msng-error {
    background: #fff5f5;
    border: 1px solid #f5c6cb;
    color: #c0392b;
    padding: 8px 12px;
    border-radius: 3px;
    margin-bottom: 10px;
    font-size: 13px;
}

.msng-success {
    background: #f0fff4;
    border: 1px solid #b2dfdb;
    color: #276749;
    padding: 8px 12px;
    border-radius: 3px;
    margin-bottom: 10px;
    font-size: 13px;
}

/* ── Pagination ──────────────────────────────────────────── */
.msng-pagination {
    text-align: center;
    padding: 10px 0;
}

.msng-pagination a {
    display: inline-block;
    padding: 6px 14px;
    background-color: #32c9a7;
    color: #fff;
    border-radius: 3px;
    font-size: 13px;
    text-decoration: none;
    margin: 2px;
}

/* ── Form styles ─────────────────────────────────────────── */
.msng-form-group {
    margin-bottom: 12px;
}

.msng-form-group label {
    display: block;
    font-size: 13px;
    color: #555;
    margin-bottom: 4px;
    font-weight: bold;
}

.msng-form input[type="text"],
.msng-form textarea {
    width: 95%;
    padding: 7px;
    font-size: 13px;
    border: 1px solid #dddfe2;
    border-radius: 3px;
}

.msng-form input[type="submit"] {
    background-color: #1878F3;
    color: #fff;
    padding: 8px 16px;
    border: none;
    border-radius: 3px;
    font-weight: bold;
    cursor: pointer;
}

/* ── Search form in invite.php ───────────────────────────── */
.msng-search-form {
    margin-bottom: 12px;
}

.msng-search-form input[type="text"] {
    width: 70%;
    padding: 6px;
    font-size: 13px;
    border: 1px solid #dddfe2;
    border-radius: 3px;
}

.msng-already-member {
    font-size: 12px;
    color: #888;
    font-style: italic;
}

/* ── Settings page ───────────────────────────────────────── */
.msng-settings-header {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #dddfe2;
}

.msng-settings-header h3 {
    margin-top: 5px;
    font-size: 15px;
}

.msng-settings-section {
    background: #fff;
    border: 1px solid #dddfe2;
    border-radius: 3px;
    padding: 10px;
    margin-bottom: 10px;
}

.msng-settings-section h4 {
    font-size: 13px;
    color: #444;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.msng-section-head {
    overflow: hidden;
    margin-bottom: 8px;
}

.msng-section-head h4 { float: left; margin: 0; line-height: 26px; }
.msng-section-head .msng-btn { float: right; }

.msng-member-row {
    padding: 6px 0;
    overflow: hidden;
}

.msng-member-row .msng-avatar {
    float: left;
    margin-right: 8px;
}

.msng-member-name {
    font-size: 13px;
    line-height: 30px;
}

.msng-member-row form { float: right; }

.msng-divider {
    border: none;
    border-top: 1px solid #f0f2f5;
    margin: 0;
}

.msng-settings-footer {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #dddfe2;
}

/* ── Chat Window ─────────────────────────────────────────── */
.msng-chat-wrap {
    padding: 0;
}

.msng-chat-topbar {
    background: #29487d;
    color: #fff;
    padding: 7px 10px;
    overflow: hidden;
    position: relative;
}

.msng-back {
    color: #ccc;
    font-size: 13px;
    text-decoration: none;
    float: left;
}

.msng-back:hover { color: #fff; }

.msng-chat-title {
    display: block;
    text-align: center;
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    padding: 0 40px;
}

.msng-member-count {
    display: block;
    font-size: 11px;
    color: #aac4e8;
    text-align: center;
    font-weight: normal;
}

.msng-settings-btn {
    color: #ccc;
    font-size: 16px;
    text-decoration: none;
    float: right;
    margin-top: -20px;
}

.msng-settings-btn:hover { color: #fff; }

.msng-refresh-bar {
    text-align: center;
    padding: 6px;
    background: #f0f2f5;
    border-bottom: 1px solid #dddfe2;
}

.msng-load-older {
    text-align: center;
    padding: 5px;
    font-size: 12px;
    border-bottom: 1px solid #dddfe2;
}

.msng-messages {
    background: #fff;
    padding: 8px;
    min-height: 200px;
}

/* System message */
.msng-sys-msg {
    text-align: center;
    color: #888;
    font-size: 11px;
    font-style: italic;
    margin: 6px 0;
}

/* Message bubbles */
.msng-msg {
    margin-bottom: 8px;
    overflow: hidden;
}

.msng-msg-mine {
    text-align: right;
}

.msng-msg-theirs {
    text-align: left;
}

.msng-bubble {
    display: inline-block;
    max-width: 80%;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 13px;
    text-align: left;
}

.msng-msg-mine .msng-bubble {
    background-color: #0084ff;
    color: #fff;
}

.msng-msg-theirs .msng-bubble {
    background-color: #e4e6eb;
    color: #050505;
}

.msng-time-mine {
    display: block;
    font-size: 10px;
    color: #cce5ff;
    margin-bottom: 3px;
}

.msng-time-theirs {
    display: block;
    font-size: 10px;
    color: #888;
    margin-bottom: 3px;
}

.msng-sender-name {
    display: block;
    font-size: 11px;
    font-weight: bold;
    color: #555;
    margin-bottom: 2px;
}

.msng-msg-img {
    max-width: 180px;
    display: block;
    margin-top: 5px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

/* Delete button */
.msng-del-form { display: inline; }
.msng-del-btn {
    background: none;
    border: none;
    color: #e74c3c;
    font-size: 11px;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

/* ── Compose form ────────────────────────────────────────── */
.msng-compose {
    border-top: 1px solid #dddfe2;
    padding: 8px;
    background: #f0f2f5;
}

.msng-input {
    width: 95%;
    padding: 7px;
    font-size: 13px;
    border: 1px solid #dddfe2;
    border-radius: 3px;
    resize: none;
    height: 50px;
}

.msng-compose-actions {
    margin-top: 6px;
    overflow: hidden;
}

.msng-img-label {
    display: inline-block;
    background: #fff;
    border: 1px solid #dddfe2;
    padding: 5px 8px;
    border-radius: 3px;
    font-size: 12px;
    cursor: pointer;
    color: #444;
}

.msng-file-input {
    display: none;
}

.msng-send-btn {
    float: right;
    background-color: #1878F3;
    color: #fff;
    padding: 6px 18px;
    border: none;
    border-radius: 3px;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
}

.msng-send-btn:hover { background-color: #1459b0; }

.msng-bottom-bar {
    text-align: right;
    padding: 6px 8px;
    border-top: 1px solid #dddfe2;
    background: #f0f2f5;
}

.msng-bottom-bar .msng-btn {
    margin-left: 5px;
}

/* ── Unread highlight ────────────────────────────────────── */
.msng-item-unread {
    background-color: #e8f4ff;
    border-left: 3px solid #1878F3;
}

.msng-item-unread .msng-item-name {
    color: #000;
}

/* ── Time + status block (stacked) ──────────────────────── */
.msng-item-time-wrap {
    float: right;
    text-align: right;
}

.msng-item-time {
    display: block;
    font-size: 11px;
    color: #606770;
}

.msng-unread-count {
    display: block;
    font-size: 11px;
    font-weight: bold;
    color: #1878F3;
    background-color: #ddeeff;
    border-radius: 8px;
    padding: 1px 6px;
    margin-top: 2px;
    text-align: center;
}

.msng-seen {
    display: block;
    font-size: 10px;
    color: #aaa;
    text-align: right;
    margin-top: 2px;
}