:root {
    --dabur-green: #006b3f;
    --dabur-dark-green: #004b2c;
    --dabur-soft-green: #e9f7ef;
    --dabur-bg: #f4fbf6;
    --dabur-gold: #d5a021;
    --white: #ffffff;
    --text: #1e293b;
    --muted: #5f718c;
    --border: #dbe7df;
    --danger: #b91c1c;
    --success: #047857;
    --shadow: 0 18px 55px rgba(0, 75, 44, 0.10);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    font-family: Inter, Arial, Helvetica, sans-serif;
    color: var(--text);
    background: var(--dabur-bg);
}

/* =========================
   AUTH / LOGIN PAGE
========================= */

.auth-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(0, 107, 63, 0.18), transparent 36%),
        radial-gradient(circle at bottom right, rgba(213, 160, 33, 0.12), transparent 32%),
        linear-gradient(135deg, #f7fff9 0%, #e8f5ec 45%, #ffffff 100%);
}

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 16px;
}

.auth-card {
    width: 100%;
    max-width: 500px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(0, 107, 63, 0.14);
    border-radius: 28px;
    padding: 38px;
    box-shadow: 0 24px 80px rgba(0, 75, 44, 0.16);
    backdrop-filter: blur(12px);
}

.auth-card.small {
    max-width: 430px;
}

.brand-box {
    text-align: center;
    margin-bottom: 28px;
}

.brand-box img {
    height: 76px;
    max-width: 180px;
    object-fit: contain;
    margin-bottom: 16px;
}

.brand-box h1 {
    color: var(--dabur-dark-green);
    font-size: 30px;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    line-height: 1.15;
}

.brand-box p {
    color: var(--muted);
    font-size: 15px;
}

.login-form label,
.qa-card label,
.settings-card label {
    display: block;
    margin: 14px 0 7px;
    font-weight: 700;
    color: var(--dabur-dark-green);
    font-size: 14px;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 15px;
    font-size: 15px;
    outline: none;
    background: #fff;
    color: var(--text);
    transition: 0.2s ease;
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--dabur-green);
    box-shadow: 0 0 0 4px rgba(0, 107, 63, 0.11);
}

button {
    border: none;
    cursor: pointer;
    border-radius: 14px;
    padding: 14px 18px;
    background: linear-gradient(135deg, var(--dabur-green), var(--dabur-dark-green));
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    transition: 0.2s ease;
    width: 100%;
    margin-top: 20px;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(0, 107, 63, 0.22);
}

.auth-footer {
    margin-top: 22px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

.alert {
    padding: 13px 15px;
    border-radius: 14px;
    margin-bottom: 18px;
    font-weight: 700;
    font-size: 14px;
}

.alert.error {
    background: #fee2e2;
    color: var(--danger);
}

.alert.success {
    background: #d1fae5;
    color: var(--success);
}

/* =========================
   WEBCAST PAGE
========================= */

.webcast-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 15%, rgba(0, 107, 63, 0.08), transparent 26%),
        radial-gradient(circle at 85% 30%, rgba(0, 107, 63, 0.10), transparent 28%),
        linear-gradient(180deg, #f8fff9 0%, #edf8f1 100%);
}

.main-header {
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid rgba(0, 107, 63, 0.12);
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(12px);
}

.header-inner {
    max-width: 1360px;
    margin: auto;
    padding: 16px 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-brand img {
    height: 58px;
    max-width: 150px;
    object-fit: contain;
}

.header-brand h2 {
    color: var(--dabur-dark-green);
    font-size: 23px;
    line-height: 1.1;
}

.header-brand p {
    color: var(--muted);
    font-size: 14px;
    margin-top: 3px;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
    color: var(--muted);
}

.header-user a {
    color: #fff;
    background: var(--dabur-green);
    padding: 10px 16px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 800;
}

.webcast-container {
    max-width: 1360px;
    margin: auto;
    padding: 28px 26px 42px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 370px;
    gap: 28px;
    align-items: start;
}

.video-section {
    min-width: 0;
}

.section-title {
    margin-bottom: 18px;
}

.section-title h1 {
    color: var(--dabur-dark-green);
    font-size: 34px;
    margin-bottom: 8px;
    line-height: 1.15;
}

.section-title p {
    color: var(--muted);
    font-size: 16px;
}

/* 
   IMPORTANT:
   This is intentionally NOT fixed height.
   Your Cloudflare embed wrapper controls the ratio:
   <div style="position: relative; padding-top: 56.25%;">
*/
.video-frame {
    width: 100%;
    background: #ffffff;
    border-radius: 26px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 107, 63, 0.18);
    position: relative;
}

