/* ==========================================================================
   MacBlash Chat — Isolated Stylesheet (Chat Sections Index + Live Chat Room)
   rusty create | 2026-09-08 19:05
   Action: Creating macblash-chat.css — dark-glass chat UI adapted from Google
           Stitch screens "Macblash Chat Rooms Index" + "Macblash Live Chat Room".
           All selectors are namespaced with .mac-chat- and scoped under
           .mac-chat-page / .mac-chat-room-page so legacy .chat-item / .chat-messages
           rules in style.css stay untouched for their other consumers
           (search.blade.php, profile.blade.php, contact_us.blade.php ...).
   ========================================================================== */

/* --- Design Tokens (mirror macblash-forums.css) --- */
:root {
    --mc-bg: #0a0a0f;
    --mc-surface: rgba(18, 18, 26, 0.75);
    --mc-surface-solid: #12121a;
    --mc-glass-border: rgba(6, 182, 212, 0.12);
    --mc-glass-border-hover: rgba(6, 182, 212, 0.45);
    --mc-gold: #e4c59e;
    --mc-cyan: #06b6d4;
    --mc-purple: #8b5cf6;
    --mc-green: #22c55e;
    --mc-text: #e2e8f0;
    --mc-text-muted: #94a3b8;
    --mc-radius: 16px;
    --mc-radius-sm: 10px;
    --mc-radius-xs: 6px;
}

/* ==========================================================================
   1. CHAT SECTIONS / ROOMS INDEX  (routes: /all-chat-sections, /all-chat-sub-sections/{id})
   ========================================================================== */

.mac-chat-page {
    background: transparent !important;
    position: relative;
    z-index: 2;
}

/* --- Hero --- */
.mac-chat-hero {
    text-align: center;
    padding: 40px 0 32px;
}

.mac-chat-hero-title {
    font-size: 38px;
    font-weight: 800;
    color: var(--mc-gold);
    letter-spacing: -0.02em;
    margin-bottom: 10px;
}

.mac-chat-hero-desc {
    font-size: 17px;
    color: var(--mc-text-muted);
    max-width: 620px;
    margin: 0 auto;
    line-height: 1.6;
}

/* --- Grid --- */
.mac-chat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
    position: relative;
    z-index: 2;
    margin-top: 8px;
}

@media (max-width: 1199px) { .mac-chat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px)  { .mac-chat-grid { grid-template-columns: repeat(2, 1fr); } }

@media (max-width: 575px) {
    .mac-chat-grid {
        grid-template-columns: 1fr;
        width: 100%;
        gap: 16px;
    }
    .mac-chat-card {
        /* release GPU composite layer on mobile static grid */
        will-change: auto !important;
        transition: none !important;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
}

/* --- Card --- */
.mac-chat-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: var(--mc-radius);
    background: var(--mc-surface-solid);
    border: 1px solid var(--mc-glass-border);
    text-decoration: none;
    color: var(--mc-text);
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1),
                border-color 0.3s ease,
                box-shadow 0.3s ease;
    /* Cards are visible by default; the GSAP reveal (all_chat_sections /
       all_chat_sub_sections @section('script')) animates gsap.from() so a
       missing/failed script never leaves the grid blank. */
}

.mac-chat-card:hover {
    border-color: var(--mc-glass-border-hover);
    box-shadow: 0 0 28px rgba(6, 182, 212, 0.15);
    transform: translateY(-4px);
    color: var(--mc-text);
    text-decoration: none;
}

.mac-chat-card-media {
    position: relative;
    height: 168px;
    overflow: hidden;
    background: #0d0d14;
}

.mac-chat-card-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.mac-chat-card:hover .mac-chat-card-img { transform: scale(1.08); }

.mac-chat-card-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 35%, rgba(10, 10, 15, 0.92) 100%);
}

/* Live / count badge (top-start corner, RTL-aware) */
.mac-chat-card-badge {
    position: absolute;
    top: 14px;
    inset-inline-end: 14px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    background: rgba(6, 182, 212, 0.18);
    color: var(--mc-cyan);
    border: 1px solid rgba(6, 182, 212, 0.35);
    backdrop-filter: blur(4px);
}

.mac-chat-card-badge .mac-chat-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--mc-cyan);
    box-shadow: 0 0 8px var(--mc-cyan);
}

.mac-chat-card-badge.is-live { animation: mac-chat-pulse 2s ease-in-out infinite; }

@keyframes mac-chat-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

