/* ===========================================================
   digirk.com – Live meeting module styles
   =========================================================== */
:root {
    --mt-bg: #0b1020;
    --mt-panel: #141b30;
    --mt-panel-2: #1b2440;
    --mt-line: rgba(255, 255, 255, .1);
    --mt-text: #eef3ff;
    --mt-muted: #9aa8c7;
    --mt-brand: #4f7cff;
    --mt-green: #22c55e;
    --mt-red: #ef4444;
    --mt-amber: #f59e0b;
}

.hidden { display: none !important; }
.mt-muted { color: var(--mt-muted); font-size: .88rem; }

/* ---------------- Lobby / host page ---------------- */
.mt-lobby { padding: 56px 0 80px; background: linear-gradient(180deg, #f6f8fc 0%, #fff 40%); min-height: 70vh; }
.mt-lobby-head { max-width: 760px; margin-bottom: 34px; }
.mt-lobby-head h1 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); line-height: 1.18; margin: 12px 0 14px; }
.mt-lobby-head p { color: var(--muted, #5b667d); font-size: 1.02rem; line-height: 1.7; }
.mt-lobby-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.mt-stack { display: grid; gap: 22px; }
.mt-card { background: #fff; border: 1px solid #e6eaf2; border-radius: 16px; padding: 24px; box-shadow: 0 8px 28px rgba(18, 34, 66, .05); }
.mt-card h2 { display: flex; align-items: center; gap: 9px; font-size: 1.13rem; margin: 0 0 8px; }
.mt-card h2 svg { color: var(--mt-brand); }
.mt-card .form-group { margin-top: 16px; }
.mt-check { display: flex; gap: 11px; align-items: flex-start; margin: 17px 0; cursor: pointer; }
.mt-check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--mt-brand); }
.mt-check b { display: block; font-size: .92rem; }
.mt-check small { display: block; color: var(--muted, #5b667d); font-size: .79rem; margin-top: 2px; }
.mt-inline-form { display: flex; gap: 9px; margin-top: 16px; }
.mt-inline-form .input { flex: 1; }
.mt-room-list { margin-top: 14px; display: grid; gap: 9px; }
.mt-room-item { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid #e9edf5; border-radius: 10px; }
.mt-room-item > div { flex: 1; min-width: 0; }
.mt-room-item b { font-size: .9rem; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-room-item small { display: block; color: var(--muted, #5b667d); font-size: .76rem; margin-top: 3px; }
.mt-room-recs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.mt-room-recs a { display: inline-flex; align-items: center; gap: 4px; font-size: .73rem; color: var(--mt-brand); text-decoration: none; background: #eef3ff; padding: 3px 7px; border-radius: 6px; }
.mt-pill { font-size: .7rem; font-weight: 700; padding: 4px 8px; border-radius: 99px; background: #eef1f6; color: #64748b; }
.mt-pill.is-live { background: #dcfce7; color: #15803d; }
.btn.btn-sm { padding: 6px 10px; font-size: .78rem; }
.mt-features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 34px; }
.mt-features > div { background: #fff; border: 1px solid #e6eaf2; border-radius: 13px; padding: 17px; }
.mt-features span { display: inline-flex; color: var(--mt-brand); margin-bottom: 9px; }
.mt-features b, .mt-features small { display: block; }
.mt-features b { font-size: .9rem; }
.mt-features small { color: var(--muted, #5b667d); font-size: .77rem; margin-top: 4px; }

/* ---------------- Meeting app shell ---------------- */
.mt-app {
    position: fixed;
    inset: 74px 0 0 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    background: var(--mt-bg);
    color: var(--mt-text);
    font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
.mt-topbar { height: 54px; flex: 0 0 54px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; background: #0e1528; border-bottom: 1px solid var(--mt-line); }
.mt-top-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mt-logo { font-weight: 800; letter-spacing: -.4px; color: #fff; }
.mt-logo span { color: #7ea0ff; }
.mt-divider { width: 1px; height: 20px; background: var(--mt-line); }
.mt-room-title { font-size: .9rem; color: #d7e0f5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }
.mt-live-badge { display: inline-flex; align-items: center; gap: 5px; font-size: .66rem; font-weight: 800; letter-spacing: .8px; padding: 4px 7px; border-radius: 5px; background: rgba(239, 68, 68, .15); color: #ff8080; }
.mt-live-badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--mt-red); animation: mtPulse 1.6s infinite; }
@keyframes mtPulse { 50% { opacity: .35; } }
.mt-top-actions { display: flex; gap: 8px; }
.mt-icon-btn { display: inline-flex; align-items: center; gap: 7px; background: #1b2440; color: #dbe5ff; border: 1px solid var(--mt-line); border-radius: 8px; padding: 7px 10px; font-size: .78rem; cursor: pointer; }
.mt-icon-btn:hover { background: #263157; }

.mt-main { flex: 1; min-height: 0; display: flex; }
.mt-stage { position: relative; flex: 1; min-width: 0; padding: 12px; overflow: hidden; }
.mt-grid { height: 100%; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); grid-auto-rows: minmax(150px, 1fr); align-content: center; overflow: auto; }
.mt-grid.mt-few { grid-auto-rows: 1fr; }
.mt-tile { position: relative; background: #10182e; border: 1px solid var(--mt-line); border-radius: 12px; overflow: hidden; min-height: 150px; display: flex; align-items: center; justify-content: center; }
.mt-tile video { width: 100%; height: 100%; object-fit: cover; background: #0d1427; }
.mt-tile.mt-local video { transform: scaleX(-1); }
.mt-tile.mt-screen { border-color: var(--mt-brand); }
.mt-tile-avatar { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 700; color: #6f82ae; background: linear-gradient(145deg, #131c34, #0d1427); }
.mt-tile-name { position: absolute; left: 8px; bottom: 8px; background: rgba(5, 10, 22, .74); backdrop-filter: blur(6px); border-radius: 6px; padding: 4px 8px; font-size: .74rem; font-weight: 600; display: flex; gap: 6px; align-items: center; }
.mt-tile-name svg { color: #ff8a8a; }
.mt-tile-mute { position: absolute; right: 8px; top: 8px; width: 26px; height: 26px; border-radius: 50%; background: rgba(5, 10, 22, .74); display: flex; align-items: center; justify-content: center; color: #ff8a8a; }

/* Waiting / ended overlays inside the stage */
.mt-waiting, .mt-ended { position: absolute; inset: 12px; z-index: 6; display: flex; align-items: center; justify-content: center; background: rgba(9, 14, 28, .88); border-radius: 12px; }
.mt-waiting-card { max-width: 430px; text-align: center; padding: 28px; }
.mt-waiting-card h2 { font-size: 1.4rem; margin: 14px 0 8px; }
.mt-waiting-card p { color: var(--mt-muted); line-height: 1.7; font-size: .9rem; }
.mt-waiting-card a { color: #8fb0ff; }
.mt-spinner { width: 38px; height: 38px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .15); border-top-color: var(--mt-brand); display: inline-block; animation: mtSpin 1s linear infinite; }
@keyframes mtSpin { to { transform: rotate(360deg); } }

/* Host panel */
.mt-host-panel { position: absolute; right: 18px; top: 18px; z-index: 8; width: 252px; max-height: calc(100% - 36px); background: rgba(17, 25, 46, .97); border: 1px solid var(--mt-line); border-radius: 12px; box-shadow: 0 16px 42px rgba(0, 0, 0, .4); display: flex; flex-direction: column; }
.mt-host-panel-head { display: flex; align-items: center; gap: 7px; padding: 11px 12px; border-bottom: 1px solid var(--mt-line); font-size: .82rem; font-weight: 700; }
.mt-host-panel-head button { margin-left: auto; background: none; border: 0; color: var(--mt-muted); font-size: 1.1rem; cursor: pointer; }
.mt-host-panel-body { overflow: auto; padding: 6px 12px 12px; }
.mt-host-section { padding: 9px 0; border-bottom: 1px solid var(--mt-line); }
.mt-host-section:last-child { border-bottom: 0; }
.mt-host-section > b { font-size: .74rem; text-transform: uppercase; letter-spacing: .6px; color: var(--mt-muted); }
.mt-host-section > div { margin-top: 7px; display: grid; gap: 6px; }
.mt-host-row { display: flex; align-items: center; gap: 6px; font-size: .78rem; }
.mt-host-row span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-host-row button { background: var(--mt-brand); color: #fff; border: 0; border-radius: 6px; padding: 4px 7px; font-size: .7rem; cursor: pointer; }
.mt-host-row button.mt-kick { background: #3a2333; color: #ff9d9d; }
.mt-rec-link { display: flex; gap: 6px; align-items: center; color: #a9c3ff; font-size: .76rem; text-decoration: none; }
.mt-rec-link small { color: var(--mt-muted); }

/* Chat */
.mt-chat { width: 310px; flex: 0 0 310px; background: var(--mt-panel); border-left: 1px solid var(--mt-line); display: flex; flex-direction: column; }
.mt-chat-head { height: 48px; flex: 0 0 48px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; border-bottom: 1px solid var(--mt-line); font-size: .88rem; }
.mt-chat-head button { background: none; border: 0; color: var(--mt-muted); cursor: pointer; }
.mt-chat-messages { flex: 1; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.mt-chat-empty { color: var(--mt-muted); font-size: .82rem; text-align: center; margin: auto 0; }
.mt-chat-msg { max-width: 92%; }
.mt-chat-msg b { display: block; color: #91b0ff; font-size: .74rem; margin-bottom: 3px; }
.mt-chat-msg p { margin: 0; background: var(--mt-panel-2); border-radius: 9px; padding: 8px 10px; font-size: .83rem; line-height: 1.5; overflow-wrap: anywhere; }
.mt-chat-msg.mt-mine { align-self: flex-end; }
.mt-chat-msg.mt-mine b { color: #8ee6b0; text-align: right; }
.mt-chat-msg.mt-mine p { background: #203d3a; }
.mt-chat-form { display: flex; gap: 7px; padding: 10px; border-top: 1px solid var(--mt-line); }
.mt-chat-form .input { flex: 1; background: #0f172b; color: #fff; border: 1px solid var(--mt-line); border-radius: 8px; padding: 9px 11px; font-size: .84rem; }
.mt-chat-form button { width: 38px; border: 0; border-radius: 8px; background: var(--mt-brand); color: #fff; cursor: pointer; }

/* Controls */
.mt-controls { height: 74px; flex: 0 0 74px; background: #0e1528; border-top: 1px solid var(--mt-line); display: flex; align-items: center; justify-content: center; gap: 12px; padding: 0 12px; }
.mt-ctrl { width: 66px; background: none; border: 0; color: var(--mt-text); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mt-ctrl-ico { width: 42px; height: 42px; border-radius: 50%; background: var(--mt-panel-2); display: flex; align-items: center; justify-content: center; transition: .15s; }
.mt-ctrl:hover .mt-ctrl-ico { background: #2b3760; }
.mt-ctrl small { font-size: .7rem; color: var(--mt-muted); }
.mt-ctrl.is-off .mt-ctrl-ico { background: #4a2230; color: #ff9d9d; }
.mt-ctrl.is-on .mt-ctrl-ico { background: var(--mt-brand); color: #fff; }
.mt-ctrl.mt-leave .mt-ctrl-ico { background: var(--mt-red); color: #fff; transform: rotate(135deg); }
.mt-ctrl.mt-end .mt-ctrl-ico { background: #6d2323; color: #ffb3b3; }
.mt-record-dot { display: inline-flex; align-items: center; gap: 5px; color: #ff8a8a !important; }
.mt-record-dot i { width: 7px; height: 7px; border-radius: 50%; background: var(--mt-red); animation: mtPulse 1.2s infinite; }

/* Join overlay */
.mt-overlay { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; background: radial-gradient(circle at 50% 20%, #1a2d5c 0%, #080d1b 60%); color: #fff; overflow: auto; }
.mt-join-card { width: 100%; max-width: 430px; background: rgba(20, 29, 53, .96); border: 1px solid var(--mt-line); border-radius: 18px; padding: 30px; box-shadow: 0 24px 70px rgba(0, 0, 0, .5); }
.mt-join-card h1 { font-size: 1.5rem; margin: 12px 0 8px; }
.mt-join-card .eyebrow { color: #8fb0ff; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.mt-join-card .form-label { color: #c7d4f0; }
.mt-join-card .input { background: #0f172b; border: 1px solid var(--mt-line); color: #fff; border-radius: 9px; }
.mt-join-card .input:focus { border-color: var(--mt-brand); outline: none; }
.mt-join-note { display: flex; gap: 7px; align-items: flex-start; color: var(--mt-muted); font-size: .75rem; line-height: 1.55; margin-top: 16px; }
.mt-join-note svg { flex: 0 0 auto; margin-top: 1px; }
.mt-join-error { margin-top: 12px; background: rgba(239, 68, 68, .13); border: 1px solid rgba(239, 68, 68, .35); color: #ffb3b3; border-radius: 8px; padding: 9px 11px; font-size: .8rem; }

/* Mobile autoplay helper */
.mt-enable-media {
    position: absolute;
    left: 50%;
    top: 18px;
    transform: translateX(-50%);
    z-index: 120;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: min(92%, 420px);
    padding: 10px 16px;
    border: 1px solid rgba(79, 124, 255, .55);
    border-radius: 999px;
    background: rgba(11, 16, 32, .94);
    color: #eef3ff;
    font: 650 .82rem Inter, system-ui, sans-serif;
    cursor: pointer;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
}
.mt-enable-media svg { color: var(--mt-brand); flex: 0 0 auto; }
.mt-enable-media small { width: 100%; color: var(--mt-muted); font-size: .7rem; font-weight: 500; }
.mt-enable-media:active { transform: translateX(-50%) scale(.98); }

/* Scheduled (not started yet) */
.mt-live-badge.is-scheduled { background: rgba(245, 158, 11, .16); color: #ffd08a; }
.mt-live-badge.is-scheduled i { background: var(--mt-amber); }
.mt-app.mt-scheduled .mt-controls { display: none; }
.mt-app.mt-scheduled #mtLeaveTop { display: none; }

/* Responsive */
@media (max-width: 900px) {
    .mt-lobby-grid { grid-template-columns: 1fr; }
    .mt-features { grid-template-columns: repeat(2, 1fr); }
    .mt-chat { position: absolute; right: 0; top: 0; bottom: 0; z-index: 12; width: min(310px, 88vw); flex-basis: auto; }
    .mt-host-panel { width: min(252px, 82vw); }
}
@media (max-width: 640px) {
    .mt-app { inset: 64px 0 0 0; }
    .mt-lobby { padding: 34px 0 60px; }
    .mt-card { padding: 19px; }
    .mt-features { grid-template-columns: 1fr; }
    .mt-room-title { max-width: 30vw; }
    .mt-icon-btn span { display: none; }
    /* Keep every live control (mic, camera, share, chat, record, leave, end)
       reachable on phones instead of letting them overflow off-screen. */
    .mt-controls {
        gap: 2px;
        height: auto;
        min-height: 66px;
        flex-basis: auto;
        padding: 6px 8px;
        justify-content: flex-start;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .mt-controls::-webkit-scrollbar { display: none; }
    .mt-ctrl { width: 50px; flex: 0 0 50px; padding: 3px 0; }
    .mt-ctrl-ico { width: 36px; height: 36px; }
    .mt-ctrl small { font-size: .62rem; }
    .mt-grid { grid-template-columns: 1fr; grid-auto-rows: minmax(180px, 1fr); }
    .mt-host-panel { right: 8px; top: 8px; max-height: 60%; }
}
@media (max-width: 380px) {
    .mt-ctrl { width: 44px; flex-basis: 44px; }
    .mt-ctrl-ico { width: 34px; height: 34px; }
    .mt-ctrl small { display: none; }
}

/* Standalone classroom window: no site header/footer, so use the whole screen. */
body.mt-standalone { margin: 0; overflow: hidden; background: var(--mt-bg); }
body.mt-standalone .mt-app { inset: 0; }
