/* Ronald Experiencias — Hub Interactive (chat, Q&A, polls) */

/* ── Container ───────────────────────────────────────────────── */
.rex-hub-interactive {
    margin-top: 52px;
    border-top: 1px solid var(--rex-line);
    padding-top: 44px;
}
.rex-hub-interactive > h2 {
    font-size: clamp(26px, 3.5vw, 38px);
    margin: 0 0 28px;
    color: var(--rex-navy);
    font-family: var(--font-primary, 'Libre Caslon Display', Georgia, serif);
    font-weight: 400;
}

/* ── Tabs ────────────────────────────────────────────────────── */
.rex-hub-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--rex-line);
    margin-bottom: 28px;
    list-style: none;
    padding: 0;
    margin-top: 0;
}
.rex-hub-tabs [role="tab"] {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .04em;
    padding: 10px 20px;
    margin-bottom: -2px;
    color: var(--rex-ink);
    transition: color .16s, border-color .16s;
}
.rex-hub-tabs [role="tab"]:hover { color: var(--rex-navy); }
.rex-hub-tabs [role="tab"][aria-selected="true"] {
    color: var(--rex-navy);
    border-bottom-color: var(--rex-navy);
}
.rex-hub-tabs [role="tab"]:focus-visible { outline: 2px solid var(--rex-navy); outline-offset: 2px; }

/* ── Panel wrapper ───────────────────────────────────────────── */
[role="tabpanel"] { outline: none; }

/* ── Chat ────────────────────────────────────────────────────── */
.rex-chat-list {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--rex-line);
    background: #fff;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.rex-chat-msg { display: flex; flex-direction: column; gap: 2px; }