.mac-chat-card-overlay {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    z-index: 2;
    padding: 16px 16px 12px;
}

.mac-chat-card-title {
    font-size: 17px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mac-chat-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--mc-text-muted);
}

.mac-chat-card-meta i { color: var(--mc-cyan); font-size: 15px; }

.mac-chat-card-foot {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 12px;
    color: var(--mc-text-muted);
}

.mac-chat-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    color: var(--mc-cyan);
    transition: gap 0.25s ease;
}

.mac-chat-card:hover .mac-chat-card-cta { gap: 8px; }

/* --- Stats strip --- */
.mac-chat-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 44px;
    padding: 26px;
    border-radius: var(--mc-radius);
    background: var(--mc-surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--mc-glass-border);
    text-align: center;
}

@media (max-width: 575px) { .mac-chat-stats { grid-template-columns: 1fr; gap: 10px; padding: 20px; } }

.mac-chat-stat-num {
    font-size: 26px;
    font-weight: 800;
    color: var(--mc-cyan);
    line-height: 1.1;
}

.mac-chat-stat-num.is-purple { color: var(--mc-purple); }

.mac-chat-stat-label {
    font-size: 13px;
    color: var(--mc-text-muted);
    margin-top: 4px;
}

/* --- Empty state --- */
.mac-chat-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--mc-text-muted);
    border: 1px dashed var(--mc-glass-border);
    border-radius: var(--mc-radius);
}

.mac-chat-empty i { font-size: 40px; color: var(--mc-cyan); display: block; margin-bottom: 12px; }

/* --- Pagination (scoped) --- */
.mac-chat-page .pagination { justify-content: center; margin-top: 36px; }

.mac-chat-page .pagination .page-link {
    background: var(--mc-surface);
    border-color: var(--mc-glass-border);
    color: var(--mc-text-muted);
    border-radius: var(--mc-radius-xs);
    margin: 0 3px;
}

.mac-chat-page .pagination .page-item.active .page-link {
    background: var(--mc-cyan);
    border-color: var(--mc-cyan);
    color: #001014;
}

/* ==========================================================================
   2. LIVE CHAT ROOM  (route: /show-chat/{id})
   ========================================================================== */

.mac-chat-room-page {
    background: transparent !important;
    position: relative;
    z-index: 2;
}

.mac-chat-room {
    /* GPU sandbox: trap composite/repaint work inside the widget (CLAUDE.md rule) */
    isolation: isolate !important;
    position: relative;
    z-index: 2;
}

/* --- Room header bar --- */
.mac-chat-room-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-radius: var(--mc-radius);
    background: var(--mc-surface);
    backdrop-filter: blur(16px);
    border: 1px solid var(--mc-glass-border);
    border-top: 2px solid var(--mc-cyan);
    margin-bottom: 16px;
}

.mac-chat-room-avatar {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: var(--mc-radius-sm);
    object-fit: cover;
    border: 1px solid rgba(6, 182, 212, 0.35);
    background: #0d0d14;
}

.mac-chat-room-headline { flex: 1; min-width: 0; }

.mac-chat-room-title {
    font-size: 19px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 2px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mac-chat-room-crumb {
    font-size: 12px;
    color: var(--mc-text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.mac-chat-room-crumb:hover { color: var(--mc-cyan); }

.mac-chat-room-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.mac-chat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(34, 197, 94, 0.14);
    color: var(--mc-green);
    border: 1px solid rgba(34, 197, 94, 0.3);
    white-space: nowrap;
}

.mac-chat-pill .mac-chat-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--mc-green);
    box-shadow: 0 0 8px var(--mc-green);
}

.mac-chat-icon-btn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--mc-text-muted);
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.mac-chat-icon-btn:hover {
    color: #fff;
    background: rgba(6, 182, 212, 0.15);
    border-color: rgba(6, 182, 212, 0.35);
}

/* --- Body grid --- */
.mac-chat-room-body {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr) 300px;
    gap: 16px;
    align-items: start;
}

@media (max-width: 1199px) {
    /* Right column drops under the feed and spreads its 3 panels into a row */
    .mac-chat-room-body { grid-template-columns: 220px minmax(0, 1fr); }
    .mac-chat-room-info {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 16px;
        align-items: start;
    }
    .mac-chat-room-info .mac-chat-panel + .mac-chat-panel { margin-top: 0; }
}

