﻿html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-y: auto;
}

html {
    scrollbar-gutter: stable;
}

/* History nav icon: 20% smaller icon inside unchanged background circle */
.mud-navmenu .nav-history-icon-link .mud-nav-link-icon {
    font-size: 1.25rem !important;
    width: 1.8em !important;
    height: 1.8em !important;
    padding: 3.6px !important;
    box-sizing: border-box !important;
}

/* Prevent MudBlazor's scroll-lock from adding padding compensation.
   The scrollbar gutter on <html> already reserves that space. */
body.scroll-locked {
    padding-right: 0 !important;
}

body.scroll-locked .mud-layout .mud-appbar {
    padding-right: 0 !important;
}

body {
    --mud-drawer-width-right: 280px;
}

.wizard-dialog .mud-stepper-header,
.wizard-dialog .mud-progress-linear {
    display: none !important;
}

.wizard-dialog .mud-paper-outlined {
    border: 1px solid var(--mud-palette-divider);
}

.response-box {
    min-height: 100px;
    max-height: 300px;
    overflow-y: auto;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.mud-icon-button-size-small {
    padding: 8px;
}

.mud-dialog {
    max-width: 700px !important;
    width: 100%;
}

    .mud-dialog .mud-dialog-actions {
        padding-left: 24px;
        padding-right: 24px;
    }

/* Style for the text field inside the dialog */
.dialog-text-field {
    height: 50px; /* Adjust height */
    width: 100%;
    font-size: 16px;
}

/* Style for the response box to match the screenshot */
.dialog-response-box {
    min-height: 220px;
    max-height: 600px;
    overflow-y: auto;
    background-color: var(--mud-palette-background);
    border-radius: 8px;
    padding: 10px;
    font-size: 16px;
}

/* Style for the response text */
.dialog-text-content {
    font-size: 14px;
    line-height: 1.5;
}

label {
    cursor: pointer;
    margin-right: 8px;
}

.label-tooltip {
    gap: 0 !important;
}

.image-icon-div {
    position: relative;
    display: inline-block;
    margin-top: 10px;
}

.image-icon {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    object-fit: cover;
}

.image-mud-icon {
    position: absolute;
    top: -10px;
    right: -10px;
    background: white;
    border-radius: 50%;
}

.image-container {
    display: flex;
    flex-direction: column;
    gap: 1rem; /* spacing between images */
}

.image-style {
    width: 100%;
    height: auto;
}

.scrollable-paper {
    max-height: auto;
    max-width: 100%;
    overflow-y: auto;
    padding: 16px;
    margin-bottom: 16px;
}

.non-scrollable-paper {
    padding: 16px;
}

.mud-typography ul {
    list-style-type: disc;
    margin-left: 2rem;
}

.mud-typography ol {
    list-style-type: decimal;
    margin-left: 2rem;
}

.mud-typography li {
    margin-bottom: 0.3rem;
}

.text-align-center {
    text-align: center;
}

.octagon {
    position: relative;
    background: #4CAF50; /* Change color as needed */
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
}

.site-title {
    font-size: 1.25rem;
}

.site-title-bullet {
    font-weight: bold;
    margin: 0 3px;
}

/* Normal code block */
.markdown-body pre.code-block {
    background-color: var(--mud-palette-background-grey);
    color: var(--mud-palette-text-primary);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    overflow-x: auto;
    font-family: Consolas, "Courier New", monospace;
    white-space: pre-wrap;
}

/* Dark mode: transparent code block background for readability */
.markdown-body.dark-mode pre.code-block {
    background-color: transparent;
}

/* Inline code */
.inline-code {
    background-color: var(--mud-palette-background-grey);
    color: var(--mud-palette-text-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: Consolas, "Courier New", monospace;
}

.item .hover-button {
    visibility: hidden;
}

.item:hover .hover-button {
    visibility: visible;
}

.overflow-ellipsis {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Left Nav Menu History */
.left-nav-menu {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

    .left-nav-menu .mud-nav-group .mud-nav-item .mud-nav-link {
        padding-left: 0;
        padding-inline-start: 0;
    }


/* ===== History container: fills available flex space inside nav-history-section ===== */
.chat-history {
    flex: 1 1 auto;
    min-height: 120px;
    max-height: none;
    overflow: visible; /* must NOT be auto/scroll — nav-history-section is the scroll container; auto here breaks position:sticky on .title */
    margin-left: -8px;
    margin-right: -8px;
    padding: 0 10px;
}

/* MudList adds padding-top: 8px by default — remove it so the first sticky title
   starts flush with the scroll container top and is pinned from the very first render */
.chat-history .mud-list {
    padding-top: 0;
}

/* Group label */
.chat-history .title {
    font-size: 11px;
    font-weight: 400;
    color: var(--mud-palette-text-secondary);
    position: sticky;
    top: 0;
    z-index: 3;
    background-color: var(--mud-palette-drawer-background);
    padding-top: 4px;
    padding-bottom: 4px;
}

/* List item container */
.chat-history .group {
    padding: 0;
    margin-bottom: 8px;
}

/* ===== Chat tile text wrapping ===== */
.chat-history .chat {
    display: block;
    padding: 12px;
    background-color: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid var(--mud-palette-lines-default);
    box-shadow: var(--mud-elevation-1);
    /* Ensure wrapping for long text and URLs */
    white-space: normal; /* allow wrapping */
    overflow-wrap: anywhere; /* break long words/URLs */
    word-break: break-word; /* legacy fallback */
    hyphens: auto; /* nicer breaks where supported */
}

    /* Hover/active visuals */
    .chat-history .chat:hover {
        box-shadow: var(--mud-elevation-3);
    }

    .chat-history .chat:active {
        transform: translateY(1px);
    }

/* Footer row under the list (unchanged) */
.chat-actions {
    height: 30px;
}



/* Multi-line clamp; change --lines to 2, 3, 4 as you wish */
.chat-history .chat.chat--ellipsis-n {  
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3; /* <-- set your line count */
    overflow: hidden;
    /* Allow wrapping but avoid the 'line after …' artifact */
    white-space: normal;
    overflow-wrap: break-word; /* milder than 'anywhere' */
    word-break: normal; /* do not force breaks */
    hyphens: none; /* avoid trailing hyphen before ellipsis */
    height:80px;
}



.user {
    display: flex;
    margin: 0;
    align-items: baseline;
    white-space: nowrap;
}

    .user .name {
        flex: 1;
    }

    .user .mud-nav-link-text {
        display: flex;
        margin: 0;
        align-items: baseline;
    }


/* History Page */
.history-search--dark .mud-input {
    background-color: #3F4049;
}

    .history-search .mud-input > input.mud-input-root-outlined,
    .history-search div.mud-input-slot.mud-input-root-outlined {
        padding: 12px 16px;
    }

.full-chat-history .period {
    font-size: 11px;
    font-weight: 400;
    color: var(--mud-palette-text-secondary);
}

.full-chat-history .date {
    margin-right: 20px;
    font-size: 12px;
    min-width: 100px;
    text-align: right;
    color: var(--mud-palette-text-secondary);
    align-items: baseline
}

.full-chat-history .mud-paper {
    background-color: unset;
}

    .full-chat-history .mud-paper.mud-elevation-1 {
        border: 1px solid var(--mud-palette-background-grey);
    }

        .full-chat-history .mud-paper.mud-elevation-1:hover {
            box-shadow: var(--mud-elevation-3);
        }


.full-chat-history .text {
    font-size: 16px;
    color: var(--mud-palette-text-secondary);
}

.full-chat-history.grid-view .group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 49%));
    gap: 16px;
}
/* Circular background to match your reference */
.icon-circle {
    width: 32px; /* adjust to match your desired size */
    height: 32px;
    border-radius: 50%;
    background-color: #2E2F36; /* the circle color */
    color: #E6E7EA !important; /* icon (glyph) color */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important; /* remove extra space */
}

    /* Control the glyph size inside the circle */
    .icon-circle .mud-icon-root {
        font-size: 18px; /* tweak if needed */
        line-height: 1;
    }

    /* Optional: hover/active/focus states for better UX and accessibility */
    .icon-circle:hover:not(.mud-disabled) {
        background-color: #3A3B43; /* a hair lighter/darker than base */
    }

    .icon-circle:active:not(.mud-disabled) {
        background-color: #34353C;
    }

    .icon-circle:focus-visible {
        outline: 2px solid #AAB2FF; /* accessible focus ring */
        outline-offset: 2px;
    }

/* ===== History lazy-load spinner ===== */
@keyframes history-spin {
    to { transform: rotate(360deg); }
}

.history-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #2B2C31;
    border-top-color: #00B5AF;
    border-radius: 50%;
    animation: history-spin 0.8s linear infinite;
}