.rex-chat-name { font-size: 12px; font-weight: 700; color: var(--rex-navy); letter-spacing: .04em; }
.rex-chat-body { font-size: 15px; line-height: 1.55; word-break: break-word; }
.rex-chat-form { display: flex; gap: 8px; }
.rex-chat-form input[type="text"] {
    flex: 1;
    border: 1px solid #aeb4b8;
    padding: 10px 12px;
    font: inherit;
    font-size: 15px;
    min-height: 44px;
}
.rex-chat-form input:focus { border-color: var(--rex-navy); outline: 2px solid color-mix(in srgb, var(--rex-navy) 25%, transparent); outline-offset: 1px; }
.rex-chat-form button { white-space: nowrap; background: var(--rex-navy); color: #fff; border: 1px solid var(--rex-navy); padding: 10px 18px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; min-height: 44px; transition: background .16s; }
.rex-chat-form button:hover { background: #1e304b; }
.rex-chat-form button:disabled { opacity: .5; cursor: not-allowed; }

/* ── Q&A ─────────────────────────────────────────────────────── */
.rex-qa-list { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-direction: column; gap: 0; }
.rex-qa-item { display: flex; align-items: flex-start; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--rex-line); }
.rex-qa-item:first-child { border-top: 1px solid var(--rex-line); }
.rex-qa-body { flex: 1; font-size: 15px; line-height: 1.55; margin: 0; }
.rex-qa-answered .rex-qa-body { opacity: .6; }
.rex-qa-meta { font-size: 12px; color: #2ea04d; font-weight: 700; white-space: nowrap; }
.rex-qa-upvote { background: none; border: 1px solid var(--rex-line); color: var(--rex-navy); cursor: pointer; font: inherit; font-size: 13px; font-weight: 700; padding: 4px 10px; min-height: 32px; transition: background .16s, color .16s; flex-shrink: 0; }
.rex-qa-upvote:hover { background: var(--rex-navy); color: #fff; border-color: var(--rex-navy); }
.rex-qa-form { display: flex; flex-direction: column; gap: 10px; max-width: 560px; }
.rex-qa-form textarea { border: 1px solid #aeb4b8; font: inherit; font-size: 15px; min-height: 80px; padding: 10px 12px; resize: vertical; }
.rex-qa-form textarea:focus { border-color: var(--rex-navy); outline: 2px solid color-mix(in srgb, var(--rex-navy) 25%, transparent); outline-offset: 1px; }
.rex-qa-form label { font-size: 14px; display: flex; align-items: center; gap: 8px; }
.rex-qa-form button[type="submit"] { align-self: flex-start; background: var(--rex-navy); border: 1px solid var(--rex-navy); color: #fff; cursor: pointer; font: inherit; font-size: 14px; font-weight: 700; padding: 10px 20px; min-height: 44px; transition: background .16s; }
.rex-qa-form button[type="submit"]:hover { background: #1e304b; }
.rex-qa-form button:disabled { opacity: .5; cursor: not-allowed; }

/* ── Polls ───────────────────────────────────────────────────── */
.rex-polls-list { display: flex; flex-direction: column; gap: 28px; }
.rex-poll { background: var(--rex-paper); padding: 20px 24px; }
.rex-poll-question { font-weight: 700; font-size: 16px; margin: 0 0 16px; color: var(--rex-navy); }
.rex-poll-option { margin-bottom: 8px; }
.rex-poll-vote-btn { background: #fff; border: 1px solid var(--rex-navy); color: var(--rex-navy); cursor: pointer; font: inherit; font-size: 14px; font-weight: 600; padding: 9px 18px; min-height: 40px; width: 100%; text-align: left; transition: background .16s, color .16s; }
.rex-poll-vote-btn:hover { background: var(--rex-navy); color: #fff; }
.rex-poll-bar { position: relative; height: 28px; background: var(--rex-line); margin-bottom: 4px; overflow: hidden; }
.rex-poll-bar::before { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--pct, 0%); background: var(--rex-navy); opacity: .7; transition: width .4s ease; }
.rex-poll-bar + span { font-size: 13px; }

/* ── Video section ───────────────────────────────────────────── */
.rex-event-video { border-top: 1px solid var(--rex-line); padding-top: 44px; margin-bottom: 48px; }
.rex-event-video h2 { font-size: clamp(26px, 3.5vw, 38px); margin: 0 0 20px; color: var(--rex-navy); font-family: var(--font-primary, 'Libre Caslon Display', Georgia, serif); font-weight: 400; }
.rex-video-frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.rex-video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }
.rex-video-external { margin-top: 12px; font-size: 14px; }
.rex-video-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #111; color: #fff; font-size: 14px; pointer-events: none; }

/* ── Resources section ───────────────────────────────────────── */
.rex-event-resources { border-top: 1px solid var(--rex-line); padding-top: 44px; margin-bottom: 48px; }
.rex-event-resources h2 { font-size: clamp(26px, 3.5vw, 38px); margin: 0 0 24px; color: var(--rex-navy); font-family: var(--font-primary, 'Libre Caslon Display', Georgia, serif); font-weight: 400; }
.rex-resource-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0; }
.rex-resource-item { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--rex-line); }
.rex-resource-item:first-child { border-top: 1px solid var(--rex-line); }
.rex-resource-icon { font-size: 18px; flex-shrink: 0; width: 28px; text-align: center; }
.rex-resource-info { flex: 1; min-width: 0; }
.rex-resource-title { font-weight: 700; font-size: 15px; }
.rex-resource-link { display: inline-flex; align-items: center; gap: 6px; color: var(--rex-navy); font-size: 13px; font-weight: 700; letter-spacing: .04em; text-decoration: none; border: 1px solid var(--rex-navy); padding: 6px 14px; min-height: 36px; transition: background .16s, color .16s; }
.rex-resource-link:hover { background: var(--rex-navy); color: #fff; }

/* ── Stats admin ─────────────────────────────────────────────── */
.rex-stats-bar-wrap { background: var(--rex-line); height: 20px; position: relative; overflow: hidden; }
.rex-stats-bar { height: 100%; background: var(--rex-navy); opacity: .7; transition: width .4s ease; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 600px) {
    .rex-hub-tabs [role="tab"] { padding: 8px 14px; font-size: 13px; }
    .rex-chat-form { flex-direction: column; }
    .rex-chat-form button { width: 100%; }
    .rex-video-frame { aspect-ratio: 4 / 3; }
}

/* ── Reduced motion ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .rex-poll-bar::before, .rex-stats-bar { transition: none; }
}