@media (max-width: 767px) {
    .mac-chat-room-body { grid-template-columns: 1fr; }
    .mac-chat-room-main { order: 1; }
    .mac-chat-room-aside { order: 2; }
    .mac-chat-room-info { order: 3; grid-template-columns: 1fr; }
    .mac-chat-room-header { flex-wrap: wrap; }
    .mac-chat-room-actions { width: 100%; justify-content: space-between; }
    .mac-chat-feed { max-height: 70vh; }
    .mac-chat-people { max-height: none; }
}

/* --- Glass panel (shared by asides) --- */
.mac-chat-panel {
    background: var(--mc-surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--mc-glass-border);
    border-radius: var(--mc-radius);
    padding: 18px;
}

.mac-chat-panel + .mac-chat-panel { margin-top: 16px; }

.mac-chat-panel.cyan-top { border-top: 2px solid var(--mc-cyan); }
.mac-chat-panel.purple-top { border-top: 2px solid var(--mc-purple); }

.mac-chat-panel-title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mc-text-muted);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mac-chat-panel-title i { color: var(--mc-purple); font-size: 16px; }

.mac-chat-panel-title .mac-chat-count-chip {
    margin-inline-start: auto;
    background: rgba(6, 182, 212, 0.16);
    color: var(--mc-cyan);
    border-radius: 999px;
    padding: 2px 9px;
    font-size: 11px;
    letter-spacing: 0;
}

/* Desktop-only subtle tilt (no Z-depth / preserve-3d — CLAUDE.md mobile rule) */
@media (min-width: 992px) and (hover: hover) {
    .mac-chat-tilt { transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
    .mac-chat-tilt:hover { transform: perspective(1000px) rotateX(1.5deg) rotateY(-1.5deg); }
}

/* --- Participants list --- */
.mac-chat-people {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 58vh;
    overflow-y: auto;
}

.mac-chat-person {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mac-chat-person-avatar {
    position: relative;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
}

.mac-chat-person-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.12);
    background: #0d0d14;
}

.mac-chat-person-avatar.rank-cyan img   { border-color: var(--mc-cyan); }
.mac-chat-person-avatar.rank-purple img { border-color: var(--mc-purple); }
.mac-chat-person-avatar.rank-gold img   { border-color: var(--mc-gold); }

.mac-chat-person-status {
    position: absolute;
    bottom: -1px;
    inset-inline-start: -1px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--mc-green);
    border: 2px solid var(--mc-bg);
    box-shadow: 0 0 6px var(--mc-green);
}

.mac-chat-person-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--mc-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mac-chat-person-meta { font-size: 11px; color: var(--mc-text-muted); }

/* --- Center column --- */
.mac-chat-room-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.mac-chat-feed {
    /* override legacy .chat-messages (height:750px; margin-bottom:50px) within this widget only */
    height: auto !important;
    max-height: 62vh;
    min-height: 340px;
    margin-bottom: 0 !important;
    overflow-y: auto;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    background: var(--mc-surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--mc-glass-border);
    border-radius: var(--mc-radius);
}

.mac-chat-day {
    align-self: center;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--mc-text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 5px 16px;
    border-radius: 999px;
}

/* Restyle the legacy .message structure — scoped so style.css version elsewhere is intact */
.mac-chat-feed .message {
    display: flex;
    gap: 12px;
    margin: 0 !important;
    max-width: 78%;
    align-items: flex-start;
}

/* .mac-chat-feed is a column flex, so align-self resolves against `dir` on its own:
   own messages hug the reading-START edge  -> RIGHT in Arabic (RTL), LEFT in English (LTR)
   others' messages hug the reading-END edge -> LEFT in Arabic,       RIGHT in English
   Avatar sits on the same side as the bubble (row for me, row-reverse for others). */
.mac-chat-feed .message.message-sent {
    align-self: flex-start;
    flex-direction: row;
}
.mac-chat-feed .message.message-received {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.mac-chat-feed .chat-user-avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    margin: 0 !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #0d0d14;
}

.mac-chat-feed .chat-user-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

.mac-chat-feed .chat-user-avatar.btn-head-1 { border-color: rgba(148, 163, 184, 0.5); }
.mac-chat-feed .chat-user-avatar.btn-head-2 { border-color: rgba(34, 197, 94, 0.6); }
.mac-chat-feed .chat-user-avatar.btn-head-3 { border-color: rgba(6, 182, 212, 0.6); }
.mac-chat-feed .chat-user-avatar.btn-head-4 { border-color: rgba(139, 92, 246, 0.6); }

