@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background-color: #0e1117;
    color: rgba(250, 250, 250, 0.95);
    margin: 0;
    padding: 0;
    height: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Streamlit-style Layout */
.streamlit-layout {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

.streamlit-sidebar {
    width: 280px;
    min-width: 280px;
    background-color: #0e1117;
    border-right: 1px solid rgba(250, 250, 250, 0.1);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 1rem 0;
    border-bottom: 1px solid rgba(250, 250, 250, 0.1);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.streamlit-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-left: 280px;
    height: 100vh;
    overflow: hidden;
}

.streamlit-topbar {
    height: 64px;
    min-height: 64px;
    background: linear-gradient(90deg, #0e1117 0%, #1a1d29 100%);
    border-bottom: 1px solid rgba(250, 250, 250, 0.1);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    backdrop-filter: blur(10px);
}

.streamlit-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: #0e1117;
}

/* Mobile menu button - hidden on desktop */
.mobile-menu-button {
    display: none;
}

/* Mobile overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

/* Responsive design for mobile */
@media (max-width: 768px) {
    .mobile-menu-button {
        display: inline-flex !important;
    }

    .mobile-overlay {
        display: block;
    }

    .streamlit-sidebar {
        width: 280px;
        min-width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        z-index: 101;
    }

        .streamlit-sidebar.open {
            transform: translateX(0);
            box-shadow: 2px 0 12px rgba(0, 0, 0, 0.5);
        }

    .streamlit-main {
        margin-left: 0;
    }

    .streamlit-topbar {
        padding: 0 1rem;
    }
}

/* Scrollbar styling for dark theme */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: #0e1117;
}

::-webkit-scrollbar-thumb {
    background: rgba(250, 250, 250, 0.2);
    border-radius: 6px;
    border: 3px solid #0e1117;
}

    ::-webkit-scrollbar-thumb:hover {
        background: rgba(250, 250, 250, 0.3);
    }

h1:focus {
    outline: none;
}

/* Modern card/paper styling */
.mud-paper {
    background-color: #262730 !important;
    border-radius: 8px !important;
    border: 1px solid rgba(250, 250, 250, 0.1) !important;
    transition: all 0.2s ease-in-out !important;
}

    .mud-paper:hover {
        border-color: rgba(250, 250, 250, 0.15) !important;
        box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.4) !important;
    }

/* Button styling */
.mud-button-root {
    text-transform: none !important;
    font-weight: 500 !important;
    border-radius: 6px !important;
    transition: all 0.2s ease-in-out !important;
}

