:root {
    --sl-bg: #050609;
    --sl-surface: #111827;
    --sl-surface-soft: #0f172a;
    --sl-border: #1f2933;
    --sl-border-soft: #273549;
    --sl-text: #f9fafb;
    --sl-text-soft: #9ca3af;

    --sl-accent: #f97316;
    --sl-accent-soft: rgba(249, 115, 22, 0.14);
    --sl-danger: #f97373;

    --sl-radius-lg: 12px;
    --sl-radius-xl: 16px;
    --sl-shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.55);
    --sl-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    --sl-header-offset: 0px;
}

/* base reset */

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* non scrolling background */

html {
    height: 100%;
    background: radial-gradient(circle at top, #111827, #020617 55%, #050609 100%);
    background-attachment: fixed;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background: transparent;
}

/* page shell */

.sl-body {
    font-family: var(--sl-font);
    color: var(--sl-text);
    font-size: 14px;
    line-height: 1.4;
    padding: 5px;
}

.sl-container {
    max-width: 1100px;
    margin: 0 auto;
    background: radial-gradient(circle at top left, #111827, #020617 65%, #050609 100%);
    border-radius: 24px;
    border: 1px solid rgba(15, 23, 42, 0.85);
    box-shadow: var(--sl-shadow-soft);
    padding: 20px 22px 18px;
    overflow: visible;
}

/* header */

.sl-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 14px;
}

.sl-title {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.03em;
    margin: 0;
}

.sl-tagline {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--sl-text-soft);
}

/* player */

.sl-player-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
    padding: 14px 14px 12px;
    border-radius: var(--sl-radius-xl);
    border: 1px solid var(--sl-border);
    background: radial-gradient(circle at top left, rgba(249, 115, 22, 0.2), #020617 60%);
    background-color: #050609;
    backdrop-filter: blur(8px);
    height: 340px; /* keep your fixed pane height */
    overflow: hidden; /* new */
}

.sl-player-info {
    flex: 2 1 260px;
}

.sl-player-label {
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sl-text-soft);
    margin-bottom: 4px;
}

.sl-player-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sl-player-title {
    font-size: 15px;
    font-weight: 500;
}

.sl-player-sub {
    font-size: 12px;
    color: var(--sl-text-soft);
}

.sl-player-desc {
    margin-top: 6px;
    font-size: 13px;
    color: var(--sl-text);
    display: block;
    overflow: hidden;
}

.sl-player-tags {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;

    /* If there is a ton of tags, only show a few rows before they get clipped.
       This is a soft limit so description is not completely squeezed out. */
    max-height: 4.0em;   /* roughly 2–3 rows depending on your font size */
    overflow: hidden;
}


.sl-tag-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(249, 115, 22, 0.45);
    background: rgba(15, 23, 42, 0.95);
    color: var(--sl-text);
    padding: 2px 9px;
    font-size: 11px;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.sl-tag-chip:hover {
    border-color: var(--sl-accent);
    background: var(--sl-accent-soft);
    color: #fffbeb;
}

.sl-player-controls {
    flex: 3 1 300px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sl-player-element {
    width: 100%;
    max-height: 260px;
    border-radius: var(--sl-radius-lg);
    border: 1px solid var(--sl-border-soft);
    background-color: #020617;
}

.sl-player-downloads {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* filters */

.sl-filters {
    margin-bottom: 12px;
}

.sl-filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    padding: 10px;
    border-radius: var(--sl-radius-xl);
    border: 1px solid var(--sl-border);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(30, 64, 175, 0.5), rgba(249, 115, 22, 0.18))
}

.sl-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0px;
    flex: 1 1 120px;
}

.sl-field-inline {
    max-width: 160px;
    flex: 0 0 120px;
}

.sl-field > label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--sl-text-soft);
}