.mac-chat-feed .chat-user-message-data { display: flex; flex-direction: column; gap: 5px; min-width: 0; }

/* Name / bubble / meta hug the same edge the whole message is pinned to */
.mac-chat-feed .message-sent .chat-user-message-data { align-items: flex-start; }
.mac-chat-feed .message-received .chat-user-message-data { align-items: flex-end; }

.mac-chat-feed .chat-user-name {
    font-size: 12px;
    font-weight: 800;
    color: var(--mc-cyan);
    margin: 0 !important;
}

.mac-chat-feed .message-sent .chat-user-name { color: rgba(255, 255, 255, 0.75); text-align: start; }
.mac-chat-feed .message-received .chat-user-name { text-align: end; }

.mac-chat-feed .chat-user-message-content {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.6;
    color: #e8edf2;
    word-break: break-word;
    margin: 0 !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(6px);
}

/* Sharp corner (speech-bubble notch) on the bubble edge nearest the avatar.
   Logical radii flip automatically for LTR/RTL. */
.mac-chat-feed .message-received .chat-user-message-content { border-start-end-radius: 4px; }

.mac-chat-feed .message-sent .chat-user-message-content {
    border-start-start-radius: 4px;
    border-color: rgba(139, 92, 246, 0.3);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(139, 92, 246, 0.08));
}

.mac-chat-feed .chat-user-message-action {
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 11px;
    color: var(--mc-text-muted);
}

.mac-chat-feed .chat-user-message-report { margin: 0 !important; color: inherit; font-weight: 400; }

.mac-chat-feed .chat-user-message-report .dropdown-toggle {
    color: var(--mc-text-muted) !important;
    font-size: 16px !important;
    line-height: 1;
}

.mac-chat-feed .chat-user-message-report .dropdown-toggle::after { display: none; }
.mac-chat-feed .chat-user-message-report .dropdown-toggle:hover { color: var(--mc-cyan) !important; }

.mac-chat-feed .chat-user-message-report .dropdown-menu {
    background: var(--mc-surface-solid);
    border: 1px solid var(--mc-glass-border);
    border-radius: var(--mc-radius-sm);
    font-size: 13px;
}

.mac-chat-feed .chat-user-message-report .dropdown-item { color: var(--mc-text); }
.mac-chat-feed .chat-user-message-report .dropdown-item:hover { background: rgba(6, 182, 212, 0.12); }
.mac-chat-feed .chat-user-message-report .dropdown-item.text-danger { color: #f87171 !important; }

/* Optional inline media inside a bubble */
.mac-chat-feed .chat-user-message-content img {
    display: block;
    margin-top: 8px;
    border-radius: 10px;
    max-height: 220px;
    width: 100%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.mac-chat-feed::-webkit-scrollbar { width: 5px; }
.mac-chat-feed::-webkit-scrollbar-track { background: transparent; }
.mac-chat-feed::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.25); border-radius: 20px; }
.mac-chat-feed::-webkit-scrollbar-thumb:hover { background: rgba(139, 92, 246, 0.45); }

.mac-chat-people::-webkit-scrollbar { width: 4px; }
.mac-chat-people::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.25); border-radius: 20px; }

/* --- Composer (input bar) --- */
.mac-chat-composer {
    background: var(--mc-surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--mc-glass-border);
    border-radius: var(--mc-radius);
    padding: 12px 14px;
}

.mac-chat-composer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--mc-text-muted);
}

.mac-chat-composer-head .mac-chat-charcount { color: var(--mc-gold); }
.mac-chat-composer-head .mac-chat-charcount.is-max { color: #f87171; }

/* Re-lay-out the legacy .chat-form / .chat-input / .btn-chat-input inside the composer */
.mac-chat-composer .chat-form {
    background: transparent !important;
    border-radius: 0 !important;
}

.mac-chat-composer .chat-form form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mac-chat-composer .chat-input {
    flex: 1;
    width: auto !important;
    height: 46px !important;
    min-height: 46px;
    padding: 12px 16px !important;
    border-radius: 999px !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    background: rgba(255, 255, 255, 0.04) !important;
    color: var(--mc-text) !important;
    font-size: 14px;
    line-height: 1.4;
    resize: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mac-chat-composer .chat-input::placeholder { color: var(--mc-text-muted); }

.mac-chat-composer .chat-input:focus {
    outline: none;
    border-color: rgba(6, 182, 212, 0.5) !important;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.12);
}

.mac-chat-composer .btn-chat-input {
    width: 46px !important;
    height: 46px !important;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
    border: none;
    color: #fff !important;
    background: linear-gradient(135deg, var(--mc-purple), var(--mc-cyan)) !important;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mac-chat-composer .btn-chat-input:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.55);
}