.history-spinner-wrapper {
    display: flex;
    justify-content: center;
    padding: 16px 0;
}


:root {
    --aiassist-accent: #00C8FF;  your sampled cyan 
}

.aiassist-header {
    /* optional rounded card feel if used inside a container */
    border-radius: 12px;
}

    .aiassist-header .title {
        margin: 0;
        line-height: 1.1;
    }

    .aiassist-header .meta {
        margin: 0;
        color: var(--aiassist-accent);
        font-weight: 700; /* matches the bold cyan look */
        letter-spacing: 0.2px; /* subtle crispness */
    }

    .aiassist-header .chev {
        flex-shrink: 0;
        font-size: 14px; /* close to your reference size */
    }

    .aiassist-header .nowrap {
        white-space: nowrap; /* no line breaks */
        hyphens: none; /* don't insert hyphens */
        overflow: hidden; /* optional: truncate if container is tight */
        text-overflow: ellipsis; /* optional: add … if truncated */
    }
 
    
    /* File icon - file name */
.file-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

/* Wrap to position the overlay button */
.file-icon-wrap {
    position: relative;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
}

.file-icon {
    width: 40px;
    height: 40px;
    border-radius: 4px;
}

/* Overlay close button like your original */
.file-close-overlay {
    position: absolute;
    top: -8px;
    right: -8px;
    background: white; /* optional: improves contrast */
    border-radius: 50%;
}