/* Ensures iframe/embed fills properly without creating extra black space */
.video-frame iframe {
    width: 100%;
    border: none;
    display: block;
}

/* If admin pasted a Cloudflare wrapper div, make it clean */
.video-frame > div {
    width: 100%;
    background: #ffffff;
}

/* If iframe URL mode is used directly without wrapper */
.video-frame > iframe {
    height: auto;
    aspect-ratio: 16 / 9;
}

/* Placeholder only when no video is configured */
.video-placeholder {
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    color: var(--dabur-dark-green);
    padding: 30px;
    background: linear-gradient(135deg, #ffffff, #eef8f1);
}

.video-placeholder h3 {
    font-size: 28px;
    margin-bottom: 10px;
}

.video-placeholder p {
    color: var(--muted);
}

.qa-section {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding-top: 0;
}

.qa-card,
.info-card,
.settings-card,
.table-card,
.stat-card {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(0, 107, 63, 0.14);
    border-radius: 24px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.qa-card h2 {
    color: var(--dabur-dark-green);
    margin-bottom: 8px;
    font-size: 25px;
    line-height: 1.2;
}

.qa-card p {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 14px;
}

.qa-card textarea {
    min-height: 135px;
}

.info-card h3 {
    color: var(--dabur-dark-green);
    margin-bottom: 12px;
    font-size: 18px;
}

.info-card {
    color: var(--muted);
    font-size: 14px;
}

.info-card ul {
    padding-left: 20px;
    margin-top: 12px;
}

.info-card li {
    margin-bottom: 9px;
    line-height: 1.35;
}

/* =========================
   ADMIN PANEL
========================= */

.admin-body {
    background: #f5f8f6;
}

.admin-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px 1fr;
}

.admin-sidebar {
    background: linear-gradient(180deg, var(--dabur-dark-green), #00351f);
    padding: 28px 20px;
    color: #fff;
}

.admin-sidebar img {
    max-width: 150px;
    background: #fff;
    padding: 10px;
    border-radius: 16px;
    margin-bottom: 28px;
}

.admin-sidebar a {
    display: block;
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    padding: 13px 15px;
    border-radius: 13px;
    margin-bottom: 8px;
    font-weight: 700;
}

.admin-sidebar a.active,
.admin-sidebar a:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.admin-main {
    padding: 36px;
}

.admin-main h1 {
    color: var(--dabur-dark-green);
    font-size: 32px;
    margin-bottom: 8px;
}

.admin-main > p {
    color: var(--muted);
    margin-bottom: 28px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.stat-card h3 {
    color: var(--muted);
    font-size: 15px;
    margin-bottom: 12px;
}

.stat-card strong {
    color: var(--dabur-green);
    font-size: 34px;
}

.table-card {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    color: var(--dabur-dark-green);
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    padding: 14px;
    white-space: nowrap;
}

td {
    border-bottom: 1px solid var(--border);
    padding: 14px;
    vertical-align: top;
    font-size: 14px;
}

.status {
    display: inline-block;
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.status.pending {
    background: #fef3c7;
    color: #92400e;
}

.status.approved {
    background: #d1fae5;
    color: #065f46;
}

.status.answered {
    background: #dbeafe;
    color: #1e40af;
}

.status.rejected {
    background: #fee2e2;
    color: #991b1b;
}

.inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.inline-form select {
    min-width: 120px;
    padding: 9px;
}

.inline-form button {
    width: auto;
    margin: 0;
    padding: 10px 13px;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 10px;
}

.checkbox-label input {
    width: auto;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1180px) {
    .webcast-container {
        grid-template-columns: 1fr;
    }

    .qa-section {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 18px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .auth-wrapper {
        align-items: flex-start;
        padding-top: 24px;
    }

    .auth-card {
        padding: 28px 22px;
        border-radius: 22px;
    }

    .brand-box img {
        height: 66px;
    }

    .brand-box h1 {
        font-size: 25px;
    }

    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        padding: 14px 16px;
    }

    .header-brand {
        gap: 12px;
    }

    .header-brand img {
        height: 50px;
        max-width: 120px;
    }

    .header-brand h2 {
        font-size: 20px;
    }

    .header-brand p {
        font-size: 13px;
    }

    .header-user {
        width: 100%;
        justify-content: space-between;
    }

    .webcast-container {
        padding: 20px 14px 30px;
        gap: 20px;
    }

    .section-title {
        margin-bottom: 14px;
    }

    .section-title h1 {
        font-size: 26px;
    }

    .section-title p {
        font-size: 14px;
    }

    .video-frame {
        border-radius: 18px;
    }

    .video-placeholder {
        min-height: 220px;
    }

    .video-placeholder h3 {
        font-size: 21px;
    }

    .qa-section {
        display: flex;
        flex-direction: column;
    }

    .qa-card,
    .info-card {
        border-radius: 20px;
        padding: 20px;
    }

    .qa-card h2 {
        font-size: 22px;
    }

    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: relative;
    }

    .admin-main {
        padding: 24px 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}
/* ------------------------------------------------------------------
   Participant management + live session notices (added for allow-list
   login, force sign-out and blocking).
   ------------------------------------------------------------------ */

/* The base sheet makes every input/select/button full width, which is right
   for the stacked auth + settings forms but wrong for these toolbars. */
.filter-bar input,
.filter-bar select,
.filter-bar button,
.bulk-bar button,
.btn-plain,
table input[type="checkbox"] {
    width: auto;
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
}

.stats-grid.compact {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 18px;
}

.stat-card.highlight {
    border-color: var(--dabur-green);
    background: var(--dabur-soft-green);
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
}

.filter-bar input[type="text"] {
    flex: 1 1 240px;
    min-width: 180px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
}

.filter-bar select {
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--white);
}

.filter-bar button {
    padding: 9px 18px;
    border: 0;
    border-radius: 8px;
    background: var(--dabur-green);
    color: var(--white);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    flex: 0 0 auto;
}

.filter-bar .btn-plain { padding: 9px 16px; }

.bulk-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 14px 18px;
    background: var(--dabur-soft-green);
    border-bottom: 1px solid var(--border);
}

.bulk-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--dabur-dark-green);
    margin-right: 4px;
}