.sl-field input,
.sl-field select {
    border-radius: 999px;
    border: 1px solid var(--sl-border-soft);
    background: rgba(10, 12, 18, 0.96);
    color: var(--sl-text);
    padding: 6px 10px;
    font-size: 13px;
    outline: none;
    min-height: 28px;
}

.sl-field input[type="date"] {
    color-scheme: dark;
}

.sl-field input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.6);
    cursor: pointer;
}

.sl-field input:focus,
.sl-field select:focus {
    border-color: var(--sl-accent);
    box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.35);
}

/* buttons */

.sl-field-actions {
    align-items: flex-end;
    justify-content: flex-end;
    flex: 0 0 auto;
    padding-bottom: 3px;
}

.sl-button {
    border-radius: 999px;
    border: 1px solid var(--sl-border-soft);
    background: rgba(15, 23, 42, 0.9);
    color: var(--sl-text);
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease, color 0.1s ease;
}

.sl-button:hover {
    border-color: var(--sl-accent);
    background: var(--sl-accent-soft);
    color: #fffbeb;
}

.sl-button:active {
    transform: translateY(1px);
}

.sl-button-ghost {
    background: transparent;
}

/* table wrapper */

.sl-table-section {
    border-radius: 18px;
    border: 1px solid var(--sl-border);
    background: radial-gradient(circle at top right, #020617, #050609);
}

.sl-table-wrapper {
    border-radius: 18px 18px 0 0;
    overflow-x: hidden;
}

/* table */

.sl-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: 13px;
    table-layout: fixed;
}

/* table */

.sl-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: 13px;
    table-layout: fixed;
}

/* header background only, no stickiness */

.sl-table thead {
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.8));
}

.sl-table thead th {
    position: static;
    top: auto;
    z-index: 1;
}

/* shared cell styling */

.sl-table th,
.sl-table td {
    padding: 6px 10px;
    text-align: left;
    border-bottom: none;   /* important: no borders on individual cells */
    line-height: 1.3;
}

/* one border per row for perfect straight lines */

.sl-table thead tr {
    border-bottom: 1px solid rgba(31, 41, 55, 0.9);
}

.sl-table tbody tr {
    border-bottom: 1px solid rgba(31, 41, 55, 0.9);
}

.sl-table tbody tr:last-child {
    border-bottom: none;
}

/* header text */

.sl-table th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--sl-text-soft);
}

/* extra vertical centering and row height */

.sl-table tbody td {
    vertical-align: middle;
    padding-top: 8px;
    padding-bottom: 8px;
}

/* column widths */

.sl-table th:nth-child(1),
.sl-table td:nth-child(1) {
    width: 105px;   /* Date */
}

/* let the middle columns flex together; only pin Description width */

.sl-table th:nth-child(4),
.sl-table td:nth-child(4) {
    width: 35%;     /* Description; adjust if you want more/less space */
}

/* title / speaker / media cell */

.sl-title-cell {
    padding-top: 8px;
    padding-bottom: 8px;
}

.sl-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* title and speaker as one string; only title truncates */

.sl-title-line {
    display: flex;
    align-items: center;
    font-size: 13px;
    white-space: nowrap;
    min-width: 0;
}

