:root {
    --gold: #d4af37;
    --gold-dark: #b8962e;
    --gold-light: #fef3c7;
    --text-dark: #1a1a1a;
    --text-body: #333;
    --text-muted: #666;
    --text-light: #888;
    --bg: #fafafa;
    --card-bg: #fff;
    --border: #eee;
    --danger: #dc2626;
    --success: #16a34a;
}

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

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body.modal-open { overflow: hidden; }

h1, h2, h3 {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
}

.container {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 16px;
}

.video-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
}

.video-header .container,
.video-logo,
.video-nav {
    display: flex;
    align-items: center;
}

.video-header .container {
    justify-content: space-between;
    gap: 14px;
}

.video-logo {
    gap: 10px;
    text-decoration: none;
    color: var(--text-dark);
    min-width: 0;
}

.video-logo img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    object-fit: cover;
    flex: 0 0 auto;
}

.video-logo-title {
    font-size: 0.8125rem;
    font-weight: 700;
    white-space: nowrap;
}

.video-logo-sub {
    font-size: 0.625rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.video-nav {
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.video-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 7px 10px;
    border-radius: 999px;
}

.video-nav a:hover,
.video-nav a.active {
    color: #1a1a1a;
    background: var(--gold-light);
}

.video-nav a:focus-visible,
.video-filter:focus-visible,
.video-thumb-button:focus-visible,
.modal-close:focus-visible,
.admin-video button:focus-visible,
.admin-video input:focus-visible,
.admin-video select:focus-visible {
    outline: 3px solid rgba(212,175,55,0.45);
    outline-offset: 2px;
}

.video-hero {
    padding: 42px 0 20px;
    text-align: center;
}

.video-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--gold-dark);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.video-hero h1 {
    color: var(--text-dark);
    font-size: clamp(2rem, 6vw, 3.25rem);
    line-height: 1.08;
    margin-bottom: 12px;
    overflow-wrap: anywhere;
}

.video-hero p {
    max-width: 680px;
    margin: 0 auto;
    color: var(--text-muted);
    font-size: 1rem;
}

.video-filters-section {
    padding: 12px 0 18px;
}

.video-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    min-width: 0;
}

.video-filter {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-muted);
    border-radius: 999px;
    padding: 8px 14px;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
}

.video-filter:hover,
.video-filter.active {
    border-color: var(--gold);
    background: var(--gold);
    color: #1a1a1a;
}

.video-section {
    padding: 8px 0 42px;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.video-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.video-thumb-button {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    background: #111;
    cursor: pointer;
}

.video-thumb-button img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.video-play-badge {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(212,175,55,0.92);
    color: #1a1a1a;
    box-shadow: 0 8px 24px rgba(0,0,0,0.22);
}

.video-card-body {
    padding: 14px;
}

.video-category {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 3px 9px;
    background: var(--gold-light);
    color: #854d0e;
    font-size: 0.6875rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.video-category-umum { background: #e0f2fe; color: #075985; }
.video-category-rakaman-live { background: #fee2e2; color: #991b1b; }

.video-title {
    color: var(--text-dark);
    font-size: 1rem;
    line-height: 1.35;
    margin-bottom: 10px;
}

.video-description {
    color: var(--text-muted);
    font-size: 0.8125rem;
    line-height: 1.5;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-light);
    font-size: 0.8125rem;
}

.video-state {
    text-align: center;
    padding: 42px 18px;
    color: var(--text-muted);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow-wrap: anywhere;
}

.video-state i {
    display: block;
    color: var(--gold);
    font-size: 2rem;
    margin-bottom: 10px;
}

.video-state h2 {
    color: var(--text-dark);
    font-size: 1.125rem;
    margin-bottom: 4px;
}

.video-footer {
    padding: 18px 0 24px;
    background: #1a1a1a;
    color: #888;
    text-align: center;
    font-size: 0.8125rem;
}

.video-footer a {
    color: #aaa;
    text-decoration: none;
}

.video-footer a:hover { color: var(--gold); }

.video-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
}

.video-modal[hidden] { display: none; }

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.72);
    padding: 24px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-modal-card {
    width: min(920px, 100%);
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 24px 72px rgba(0,0,0,0.35);
}

.video-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}

.video-modal-header h2 {
    font-size: 1rem;
    color: var(--text-dark);
    line-height: 1.35;
}

.modal-close {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.25rem;
}

.video-frame-wrap {
    aspect-ratio: 16 / 9;
    background: #000;
}

.video-frame-wrap iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.admin-video {
    min-height: 100vh;
    background: #f0f2f5;
    color: var(--text-dark);
    font-family: 'Inter', sans-serif;
}

.admin-video .login-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fef3c7, #fff);
    padding: 20px;
}

.admin-video .login-card,
.admin-video .panel,
.admin-video .admin-card,
.admin-video .admin-modal-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.admin-video .login-card {
    width: min(420px, 100%);
    padding: 34px 28px;
    text-align: center;
}

.admin-video .app-shell {
    display: none;
    min-height: 100vh;
}

.admin-video.authenticated .app-shell {
    display: flex;
}

.admin-video.authenticated .login-overlay {
    display: none;
}

.admin-video .sidebar {
    width: 240px;
    position: fixed;
    inset: 0 auto 0 0;
    background: #1a1a2e;
    color: #ccc;
    padding: 24px 0;
    display: flex;
    flex-direction: column;
}

.admin-video .sidebar-brand {
    padding: 0 20px 22px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.admin-video .sidebar-brand h1 {
    font-size: 1.1rem;
    color: #fff;
}

.admin-video .sidebar-brand span {
    font-size: 0.78rem;
    color: #888;
}

.admin-video .sidebar-nav {
    padding: 16px 0;
}

.admin-video .sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #aaa;
    text-decoration: none;
    padding: 11px 20px;
    font-size: 0.9rem;
}