/* Send icon must fly toward the reading direction, nose slightly UP ("taking off").
   fa-paper-plane-top points horizontally (East) natively, so:
     LTR (English): -12deg  -> nose points right + a touch up.
     RTL (Arabic):  mirror it -> nose points left + a touch up.
   Overrides the legacy `.btn-chat-input i { transform: rotate(175deg) }` from style.css. */
.mac-chat-composer .btn-chat-input i {
    transform: rotate(-12deg);
    transition: transform 0.2s ease;
}
[dir="rtl"] .mac-chat-composer .btn-chat-input i {
    transform: scaleX(-1) rotate(-12deg);
}
.mac-chat-composer .btn-chat-input:hover i { transform: rotate(-12deg) translate(2px, -1px); }
[dir="rtl"] .mac-chat-composer .btn-chat-input:hover i { transform: scaleX(-1) rotate(-12deg) translate(2px, -1px); }

/* Guest prompt (when composer is auth-gated) */
.mac-chat-guest {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    border-radius: var(--mc-radius);
    background: var(--mc-surface);
    border: 1px dashed var(--mc-glass-border);
    color: var(--mc-text-muted);
    font-size: 14px;
}

.mac-chat-guest a { color: var(--mc-cyan); font-weight: 700; text-decoration: none; }
.mac-chat-guest a:hover { text-decoration: underline; }

/* --- Right column: room info / rules / contributors --- */
.mac-chat-room-info { min-width: 0; }

.mac-chat-info-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--mc-radius-sm);
    padding: 14px;
}

.mac-chat-info-box h4 {
    font-size: 14px;
    font-weight: 800;
    color: var(--mc-cyan);
    margin: 0 0 6px;
}

.mac-chat-info-box p {
    font-size: 12px;
    line-height: 1.6;
    color: var(--mc-text-muted);
    margin: 0;
}

.mac-chat-info-stats {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.mac-chat-info-stat {
    flex: 1;
    text-align: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--mc-radius-xs);
    padding: 8px 4px;
}

.mac-chat-info-stat b { display: block; font-size: 16px; color: var(--mc-text); font-weight: 800; }
.mac-chat-info-stat span { font-size: 10px; color: var(--mc-text-muted); }

.mac-chat-rules { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

.mac-chat-rules li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--mc-text);
}

.mac-chat-rules li::before {
    content: "";
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    margin-top: 6px;
    border-radius: 50%;
    background: var(--mc-cyan);
    box-shadow: 0 0 5px var(--mc-cyan);
}

.mac-chat-leaders { display: flex; flex-direction: column; gap: 10px; }

.mac-chat-leader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
    border-radius: var(--mc-radius-sm);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.2s ease;
}

.mac-chat-leader:hover { background: rgba(255, 255, 255, 0.07); }

.mac-chat-leader-id { display: flex; align-items: center; gap: 10px; min-width: 0; }

.mac-chat-leader-rank {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 800;
    color: var(--mc-bg);
    background: var(--mc-text-muted);
}

.mac-chat-leader:nth-child(1) .mac-chat-leader-rank { background: #fbbf24; }
.mac-chat-leader:nth-child(2) .mac-chat-leader-rank { background: #cbd5e1; }
.mac-chat-leader:nth-child(3) .mac-chat-leader-rank { background: #f97316; }

.mac-chat-leader-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: #0d0d14;
    flex-shrink: 0;
}

.mac-chat-leader-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--mc-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mac-chat-leader-score { font-size: 11px; font-weight: 800; color: var(--mc-cyan); flex-shrink: 0; }

.mac-chat-invite-btn {
    width: 100%;
    margin-top: 4px;
    padding: 12px;
    border-radius: var(--mc-radius-sm);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.mac-chat-invite-btn:hover { background: rgba(6, 182, 212, 0.12); border-color: rgba(6, 182, 212, 0.35); }
.mac-chat-invite-btn i { color: var(--mc-cyan); }

/* --- Report modal: keep legacy .new-post-* look, nothing to override --- */

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    .mac-chat-card,
    .mac-chat-card-img,
    .mac-chat-card-badge.is-live,
    .mac-chat-tilt { transition: none !important; animation: none !important; }
    .mac-chat-card { opacity: 1 !important; transform: none !important; }
}