.sl-title-main {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sl-speaker-inline {
    flex: 0 0 auto;
    margin-left: 6px;
    color: var(--sl-text-soft);
    white-space: nowrap;
}

/* media chips row */

.sl-title-media-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* chips */

.sl-chip {
    display: inline-block;
    border-radius: 999px;
    border: 1px solid rgba(249, 115, 22, 0.5);
    background: rgba(15, 23, 42, 0.97);
    color: var(--sl-text);
    padding: 2px 10px;
    font-size: 11px;
    line-height: 1.2;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.sl-chip:hover {
    border-color: var(--sl-accent);
    background: var(--sl-accent-soft);
    color: #fffbeb;
}

.sl-chip-active {
    border-color: var(--sl-accent);
    background: var(--sl-accent);
    color: #0b0b0b;
}

/* description clamp */

.sl-cell-desc {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    max-height: 3.2em;   /* enough room for 2 full lines */
}

/* row states */

.sl-row {
    cursor: pointer;
    transition: background 0.15s ease;
}

.sl-row:hover {
    background: rgba(15, 23, 42, 0.9);
}

.sl-row-active {
    background: linear-gradient(90deg, rgba(249, 115, 22, 0.28), rgba(30, 64, 175, 0.5)) !important;
}

/* pagination */

.sl-pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 12px 8px;
    border-top: 1px solid var(--sl-border);
    border-radius: 0 0 18px 18px;
    background: radial-gradient(circle at bottom left, #020617, #050609);
}

.sl-page-size {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.sl-page-size select {
    border-radius: 999px;
    border: 1px solid var(--sl-border-soft);
    background: rgba(10, 12, 18, 0.96);
    color: var(--sl-text);
    padding: 3px 8px;
    font-size: 12px;
}

.sl-page-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sl-page-info {
    font-size: 12px;
    color: var(--sl-text-soft);
}

/* footer */

.sl-footer {
    margin-top: 10px;
    text-align: center;
    font-size: 11px;
    color: var(--sl-text-soft);
    opacity: 0.7;
}

/* mobile */

@media (max-width: 708px) {
    :root {
        --sl-header-offset: 0px;
    }

    .sl-body {
        padding: 10px;
    }

    .sl-container {
        padding: 12px;
        border-radius: 18px;
        box-shadow: none;
        border-width: 1px;
        overflow: visible;
    }

    .sl-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    /* sticky sermon pane under the header on mobile */
    .sl-player-panel {
        position: sticky;
        top: 0;
        z-index: 60;
        margin-bottom: 8px;
        height: auto;
        min-height: 340px; /* keep full video height */
    }

    .sl-filters-row {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 6px 8px;
        background: linear-gradient(
            135deg,
            rgba(15, 23, 42, 0.98),
            rgba(30, 64, 175, 0.7),
            rgba(249, 115, 22, 0.24)
        );
        background-color: #050609;
        backdrop-filter: blur(8px);
    }

    .sl-field,
    .sl-field-inline {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        flex: 0 0 auto;
        display: flex;
        flex-direction: column;
        gap: 1px;
        margin: 0;
        padding: 0;
    }

    .sl-field > label {
        font-size: 10px;
        margin: 0;
        line-height: 1.1;
    }

    .sl-field input,
    .sl-field select {
        padding: 4px 8px;
        min-height: 22px;
        font-size: 12px;
    }

    .sl-table-section {
        border-radius: 16px;
    }

    .sl-table-wrapper {
        overflow-x: hidden;
    }

    /* header not sticky on mobile */
    .sl-table thead th {
        position: static;
        top: auto;
    }

    /* hide description column on narrow screens if needed */
    .sl-table th:nth-child(3),
    .sl-table td:nth-child(3) {
        display: none;
    }

    .sl-pagination-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .sl-page-controls {
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .sl-body {
        padding: 8px;
    }

    .sl-container {
        padding: 10px;
        border-radius: 14px;
    }

    .sl-player-panel {
        margin-bottom: 6px;
    }

    .sl-title {
        font-size: 18px;
    }

    .sl-tagline {
        font-size: 11px;
    }

    .sl-table th,
    .sl-table td {
        padding: 6px 8px;
        font-size: 12px;
    }
}

/* Global disabled state in the media app (non embed) */
html:not(.eocc-embed-mode) .sl-button:disabled,
html:not(.eocc-embed-mode) .sl-button[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ============================================
   EMBED MODE – HIGHER CONTRAST, READABLE THEME
   ============================================ */

/* Applied when <html class="eocc-embed-mode"> */
html.eocc-embed-mode {
    background: #f4f4f4 !important;
}

/* Overall background and container */
html.eocc-embed-mode body,
html.eocc-embed-mode .sl-container {
    background: #f4f4f4 !important;
    border: none !important;
    box-shadow: none !important;
}

/* Panels and table section */
html.eocc-embed-mode .sl-player-panel,
html.eocc-embed-mode .sl-filters-row,
html.eocc-embed-mode .sl-table-section {
    background: #ffffff !important;
    border: 1px solid #c5c5c5 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

/* Player element (removes odd dark box look) */
html.eocc-embed-mode .sl-player-element {
    background: #ffffff !important;
    border-color: #c0c0c0 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08) !important;
}

/* Hide big site header in embeds */
html.eocc-embed-mode .sl-page-header {
    display: none !important;
}

/* Table header and rows */
html.eocc-embed-mode .sl-table thead {
    background: #e1e1e1 !important;
}

html.eocc-embed-mode .sl-table thead th {
    color: #333333 !important;
}

html.eocc-embed-mode .sl-table td {
    color: #222222 !important;
}

html.eocc-embed-mode .sl-row:hover {
    background: #f3f3f3 !important;
}

html.eocc-embed-mode .sl-row-active {
    background: #ffdcb8 !important; /* warm orange highlight */
}

/* Form fields – crisp and readable */
html.eocc-embed-mode input,
html.eocc-embed-mode select {
    background: #ffffff !important;
    color: #222222 !important;
    border: 1px solid #b3b3b3 !important;
}

html.eocc-embed-mode input::placeholder {
    color: #8a8a8a !important;
}

html.eocc-embed-mode input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0) brightness(0.3) !important;
}

/* Buttons – readable and with clear hover */
html.eocc-embed-mode .sl-button {
    background: #ffffff !important;
    color: #333333 !important;
    border: 1px solid #b3b3b3 !important;
}

html.eocc-embed-mode .sl-button:hover {
    background: #f97316 !important;
    color: #ffffff !important;
    border-color: #f97316 !important;
}

/* Disabled button state (for Clear filters etc) */
html.eocc-embed-mode .sl-button:disabled,
html.eocc-embed-mode .sl-button[disabled] {
    background: #f0f0f0 !important;
    color: #aaaaaa !important;
    border-color: #d4d4d4 !important;
    cursor: not-allowed !important;
}

/* Chips and tag chips – keep orange pop but improve contrast */
html.eocc-embed-mode .sl-chip,
html.eocc-embed-mode .sl-tag-chip {
    background: #fff7ef !important;
    border-color: rgba(249, 115, 22, 0.7) !important;
    color: #333333 !important;
}

html.eocc-embed-mode .sl-chip:hover,
html.eocc-embed-mode .sl-tag-chip:hover {
    background: #f97316 !important;
    border-color: #f97316 !important;
    color: #ffffff !important;
}

html.eocc-embed-mode .sl-chip-active {
    background: #f97316 !important;
    border-color: #f97316 !important;
    color: #ffffff !important;
}

/* Embed mode - improve text contrast */

/* Speaker in table rows */
html.eocc-embed-mode .sl-speaker-inline {
    color: #555555 !important;
    font-style: italic !important;
}

/* Top pane label and details */
html.eocc-embed-mode .sl-player-label {
    color: #888888 !important;
}

html.eocc-embed-mode .sl-player-title {
    color: #222222 !important;
    font-weight: 600 !important;
}

html.eocc-embed-mode .sl-player-sub {
    color: #444444 !important;
}

/* Description in top pane */
html.eocc-embed-mode .sl-player-desc {
    color: #444444 !important;
}

/* Tag chips text in top pane */
html.eocc-embed-mode .sl-tag-chip {
    color: #333333 !important;
}

/* Player pane layout clean up */

/* Do not clamp description or tags from CSS.
   JS will manage this dynamically. */
#player-desc,
.sl-player-desc {
    max-height: none;
}

#player-tags,
.sl-player-tags {
    max-height: none;
}

/* Make sure extra content is not allowed to spill outside the card */
.sl-player-panel {
    overflow: hidden;
}


