@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --brand-blue: #0d4f8b;
    --brand-blue-dark: #0b3f74;
    --brand-cyan: #1da9de;
    --surface: #101c36;
    --surface-muted: #12284f;
    --surface-soft: #101c36;
    --surface-alt: #101c36;
    --text: #e4e7f1;
    --text-muted: #8a97b0;
    --border: rgba(255, 255, 255, 0.10);
    --shadow: 0 20px 50px rgba(13, 79, 139, 0.08);
    --sidebar-background: #101c36;
    --sidebar-border: rgba(255, 255, 255, 0.08);
    --sidebar-input-background: #f4f8fd;
    --sidebar-input-border: #d8e3ef;
    --sidebar-input-focus: #0d4f8b;
    --sidebar-label: #65738a;
    --sidebar-help: #65738a;
}

html, body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    background: #101c36;
    color: var(--text);
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: var(--brand-blue);
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-cyan));
    border-color: var(--brand-blue-dark);
    box-shadow: 0 12px 30px rgba(13, 79, 139, 0.18);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, var(--brand-blue-dark), #128dc3);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem rgba(29, 169, 222, 0.25);
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: linear-gradient(135deg, rgba(13, 79, 139, 0.95), rgba(29, 169, 222, 0.95));
    padding: 1rem 1rem 1rem 3.7rem;
    color: #ffffff;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

.nav-filter-card {
    padding: 0.5rem;
    margin: 0.5rem;
    background: var(--sidebar-background);
    border: 1px solid var(--sidebar-border);
    border-radius: 0.75rem;
    color: var(--text);
    box-shadow: 0 10px 30px rgba(13, 79, 139, 0.04);
}

.nav-scrollable {
    background: var(--sidebar-background);
    border: 1px solid var(--sidebar-border);
    border-radius: 1.25rem;
    box-shadow: var(--shadow);
}

.sidebar-label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.sidebar-input {
    width: 100%;
    padding: 0.35rem 0.5rem;
    border-radius: 0.65rem;
    border: 1px solid var(--border);
    background: var(--surface-muted);
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.3;
    height: 2rem;
}

.sidebar-input:focus {
    border-color: var(--brand-blue);
    outline: none;
    box-shadow: 0 0 0 0.15rem rgba(13, 79, 139, 0.12);
}

.sidebar-help {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.sidebar-copyright {
    margin: 0.5rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.sidebar-copyright div {
    margin-top: 0.15rem;
}

.video-page {
    display: grid;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.video-page-header {
    display: grid;
    gap: 0.5rem;
    align-items: start;
    padding: 0.9rem 0.9rem 0.7rem;
    border-radius: 1.6rem;
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-cyan));
    color: #f8fbff;
    box-shadow: var(--shadow);
}

.video-page-label {
        display: inline-flex;
        padding: 0.35rem 0.95rem;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.16);
        color: #eaf4ff;
        font-weight: 700;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        font-size: 0.78rem;
        margin-bottom: 0.7rem;
    }

    .video-page-title {
        margin: 0;
        font-size: clamp(1.3rem, 2vw, 2rem);
        line-height: 1.1;
    }

    .video-page-description {
        margin: 0.6rem 0 0;
        max-width: 55rem;
        color: rgba(248, 250, 252, 0.8);
    }

    .video-page-status {
        align-self: center;
        justify-self: end;
        color: #bae6fd;
        font-weight: 600;
    }

    .video-loading-card,
    .video-empty-card,
    .video-error-card,
    .video-group-card {
        border-radius: 1.4rem;
        padding: 1.45rem;
        background: var(--surface);
        border: 1px solid var(--border);
        box-shadow: var(--shadow);
    }

    .video-loading-card {
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    .loading-spinner {
        width: 2rem;
        height: 2rem;
        border-radius: 50%;
        border: 0.35rem solid rgba(255, 255, 255, 0.15);
        border-top-color: #38bdf8;
        animation: spin 0.9s linear infinite;
    }

    @keyframes spin {
        to { transform: rotate(360deg); }
    }

    .video-empty-card h2,
    .video-error-card strong {
        margin: 0 0 0.65rem 0;
    }

    body, html, .rz-application, .rz-main, .rz-content, .layout-video-card {
        background: var(--surface) !important;
        color: var(--text) !important;
    }

    .rz-card, .RadzenCard, .rz-dialog, .rz-sidebar, .rz-panel-menu, .rz-header, .rz-footer {
        background: var(--surface) !important;
        color: var(--text) !important;
        border: 1px solid var(--border) !important;
        box-shadow: var(--shadow) !important;
    }

    .video-item-card {
        background: var(--surface-soft) !important;
        border-color: var(--border) !important;
        color: var(--text) !important;
    }

    .video-item-card:hover {
        background: #152553 !important;
        border-color: rgba(255, 255, 255, 0.12) !important;
    }

    .video-empty-card p,
    .video-error-card div {
        margin: 0;
        color: var(--text-muted);
    }

    .video-group-grid {
        display: grid;
        gap: 1.25rem;
    }

    .video-group-card-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 1rem;
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
        border-bottom: 1px solid var(--border);
    }

    .video-group-title {
        font-size: 1.35rem;
        font-weight: 800;
        margin-bottom: 0.35rem;
    }

    .video-group-date {
        color: var(--text-muted);
    }

    .video-group-count {
        color: var(--brand-blue);
        font-weight: 700;
        white-space: nowrap;
    }

    .video-group-items {
        display: grid;
        gap: 0.85rem;
    }

    .video-item-card {
        display: grid;
        gap: 0.55rem;
        padding: 1rem 1.15rem 1rem 1.75rem;
        border-radius: 1.2rem;
        background: var(--surface-soft);
        border: 1px solid var(--border);
        text-decoration: none;
        color: inherit;
        transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
        position: relative;
        overflow: hidden;
    }

    .video-item-card::before {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        width: 3px;
        height: 100%;
        background: linear-gradient(180deg, var(--brand-blue), var(--brand-cyan));
    }

    .video-item-card:hover {
        transform: translateY(-1px);
        background: #f7fbff;
        border-color: rgba(13, 79, 139, 0.18);
        box-shadow: 0 12px 22px rgba(13, 79, 139, 0.08);
    }

    .video-item-card > * {
        position: relative;
        z-index: 1;
    }

    .video-item-meta {
        display: flex;
        flex-direction: column;
        gap: 0.15rem;
    }

    .video-item-name {
        font-weight: 700;
    }

    .video-item-date,
    .video-item-moderators {
        color: rgba(148, 163, 184, 0.95);
        font-size: 0.95rem;
    }

@media (max-width: 768px) {
    .video-page-header {
        padding: 1.2rem 1rem 1rem;
    }

    .video-page-status {
        justify-self: start;
    }
}