/* Truncation for long names */
.file-name {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/*Dark/light mode switch*/

/* --- Visuals for the dark mode pill --- */
.darkmode-pill {
    width: 192px;
    height: 35px;
    border-radius: 50px;
    background: #2B2C31;
    display: flex;
    align-items: center;
    padding-inline: 10px;
    gap: 10px;
    position: relative;
}


    /* Place the label INSIDE the pill, right-aligned */
    .darkmode-pill .darkmode-label {
        margin-left: auto;
        /*margin-right: 10px;*/
        color: #BEBABA;
        font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
        font-size: 14px;
        font-weight: 400;
        line-height: normal;
        white-space: nowrap;
    }



    /* Light theme pill (when you add .pill-light) */
    .darkmode-pill.pill-light {
        background: #F1F3F5;
    }

        .darkmode-pill.pill-light .darkmode-label {
            color: #2C2F36;
        }


/* --- Make the MudSwitch compact and pill-like --- */
.darkmode-switch.mud-switch {
    --dm-track-height: 22px;
    --dm-thumb-size: 18px;
    /* Colors */
    --dm-off-track: #3a3b41;
    --dm-on-track: #3a3b41; /* keep consistent dark track; color accent is in thumb/icon */
    --dm-thumb-off: #8aa7ff; /* light blue thumb in off */
    --dm-thumb-on: #46a4ff; /* brighter thumb in on */
}

/* Remove default label spacing from MudSwitch (we render our own label) */
.darkmode-switch .mud-switch-label {
    display: none;
}


/* --- Theme-neutral pill (application-wide reusable) --- */
/* Use .theme-pill with .pill-dark or .pill-light driven by the app UseDarkMode flag.
   Pair with .theme-switch on a MudSwitch and .theme-label on the visible label span. */
.theme-pill {
    width: 192px;
    height: 35px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    padding-inline: 10px;
    gap: 10px;
    position: relative;
}

.theme-pill.pill-dark {
    background: #2B2C31;
}

    .theme-pill.pill-dark .theme-label {
        color: #BEBABA;
    }

.theme-pill.pill-light {
    background: #F1F3F5;
}

    .theme-pill.pill-light .theme-label {
        color: #2C2F36;
    }

.theme-pill .theme-label {
    margin-left: auto;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: normal;
    white-space: nowrap;
}

/* Remove default label spacing from MudSwitch when using .theme-switch (we render our own label) */
.theme-switch .mud-switch-label {
    display: none;
}


.highlight {
    background-color: yellow;
    font-weight: 600;
}


.keyword-highlight {
    background-color: #ffeb3b;
    padding: 0 2px;
    border-radius: 2px;
}

.chat-icon-tray {
    height: 100%;
    display: flex;
    align-items: center;
}

.temporary-toggle {
    margin-left: 4px;
}

.temporary-switch .mud-switch-root {
    margin-top: 0;
}
/* Container aligned like icon buttons */
.temporary-chat-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 28px; /* matches MudIconButton Small */
}

