/* Riot panel — dark theme on top of Bootstrap 5.3 (data-bs-theme="dark"). */

:root {
    --riot-red: #e6e8eb;
    --riot-red-dark: #c9ced6;
    --riot-bg: #050506;
    --riot-surface: #0e0f12;
    --riot-surface-2: #16181c;
    --riot-border: #24272d;
    --riot-text: #e9e9ec;
    --riot-muted: #a9aeb6;
    --riot-discord: #5865f2;
}

[data-bs-theme="dark"] {
    --bs-body-bg: var(--riot-bg);
    --bs-body-color: var(--riot-text);
    --bs-secondary-color: var(--riot-muted);
    --bs-border-color: var(--riot-border);
    --bs-tertiary-bg: var(--riot-surface-2);
    --bs-link-color: #e6e8eb;
    --bs-link-color-rgb: 230, 232, 235;
    --bs-link-hover-color: #ffffff;
    --bs-link-hover-color-rgb: 255, 255, 255;
}

html, body {
    font-family: "Bahnschrift", "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--riot-bg);
}

h1:focus {
    outline: none;
}

a {
    text-decoration: none;
}

.form-control, .form-select {
    background-color: var(--riot-surface-2);
    border-color: var(--riot-border);
}

.form-control:focus, .form-select:focus, .form-check-input:focus, .btn:focus-visible {
    border-color: var(--riot-red);
    box-shadow: 0 0 0 0.2rem rgba(230, 232, 235, 0.25);
}

.form-check-input:checked {
    background-color: var(--riot-red);
    border-color: var(--riot-red);
}

.table {
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--riot-border);
}

.nav-pills .nav-link {
    color: var(--riot-muted);
}

.nav-pills .nav-link.active {
    background: var(--riot-red);
    color: #050506;
}

/* Buttons */

.btn-riot {
    --bs-btn-color: #050506;
    background-image: linear-gradient(180deg, #ffffff, #c9ced6);
    --bs-btn-bg: var(--riot-red);
    --bs-btn-border-color: var(--riot-red);
    --bs-btn-hover-color: #050506;
    --bs-btn-hover-bg: var(--riot-red-dark);
    --bs-btn-hover-border-color: var(--riot-red-dark);
    --bs-btn-active-bg: var(--riot-red-dark);
    --bs-btn-disabled-bg: var(--riot-red);
    --bs-btn-disabled-border-color: var(--riot-red);
    font-weight: 600;
}

.btn-discord {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--riot-discord);
    --bs-btn-border-color: var(--riot-discord);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #4752c4;
    --bs-btn-hover-border-color: #4752c4;
    font-weight: 600;
}

/* Shell */

.riot-shell {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
}

.riot-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem 1rem;
    background: var(--riot-surface);
    border-right: 1px solid var(--riot-border);
}

.riot-brand {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0 0.5rem;
}

.riot-logo {
    height: 2.1rem;
    width: auto;
    filter: drop-shadow(0 0 10px rgba(230, 232, 235, 0.25));
}

.riot-brand-sub {
    color: var(--riot-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.25em;
}

.riot-nav {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
    overflow-y: auto;
}

.riot-nav a {
    display: block;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    color: var(--riot-muted);
    border-left: 3px solid transparent;
    transition: background 0.15s, color 0.15s;
}

.riot-nav a:hover {
    background: var(--riot-surface-2);
    color: var(--riot-text);
}

.riot-nav a.active {
    background: rgba(230, 232, 235, 0.12);
    color: #fff;
    border-left-color: var(--riot-red);
}

.riot-main {
    min-width: 0;
}

.riot-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 2rem;
    border-bottom: 1px solid var(--riot-border);
    background: rgba(13, 14, 18, 0.85);
    backdrop-filter: blur(6px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.riot-user {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--riot-muted);
}

.riot-user img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.riot-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--riot-muted);
}