.mud-button-filled-primary {
    background: linear-gradient(135deg, #ff4b4b 0%, #ff6b6b 100%) !important;
}

    .mud-button-filled-primary:hover {
        background: linear-gradient(135deg, #ff6b6b 0%, #ff8b8b 100%) !important;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(255, 75, 75, 0.4) !important;
    }

.mud-button-filled-secondary {
    background: linear-gradient(135deg, #0068c9 0%, #0088e9 100%) !important;
}

    .mud-button-filled-secondary:hover {
        background: linear-gradient(135deg, #0088e9 0%, #00a8ff 100%) !important;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 104, 201, 0.4) !important;
    }

/* Navigation menu styling */
.mud-nav-link {
    border-radius: 6px !important;
    margin: 4px 12px !important;
    transition: all 0.2s ease-in-out !important;
    font-weight: 500 !important;
}

    .mud-nav-link:hover {
        background-color: rgba(250, 250, 250, 0.08) !important;
    }

    .mud-nav-link.active {
        background-color: rgba(255, 75, 75, 0.15) !important;
        color: #ff4b4b !important;
        font-weight: 600 !important;
    }

    .mud-nav-link .mud-nav-link-icon {
        color: rgba(250, 250, 250, 0.7);
    }

    .mud-nav-link.active .mud-nav-link-icon {
        color: #ff4b4b !important;
    }

/* Input fields styling */
.mud-input {
    background-color: #1a1d26 !important;
    border-radius: 6px !important;
}

.mud-input-root {
    border-radius: 6px !important;
}

.mud-input-outlined .mud-input-outlined-border {
    border-color: rgba(250, 250, 250, 0.2) !important;
}

.mud-input-outlined:hover .mud-input-outlined-border {
    border-color: rgba(250, 250, 250, 0.3) !important;
}

.mud-input-outlined.mud-input-focused .mud-input-outlined-border {
    border-color: #ff4b4b !important;
    border-width: 2px !important;
}

/* Table styling */
.mud-table {
    background-color: transparent !important;
}

.mud-table-root {
    background-color: #262730 !important;
    border-radius: 8px !important;
    overflow: hidden;
}

.mud-table-head {
    background-color: rgba(250, 250, 250, 0.03) !important;
}

.mud-table-row:hover {
    background-color: rgba(250, 250, 250, 0.05) !important;
}

/* Custom accent colors for Streamlit-like appearance */
.streamlit-accent {
    color: #ff4b4b;
}

.streamlit-secondary {
    color: #0068c9;
}

.streamlit-info {
    color: #29b5e8;
}

/* Code block styling */
code {
    background-color: #1a1d26;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: #ff4b4b;
}

pre {
    background-color: #1a1d26;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    border: 1px solid rgba(250, 250, 250, 0.1);
}

    pre code {
        background-color: transparent;
        padding: 0;
        color: rgba(250, 250, 250, 0.95);
    }

/* Links */
a {
    color: #0068c9;
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

    a:hover {
        color: #29b5e8;
        text-decoration: underline;
    }

/* Divider */
.mud-divider {
    border-color: rgba(250, 250, 250, 0.12) !important;
}

/* Chip styling */
.mud-chip {
    background-color: rgba(250, 250, 250, 0.1) !important;
    border-radius: 16px !important;
}

/* Alert/Banner styling */
.mud-alert {
    border-radius: 8px !important;
    border-left-width: 4px !important;
}

#blazor-error-ui {
    background: linear-gradient(135deg, #ff4b4b 0%, #b32121 100%);
    bottom: 0;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 1rem 1.5rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        font-size: 1.5rem;
        color: white;
        opacity: 0.8;
        transition: opacity 0.2s;
    }

        #blazor-error-ui .dismiss:hover {
            opacity: 1;
        }

    #blazor-error-ui .reload {
        color: white;
        text-decoration: underline;
        font-weight: 500;
    }

.blazor-error-boundary {
    background: linear-gradient(135deg, #ff4b4b 0%, #b32121 100%);
    padding: 1.5rem;
    color: white;
    border-radius: 8px;
    border-left: 4px solid rgba(255, 255, 255, 0.5);
    margin: 1rem 0;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
        font-weight: 500;
    }

/* Loading spinner */
.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: rgba(250, 250, 250, 0.1);
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #ff4b4b;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
    color: rgba(250, 250, 250, 0.95);
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
    letter-spacing: 0.05em;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

/* Smooth transitions */
* {
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

/* Selection color */
::selection {
    background-color: rgba(255, 75, 75, 0.3);
    color: rgba(250, 250, 250, 0.95);
}

::-moz-selection {
    background-color: rgba(255, 75, 75, 0.3);
    color: rgba(250, 250, 250, 0.95);
}

/* Markdown content styling */
.reasoning-content {
    color: rgba(250, 250, 250, 0.87);
    line-height: 1.7;
}

.reasoning-content h1,
.reasoning-content h2,
.reasoning-content h3,
.reasoning-content h4,
.reasoning-content h5,
.reasoning-content h6 {
    color: #9b59b6;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.reasoning-content h1 {
    font-size: 2rem;
    border-bottom: 2px solid rgba(155, 89, 182, 0.3);
    padding-bottom: 0.5rem;
}

.reasoning-content h2 {
    font-size: 1.5rem;
    border-bottom: 1px solid rgba(155, 89, 182, 0.2);
    padding-bottom: 0.4rem;
}

.reasoning-content h3 {
    font-size: 1.25rem;
}

.reasoning-content h4 {
    font-size: 1.1rem;
}

.reasoning-content p {
    margin-bottom: 1rem;
}

.reasoning-content ul,
.reasoning-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.reasoning-content li {
    margin-bottom: 0.5rem;
}

.reasoning-content strong {
    color: rgba(250, 250, 250, 0.95);
    font-weight: 600;
}

.reasoning-content em {
    color: rgba(250, 250, 250, 0.8);
    font-style: italic;
}

.reasoning-content code {
    background-color: rgba(155, 89, 182, 0.15);
    color: #bb86fc;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
}

.reasoning-content pre {
    background-color: rgba(26, 29, 38, 0.8);
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    border: 1px solid rgba(155, 89, 182, 0.2);
    margin-bottom: 1rem;
}

.reasoning-content pre code {
    background-color: transparent;
    padding: 0;
    color: rgba(250, 250, 250, 0.95);
}

.reasoning-content blockquote {
    border-left: 4px solid #9b59b6;
    padding-left: 1rem;
    margin-left: 0;
    margin-bottom: 1rem;
    color: rgba(250, 250, 250, 0.7);
    font-style: italic;
}

.reasoning-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.reasoning-content table th,
.reasoning-content table td {
    border: 1px solid rgba(250, 250, 250, 0.12);
    padding: 0.5rem;
    text-align: left;
}

.reasoning-content table th {
    background-color: rgba(155, 89, 182, 0.1);
    font-weight: 600;
}

.reasoning-content table tr:hover {
    background-color: rgba(250, 250, 250, 0.03);
}

.reasoning-content a {
    color: #9b59b6;
    text-decoration: none;
    border-bottom: 1px solid rgba(155, 89, 182, 0.3);
    transition: border-color 0.2s ease-in-out;
}

.reasoning-content a:hover {
    border-bottom-color: #9b59b6;
}

.reasoning-content hr {
    border: none;
    border-top: 1px solid rgba(250, 250, 250, 0.12);
    margin: 1.5rem 0;
}