/* Label alignment */
.temporary-chat-label {
    line-height: 1;
    margin-bottom: -1px; /* optical alignment */
}

/* SCALE the MudSwitch to icon size */
.temporary-switch {
    transform: scale(0.7);
    transform-origin: left center;
    margin-left: -4px; /* compensates switch padding */
}

    /* Remove MudSwitch internal vertical spacing */
    .temporary-switch .mud-switch-root {
        margin: 0;
        padding: 0;
    }


.temporary-chat-container {
    padding-bottom: 4px;
}

.darkmode-like-switch .mud-switch-track {
    background-color: #2c2f36;
    opacity: 1;
}

.darkmode-like-switch.mud-checked .mud-switch-track {
    background-color: rgba(33, 150, 243, 0.35);
}

.darkmode-like-switch .mud-switch-thumb {
    background-color: #90caf9;
    box-shadow: 0 0 6px rgba(33, 150, 243, 0.6);
}

.temp-chat-info-icon {
    cursor: pointer;
    color: var(--mud-palette-text-secondary);
    opacity: 0.75;
}

    .temp-chat-info-icon:hover {
        opacity: 1;
    }


.temporary-chat-row {
    padding: 4px 0;
}

.temp-chat-info-icon {
    cursor: pointer;
    opacity: 0.7;
    color: var(--mud-palette-text-secondary);
}

    .temp-chat-info-icon:hover {
        opacity: 1;
    }

/* Same visual feel as Dark Mode switch */
.darkmode-like-switch .mud-switch-track {
    background-color: #2c2f36;
    opacity: 1;
}

.darkmode-like-switch.mud-checked .mud-switch-track {
    background-color: rgba(33, 150, 243, 0.35);
}

.darkmode-like-switch .mud-switch-thumb {
    background-color: #90caf9;
    box-shadow: 0 0 6px rgba(33, 150, 243, 0.6);
}

.temporary-chat-darkmode-style {
    padding-bottom: 6px;
}

.temp-chat-info-icon {
    cursor: pointer;
    opacity: 0.7;
    color: var(--mud-palette-text-secondary);
}

    .temp-chat-info-icon:hover {
        opacity: 1;
    }

/* Exact Dark Mode switch style clone */
.darkmode-switch-clone .mud-switch-track {
    background-color: #2c2f36;
    opacity: 1;
}

.darkmode-switch-clone.mud-checked .mud-switch-track {
    background-color: rgba(33, 150, 243, 0.35);
}

.darkmode-switch-clone .mud-switch-thumb {
    background-color: #90caf9;
    box-shadow: 0 0 6px rgba(33, 150, 243, 0.6);
}

.confirm-delete-dialog {
    background-color: var(--mud-palette-surface);
    border-radius: 0 !important;
    max-width: 460px;
    width: 460px;
}

.confirm-delete-dialog .mud-dialog-title {
    padding: 16px 16px 6px !important;
}

.confirm-delete-dialog .mud-dialog-content {
    padding: 0 16px !important;
}

.confirm-delete-dialog .mud-dialog-actions {
    padding: 24px 16px 16px !important;
}

.text-muted {
    opacity: 0.75;
}

.mud-button-root {
    text-transform: none; /* cleaner modern UI */
}

/* ── Login page ─────────────────────────────────────────── */
.login-page-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--mud-appbar-height, 64px) - 48px);
    width: 100%;
}

.login-card {
    max-width: 420px;
    width: 100%;
    border-radius: 12px !important;
}

.login-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 24px !important;
    gap: 16px;
}

.login-icon-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid var(--mud-palette-text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
}

.login-icon {
    font-size: 28px;
    color: var(--mud-palette-text-primary);
}

.login-message {
    color: var(--mud-palette-text-primary);
    opacity: 0.9;
    text-align: center;
    line-height: 1.5;
}

.login-signin-btn {
    border-radius: 4px;
    letter-spacing: 0.08em;
    font-weight: 600 !important;
}


.filter-icon-circle {
    background-color: #D9D9D9;
    border-radius: 50%;
    padding: 3px;
}

.mud-dark .filter-icon-circle {
    background-color: rgba(255, 255, 255, 0.15);
}