.riot-status .dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.riot-status.online .dot {
    background: #2ecc71;
    box-shadow: 0 0 8px #2ecc71;
}

.riot-status.offline .dot {
    background: #e74c3c;
    box-shadow: 0 0 8px #e74c3c;
}

.riot-content {
    padding: 1.5rem 2rem 4rem;
    max-width: 1500px;
}

.riot-title {
    font-weight: 800;
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

/* Cards */

.riot-card {
    background: var(--riot-surface);
    border: 1px solid var(--riot-border);
    border-radius: 14px;
    padding: 1.25rem 1.4rem;
    margin-bottom: 1rem;
}

.riot-card h2 {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--riot-muted);
    margin-bottom: 1rem;
}

.riot-application h2 {
    font-size: 1.15rem;
    text-transform: none;
    letter-spacing: normal;
    color: var(--riot-text);
}

.riot-application.pending {
    border-left: 3px solid #f1c40f;
}

.riot-application.accepted {
    border-left: 3px solid #2ecc71;
}

.riot-application.rejected {
    border-left: 3px solid var(--riot-red);
}

.riot-sticky {
    position: sticky;
    top: 80px;
}

.riot-notice {
    border-radius: 12px;
}

.riot-savebar {
    position: sticky;
    bottom: 0;
    display: flex;
    gap: 0.5rem;
    padding: 0.9rem 0;
    background: linear-gradient(transparent, var(--riot-bg) 35%);
}

.riot-stat {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    height: 100%;
    padding: 1rem 1.1rem;
    border-radius: 14px;
    background: var(--riot-surface);
    border: 1px solid var(--riot-border);
    color: var(--riot-text);
    transition: border-color 0.15s, transform 0.15s;
}

a.riot-stat:hover {
    border-color: var(--riot-red);
    transform: translateY(-2px);
    color: var(--riot-text);
}

.riot-stat-icon {
    font-size: 1.2rem;
}

.riot-stat-value {
    font-size: 1.6rem;
    font-weight: 800;
}

.riot-stat-label {
    font-size: 0.8rem;
    color: var(--riot-muted);
}

.riot-checklist {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    display: grid;
    gap: 0.5rem;
}

.riot-checklist li {
    display: flex;
    gap: 0.6rem;
}

.riot-checklist li.ok {
    color: var(--riot-muted);
}

.riot-checklist .mark {
    flex: 0 0 1.1rem;
    height: 1.1rem;
    margin-top: 0.15rem;
    border-radius: 50%;
    border: 2px solid var(--riot-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.riot-checklist li.ok .mark {
    border-color: #2ecc71;
    background: #2ecc71;
    color: #0d0e12;
}

.riot-answers {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.35rem 1rem;
}

.riot-answers dt {
    color: var(--riot-muted);
    font-weight: 500;
}

.riot-answers dd {
    margin: 0;
}

.riot-pre {
    white-space: pre-wrap;
}

.riot-transcript {
    white-space: pre-wrap;
    background: var(--riot-bg);
    border: 1px solid var(--riot-border);
    border-radius: 10px;
    padding: 1rem;
    max-height: 70vh;
    overflow: auto;
    font-size: 0.82rem;
}

.riot-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
}

.riot-image-preview {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.riot-image-preview img {
    max-width: 220px;
    max-height: 140px;
    border-radius: 10px;
    border: 1px solid var(--riot-border);
}

/* Discord message preview */

.discord-preview {
    background: #313338;
    border-radius: 10px;
    padding: 1rem;
    color: #dbdee1;
    font-size: 0.95rem;
}

.discord-message {
    display: flex;
    gap: 1rem;
}

.discord-avatar {
    flex: 0 0 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--riot-red);
    color: #fff;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
}

.discord-body {
    min-width: 0;
    flex: 1;
}

.discord-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.15rem;
}

.discord-author {
    font-weight: 600;
    color: #f2f3f5;
}

.discord-bot-tag {
    background: var(--riot-discord);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.05rem 0.3rem;
    border-radius: 4px;
}

