/* ── Brand fonts ─────────────────────────────────────────────── */
/* Orev Edge – headings (brand typeface) */
@font-face {
    font-family: 'Orev Edge';
    src: url('fonts/Typesketchbook%20-%20Orev%20Edge%20SemiLight.ttf') format('truetype');
    font-weight: 350;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Orev Edge';
    src: url('fonts/Typesketchbook%20-%20Orev%20Edge%20SemiLight%20Italic.ttf') format('truetype');
    font-weight: 350;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Orev Edge';
    src: url('fonts/Typesketchbook%20-%20Orev%20Edge%20Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Orev Edge';
    src: url('fonts/Typesketchbook%20-%20Orev%20Edge%20Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Orev Edge';
    src: url('fonts/Typesketchbook%20-%20Orev%20Edge%20Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Cabin – body text */
@font-face {
    font-family: 'Cabin';
    src: url('fonts/Cabin-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Cabin';
    src: url('fonts/Cabin-Italic.ttf') format('truetype');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Cabin';
    src: url('fonts/Cabin-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Cabin';
    src: url('fonts/Cabin-MediumItalic.ttf') format('truetype');
    font-weight: 500;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Cabin';
    src: url('fonts/Cabin-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Cabin';
    src: url('fonts/Cabin-SemiBoldItalic.ttf') format('truetype');
    font-weight: 600;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Cabin';
    src: url('fonts/Cabin-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Cabin';
    src: url('fonts/Cabin-BoldItalic.ttf') format('truetype');
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}

/* ── Base typography ─────────────────────────────────────────── */
html, body {
    font-family: 'Cabin', 'Helvetica Neue', Arial, sans-serif;
}

html {
    scrollbar-gutter: stable;
}

h1, h2, h3, h4, h5, h6,
.mud-typography-h1,
.mud-typography-h2,
.mud-typography-h3,
.mud-typography-h4,
.mud-typography-h5,
.mud-typography-h6 {
    font-family: 'Orev Edge', 'Cabin', sans-serif !important;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

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

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+P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uNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* ── Attendee avatars (social proof strip & attendee grid) ── */
.social-proof-strip {
    display: flex;
    align-items: center;
}

.avatar-overlap {
    display: flex;
    flex-direction: row;
}

.attendee-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.2);
    margin-left: -8px;
    object-fit: cover;
}

.avatar-overlap .attendee-avatar:first-child {
    margin-left: 0;
}

.attendee-avatar--initials {
    background-color: var(--mud-palette-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.attendee-avatar--wrapper {
    position: relative;
    overflow: hidden;
}

.attendee-avatar--wrapper img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.attendee-avatar--wrapper img[src=''],
.attendee-avatar--wrapper img:not([src]) {
    display: none;
}

.attendee-tile__avatar--wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 50%;
}

.attendee-tile__avatar--wrapper img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.attendee-tile__avatar--wrapper img[src=''],
.attendee-tile__avatar--wrapper img:not([src]) {
    display: none;
}

.attendee-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.attendee-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 68px;
}

.attendee-tile__link {
    text-decoration: none;
    display: block;
}

.attendee-tile__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--mud-palette-lines-default);
}

.attendee-tile__avatar--initials {
    border-radius: 50%;
    background-color: var(--mud-palette-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    border: 2px solid var(--mud-palette-lines-default);
}

.attendee-tile__name {
    margin-top: 4px;
    font-size: 0.7rem;
    text-align: center;
    color: var(--mud-palette-text-secondary);
    word-break: break-word;
    max-width: 68px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ── Drawer: active nav-link contrast fix ── */
.mud-drawer .mud-nav-link.active,
.mud-drawer .mud-nav-link.active .mud-nav-link-text,
.mud-drawer .mud-nav-link.active .mud-nav-link-icon {
    color: #FFFFFF !important;
}

/* ── Event description: rich HTML rendered from organizer content ── */
.event-description h2 { font-size: 1.35rem; font-weight: 600; margin: 1rem 0 0.4rem; }
.event-description h3 { font-size: 1.1rem; font-weight: 600; margin: 0.75rem 0 0.3rem; }
.event-description p { margin: 0.7rem 0; }
.event-description ul, .event-description ol { padding-left: 1.5rem; margin: 0.4rem 0; }
.event-description li { margin: 0.2rem 0; }
.event-description a { color: #006bb7; text-decoration: underline; }
.event-description strong { font-weight: 600; }
.event-description em { font-style: italic; }

/* ── Dialog: use event theme surface color ── */
.mud-dialog {
    background-color: var(--evt-surface, #1e1e1e) !important;
    color: var(--evt-text, #e0e0e0) !important;
}

/* ── AI assistant (public chat) ── */
/* The wrapper owns the fixed position so the status dot can anchor to the icon. */
.ai-launcher-fab-wrap {
    position: fixed;
    bottom: 96px;
    right: 24px;
    z-index: 1300;
    display: inline-flex;
}

.ai-launcher-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    border: 2px solid #1a1a1a;
    pointer-events: none;
}

.ai-launcher-dot--busy {
    background: #e53935;
    animation: ai-launcher-dot-pulse 1.2s ease-in-out infinite;
}

.ai-launcher-dot--done {
    background: #2196f3;
}

@keyframes ai-launcher-dot-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Full-height right drawer, matching the signed-in assistant. */
.ai-launcher-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1300;
    width: 380px;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.45);
    background: var(--mud-palette-surface, #1e1e1e);
}

/* Closed, but still mounted so the running turn and transcript survive. */
.ai-launcher-panel--hidden {
    display: none;
}

/* When the chat is open, the page content reflows to share space with the
   drawer (like the organizer portal) instead of being covered by it. */
.ml-root,
.pl-root {
    transition: padding-right 0.2s ease;
}

.ml-root--chat-open,
.pl-root--chat-open {
    padding-right: 380px;
}

@media (max-width: 640px) {
    .ai-launcher-panel {
        width: 100vw;
    }
    /* Too narrow to share space — overlay instead of reflow. */
    .ml-root--chat-open,
    .pl-root--chat-open {
        padding-right: 0;
    }
}

.ai-assistant-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.ai-assistant-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 12px 12px 16px;
    background: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
}

.ai-assistant-title {
    font-weight: 600;
}

.ai-assistant-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ai-assistant-empty {
    margin: auto;
    text-align: center;
    color: var(--mud-palette-text-secondary);
    padding: 16px;
}

.ai-assistant-msg {
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 12px;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.4;
}

.ai-assistant-msg-user {
    align-self: flex-end;
    background: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
    border-bottom-right-radius: 2px;
}

.ai-assistant-msg-assistant {
    align-self: flex-start;
    background: var(--mud-palette-background-grey);
    color: var(--mud-palette-text-primary);
    border-bottom-left-radius: 2px;
    white-space: normal;
}

/* Markdown rendered inside assistant replies. */
.ai-assistant-msg-assistant p { margin: 0 0 0.5em; }
.ai-assistant-msg-assistant p:last-child { margin-bottom: 0; }
.ai-assistant-msg-assistant ul,
.ai-assistant-msg-assistant ol { margin: 0.3em 0; padding-left: 1.25em; }
.ai-assistant-msg-assistant li { margin: 0.15em 0; }
.ai-assistant-msg-assistant a { color: var(--mud-palette-primary); text-decoration: underline; }
.ai-assistant-msg-assistant code {
    background: rgba(255, 255, 255, 0.12);
    padding: 0.1em 0.3em;
    border-radius: 4px;
    font-size: 0.9em;
}
.ai-assistant-msg-assistant pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 8px;
    border-radius: 6px;
    overflow-x: auto;
}
.ai-assistant-msg-assistant pre code { background: none; padding: 0; }
.ai-assistant-msg-assistant h1,
.ai-assistant-msg-assistant h2,
.ai-assistant-msg-assistant h3 { font-size: 1.05em; margin: 0.5em 0 0.2em; }

.ai-assistant-msg-assistant table {
    display: block;
    width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    margin: 0.5em 0;
    font-size: 0.92em;
}

.ai-assistant-msg-assistant th,
.ai-assistant-msg-assistant td {
    min-width: 6rem;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--mud-palette-divider);
    text-align: left;
    vertical-align: top;
}

.ai-assistant-msg-assistant th {
    background: rgba(255, 255, 255, 0.08);
    font-weight: 600;
}

.ai-assistant-text {
    animation: ai-assistant-text-reveal 0.4s ease-out both;
}

@keyframes ai-assistant-text-reveal {
    from {
        opacity: 0;
        transform: translateY(2px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-assistant-typing {
    display: flex;
    align-items: center;
}

.ai-assistant-composer {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.ai-assistant-input {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    width: 100%;
    gap: 6px;
    padding: 8px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--mud-palette-divider);
}

.ai-assistant-context {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    min-width: 0;
    padding: 3px 4px 3px 8px;
    color: var(--mud-palette-text-secondary);
    font-size: 0.78rem;
}

.ai-assistant-request {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
    padding: 6px 8px;
    border-top: 1px solid var(--mud-palette-divider);
    color: var(--mud-palette-text-primary);
    font-size: 0.82rem;
}

.ai-assistant-request__prompt {
    flex: 1 1 auto;
    min-width: 0;
}

.ai-assistant-context > span {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-assistant-context .mud-icon-button {
    flex: 0 0 auto;
}

.ai-assistant-textfield {
    flex: 1 1 auto;
    margin: 0;
}

/* ── Tool-call timeline (streamed tool_start / tool_end sequence) ── */
.ai-tool-steps {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 260px;
    max-width: 100%;
    margin: 0 auto 8px;
}

.ai-tool-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.85em;
    line-height: 1.3;
    width: 100%;
    box-sizing: border-box;
}

.ai-tool-step__icon {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
}

.ai-tool-step__label {
    flex: 1 1 auto;
    word-break: break-word;
}

.ai-tool-step__status {
    flex: 0 0 auto;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    opacity: 0.7;
}

.ai-tool-step--running .ai-tool-step__icon { color: var(--mud-palette-primary); }
.ai-tool-step--completed .ai-tool-step__icon { color: var(--mud-palette-success); }
.ai-tool-step--failed .ai-tool-step__icon { color: var(--mud-palette-error); }
.ai-tool-step--failed .ai-tool-step__status { color: var(--mud-palette-error); opacity: 1; }

/* Buttons that lead into the organizer portal: same look everywhere, only the destination differs. */
.organizer-action.mud-button-root {
    border-radius: 24px;
    text-transform: none;
    font-weight: 600;
    white-space: nowrap;
}

/* Organizer bar on the public event page: links to where the full management lives. */
.evt-admin-bar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    padding: 12px 16px;
    border: 1px solid color-mix(in srgb, var(--mud-palette-primary) 45%, transparent);
    border-radius: 12px;
    background: color-mix(in srgb, var(--mud-palette-primary) 8%, transparent);
}
.evt-admin-bar--preview { border-style: dashed; background: transparent; }
.evt-admin-bar__preview { margin-left: auto; display: flex; justify-content: flex-end; }
.evt-admin-bar__preview .mud-input-control { margin: 0; }
.evt-admin-bar__preview .mud-typography { font-size: 0.85rem; }
/* MudBlazor's off-track is palette black, invisible on dark backgrounds. */
.evt-admin-bar__preview .mud-switch-span .mud-switch-track {
    opacity: 1;
    background-color: rgba(255,255,255,0.28);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35);
}
.evt-admin-bar__preview .mud-switch-base.mud-checked + .mud-switch-track {
    opacity: 1;
    background-color: color-mix(in srgb, var(--mud-palette-primary) 55%, transparent);
    box-shadow: inset 0 0 0 1px var(--mud-palette-primary);
}
.evt-admin-bar__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.evt-admin-bar__label { margin-right: 4px; font-size: 0.8rem; font-weight: 600; color: var(--mud-palette-text-secondary); }
.evt-admin-bar__buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.evt-admin-bar__menu { display: none !important; }
@media (max-width: 760px) {
    .evt-admin-bar__label, .evt-admin-bar__buttons { display: none; }
    .evt-admin-bar__menu { display: inline-flex !important; }
}