.admin-video .sidebar-nav a:hover,
.admin-video .sidebar-nav a.active {
    background: rgba(255,255,255,0.08);
    color: #f5c518;
}

.admin-video .main {
    margin-left: 240px;
    flex: 1;
    padding: 24px;
    min-width: 0;
}

.admin-video .topbar {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    margin-bottom: 20px;
}

.admin-video .topbar h1 {
    font-size: 1.5rem;
}

.admin-video .toolbar,
.admin-video .form-row,
.admin-video .list-filters,
.admin-video .actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-video .panel {
    padding: 18px;
    margin-bottom: 18px;
}

.admin-video .form-row {
    margin-bottom: 12px;
}

.admin-video .form-field {
    flex: 1 1 220px;
}

.admin-video label {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 800;
    margin-bottom: 5px;
}

.admin-video input,
.admin-video select {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 9px 10px;
    font: inherit;
    background: #fff;
}

.admin-video .checkbox-field {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 24px;
}

.admin-video .checkbox-field input {
    width: auto;
}

.admin-video .btn {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text-dark);
    padding: 9px 13px;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.admin-video .btn-primary {
    background: var(--gold);
    border-color: var(--gold);
}

.admin-video .btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.admin-video .btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

.admin-video .form-error {
    color: var(--danger);
    font-size: 0.8125rem;
    margin-top: 6px;
    min-height: 1.2em;
}

.admin-video .table-wrap {
    overflow-x: auto;
}

.admin-video table {
    width: 100%;
    border-collapse: collapse;
    min-width: 820px;
}

.admin-video th,
.admin-video td {
    padding: 12px 10px;
    border-bottom: 1px solid #f1f1f1;
    text-align: left;
    font-size: 0.875rem;
    vertical-align: middle;
}

.admin-video th {
    color: var(--text-light);
    text-transform: uppercase;
    font-size: 0.6875rem;
    letter-spacing: 0.05em;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 0.6875rem;
    font-weight: 800;
}

.status-badge.published {
    background: #dcfce7;
    color: #166534;
}

.status-badge.unpublished {
    background: #f3f4f6;
    color: #4b5563;
}

.admin-video .state {
    padding: 28px;
    text-align: center;
    color: var(--text-muted);
}

.admin-video .toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1200;
    padding: 12px 14px;
    border-radius: 8px;
    color: #fff;
    font-weight: 700;
    font-size: 0.875rem;
    background: #1f2937;
}

.admin-video .toast.success { background: var(--success); }
.admin-video .toast.error { background: var(--danger); }

.admin-video .admin-modal[hidden] { display: none; }

.admin-video .drag-handle {
    cursor: grab;
    color: #adb5bd;
    text-align: center;
    padding: 12px 6px !important;
}

.admin-video .drag-handle:active { cursor: grabbing; }

.admin-video .sortable-chosen td { background: #fef9e7 !important; }

.admin-video .sortable-ghost { opacity: 0.4; }

.admin-video .sortable-drag { opacity: 0.9; box-shadow: 0 8px 24px rgba(0,0,0,0.15); }

.admin-video .order-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.admin-video textarea#shortDescription {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 9px 10px;
    font: inherit;
    resize: vertical;
    min-height: 60px;
}

.admin-video textarea#shortDescription:focus {
    outline: 3px solid rgba(212,175,55,0.45);
    outline-offset: 2px;
    border-color: var(--gold);
}

@media (max-width: 900px) {

.admin-video .admin-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
}

.admin-video .admin-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.58);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.admin-video .admin-modal-card {
    width: min(460px, 100%);
    padding: 18px;
}

.admin-video .admin-modal-card h2 {
    font-size: 1.125rem;
    margin-bottom: 8px;
}

.admin-video .admin-modal-card p {
    color: var(--text-muted);
    margin-bottom: 16px;
}

@media (max-width: 900px) {
    .video-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-video .sidebar {
        position: static;
        width: 100%;
        padding: 12px 0;
    }

    .admin-video.authenticated .app-shell {
        display: block;
    }

    .admin-video .sidebar-nav {
        display: flex;
        overflow-x: auto;
        padding: 10px;
    }

    .admin-video .sidebar-nav a {
        white-space: nowrap;
        border-radius: 8px;
    }

    .admin-video .main {
        margin-left: 0;
        padding: 16px;
    }

    .admin-video .topbar {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .container {
        max-width: 375px;
        width: 100%;
        margin-left: 0;
        margin-right: auto;
    }

    .admin-video .login-overlay {
        align-items: center;
        justify-content: flex-start;
        padding: 16px;
    }

    .admin-video .login-card {
        width: 100%;
        max-width: 343px;
        padding: 28px 18px;
    }

    .admin-video .login-card h1 {
        font-size: 1.7rem;
    }

    .video-header .container {
        align-items: flex-start;
        flex-direction: column;
    }

    .video-nav {
        justify-content: flex-start;
        width: 100%;
    }

    .video-grid {
        grid-template-columns: 1fr;
    }

    .video-filters {
        justify-content: flex-start;
    }

    .video-hero {
        text-align: left;
        padding-top: 30px;
    }

    .video-hero h1 {
        max-width: 20rem;
        font-size: 1.65rem;
        line-height: 1.15;
    }

    .video-hero p,
    .video-state h2,
    .video-state p {
        max-width: 100%;
    }

    .video-state h2 {
        font-size: 1rem;
        line-height: 1.35;
    }

    .modal-backdrop {
        align-items: flex-start;
        padding-top: 56px;
    }
}