.bulk-bar button,
.btn-plain {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--white);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.bulk-bar button:hover,
.btn-plain:hover { border-color: var(--dabur-green); }

.bulk-bar .btn-danger { background: var(--danger); border-color: var(--danger); color: var(--white); }
.bulk-bar .btn-warn   { background: var(--dabur-gold); border-color: var(--dabur-gold); color: #3a2c00; }
.bulk-bar .btn-ok     { background: var(--success); border-color: var(--success); color: var(--white); }

.bulk-bar .pull-right { margin-left: auto; }

tr.row-blocked { background: #fff5f5; }

.pager {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;
    padding: 16px;
    border-top: 1px solid var(--border);
    font-size: 14px;
    color: var(--muted);
}

.pager a {
    color: var(--dabur-green);
    font-weight: 600;
    text-decoration: none;
}

/* Full-screen notice shown when an admin ends a viewer's session. */
.dt-notice {
    position: fixed;
    inset: 0;
    background: rgba(0, 40, 24, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 24px;
}

.dt-notice[hidden] { display: none; }

.dt-notice-box {
    background: var(--white);
    border-radius: 16px;
    padding: 34px 30px;
    max-width: 420px;
    text-align: center;
    box-shadow: var(--shadow);
}

.dt-notice-box h3 {
    margin: 0 0 10px;
    font-size: 22px;
    color: var(--danger);
}

.dt-notice-box p {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
}

@media (max-width: 860px) {
    .table-card { overflow-x: auto; }
    .bulk-bar .pull-right { margin-left: 0; }
}