.discord-time {
    color: #949ba4;
    font-size: 0.75rem;
}

.discord-content {
    white-space: pre-wrap;
    word-wrap: break-word;
    margin-bottom: 0.35rem;
}

.discord-embed {
    background: #2b2d31;
    border-left: 4px solid var(--riot-red);
    border-radius: 4px;
    padding: 0.6rem 1rem 0.8rem 0.75rem;
    max-width: 520px;
    display: grid;
    gap: 0.4rem;
}

.discord-embed-author {
    font-size: 0.85rem;
    font-weight: 600;
}

.discord-embed-title {
    font-weight: 700;
    color: #f2f3f5;
}

.discord-embed-description {
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.discord-embed-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.discord-embed-field {
    flex: 1 1 100%;
    font-size: 0.875rem;
}

.discord-embed-field.inline {
    flex: 1 1 28%;
}

.discord-embed-field-name {
    font-weight: 700;
    color: #f2f3f5;
}

.discord-embed-image, .discord-attachment {
    max-width: 100%;
    max-height: 320px;
    border-radius: 6px;
    margin-top: 0.4rem;
}

.discord-embed-footer {
    font-size: 0.75rem;
    color: #b5bac1;
}

.discord-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.discord-button {
    background: #4e5058;
    color: #fff;
    padding: 0.3rem 0.9rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.discord-forum-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
}

.md-mention {
    background: rgba(88, 101, 242, 0.3);
    color: #c9cdfb;
    border-radius: 3px;
    padding: 0 2px;
}

.md-quote {
    display: inline-block;
    border-left: 4px solid #4e5058;
    padding-left: 0.6rem;
}

/* Public pages (login, errors) */

.riot-public {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background:
        radial-gradient(circle at 20% 15%, rgba(230, 232, 235, 0.22), transparent 45%),
        radial-gradient(circle at 85% 90%, rgba(88, 101, 242, 0.18), transparent 40%),
        var(--riot-bg);
}

.riot-public-card {
    width: 100%;
    max-width: 420px;
    background: var(--riot-surface);
    border: 1px solid var(--riot-border);
    border-radius: 18px;
    padding: 2rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
}

/* Validation (EditForm) */

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid var(--riot-red);
}

.validation-message {
    color: #ff8a8f;
    font-size: 0.85rem;
}

/* Blazor's unhandled-error bar */

#blazor-error-ui {
    color-scheme: light only;
    background: #ffe9a8;
    color: #111;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    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: #b32121;
    padding: 1rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "Wystąpił błąd.";
}

/* Small screens: the sidebar becomes a top bar */

@media (max-width: 900px) {
    /* minmax(0, …) stops the scrollable nav from stretching the page wider than the screen. */
    .riot-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .riot-sidebar {
        position: static;
        height: auto;
        min-width: 0;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }

    .riot-nav {
        flex-direction: row;
        overflow-x: auto;
        flex-basis: 100%;
        min-width: 0;
        order: 3;
    }

    .riot-nav a {
        white-space: nowrap;
        border-left: none;
        border-bottom: 3px solid transparent;
    }

    .riot-nav a.active {
        border-bottom-color: var(--riot-red);
    }

    .riot-logout {
        margin-left: auto;
    }

    .riot-content, .riot-topbar {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .riot-sticky {
        position: static;
    }
}

/* Brand: chrome on black, condensed type */
.riot-title, .riot-card h2, .riot-stat-value {
    font-family: "Bahnschrift SemiCondensed", "Bahnschrift", "Arial Narrow", sans-serif;
    letter-spacing: 0.02em;
}

.riot-nav a.active {
    color: #ffffff;
}

.btn-riot:hover {
    background-image: none;
}

.discord-avatar {
    background: #050506;
    overflow: hidden;
}

.discord-avatar img {
    width: 100%;
    height: 100%;
}

.riot-public-card .riot-logo {
    height: 4rem;
}
