﻿:root {
    --bg: #0e0f12; /* page background */
    --panel: #111318; /* panels & sidebar */
    --soft: #1a1d24; /* message blocks */
    --soft-rgb: 26, 29, 36; /* RGB values for --soft */
    --border: #22252e;
    --muted: #a1a7b3;
    --text: #e8e9ee;
    --accent: #10a37f; /* teal-ish accent */
    --accent-2: #1e7a66;
    --danger: #ef4444;
    --radius: 16px;
    --radius-sm: 12px;
    --shadow: 0 10px 30px rgba(0,0,0,.35);
    --scrollbar-thumb: #2a3240;
    --scrollbar-thumb-hover: #3a4356;
    --textarea-background: #2a2a2e;
    --success-text: #a7f3d0;
    --failed-text: #fca5a5;
    --queued-text: #a5d8ff;
    --queued-rgb: 165, 216, 255;
    --processing-text: #fcd34d;
    --processing-rgb: 252, 211, 77;
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 8px; /* The missing one */
    --radius-lg: 12px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Reset-ish */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    color: var(--text);
    background: radial-gradient(1000px 600px at 75% -200px, rgba(16,163,127,.08), transparent 70%), var(--bg);
    font: 400 16px/1.5 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
    letter-spacing: .2px;
    background: var(--bg);
    transition: background 0.3s ease, color 0.3s ease;
}

    body.light-theme {
        --bg: #ffffff;
        --panel: #f2f3f5; /* sidebar panels */
        --soft: #f7f7f9; /* chat bubbles */
        --soft-rgb: 247, 247, 249; /* RGB values for --soft */
        --border: #d0d0d0;
        --muted: #666666;
        --text: #000000;
        --accent: #10a37f; /* teal-ish accent */
        --accent-2: #1e7a66;
        --danger: #d9534f;
        --shadow: 0 6px 20px rgba(0,0,0,.15);
        --scrollbar-thumb: #d0d0d0; /* Matches your light theme border */
        --scrollbar-thumb-hover: #b0b0b0; /* A slightly darker hover state */
        --textarea-background: #f7f7f9;
        --success-text: #438f6c;
        --failed-text: #b65f5f;
        --queued-text: #3b82f6;
        --queued-rgb: 59, 130, 246;
        --processing-text: #d97706; 
        --processing-rgb: 217, 119, 6;
    }

.theme-toggle {
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 6px;
    user-select: none;
}

button, input, textarea {
    font: inherit;
    color: inherit;
}

a {
    color: var(--accent);
    text-decoration: none;
}

/* App layout */
.app {
    display: grid;
    grid-template-columns: 280px 1fr;
    grid-template-rows: auto 1fr auto;
    grid-template-areas: "sidebar header" "sidebar main" "sidebar composer";
    height: 100dvh;
    overflow: hidden;
}

/* Sidebar */
/*.sidebar {
    grid-area: sidebar;
    background: linear-gradient(180deg, var(--panel), var(--panel));
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}*/
.sidebar {
    grid-area: sidebar;
    background: linear-gradient(180deg, var(--panel), var(--panel));
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100dvh; /* ✅ dynamic viewport height works better on iOS Safari */
    overflow: hidden; /* keep scroll only inside conversations */
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    /*padding: 16px 16px;*/
    padding: 16px 16px;
    border-bottom: 1px solid var(--border);
}
    .brand .logo {
        width: 28px;
        height: 28px;
        border-radius: 8px;
        flex-shrink: 0;
        background: conic-gradient(from 180deg at 50% 50%, var(--accent), var(--accent-2));
        box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 2px 10px rgba(16,163,127,.35);
    }
.brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.2;
}
    .brand h1 {
        font-size: 15px;
        margin: 0;
        letter-spacing: .4px;
        font-weight: 600;
    }
.powered-by {
    font-size: 10px; /* Much smaller than the main H1 */
    color: var(--muted); /* Assumes you have this variable, otherwise use #999 */
    opacity: 0.6; /* Low opacity to de-emphasize */
    font-weight: 400;
    letter-spacing: 0.2px;
}

    .powered-by strong {
        font-weight: 600;
        opacity: 0.8; /* Slightly more visible than the 'powered by' text */
    }

.sidebar .section-title {
    margin: 16px;
    margin-top: 20px;
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .12em;
}

/*.conversations {
    flex: 1;
    overflow: auto;
    padding: 0 8px 12px;
}*/
.conversations {
    flex: 1;
    overflow-y: auto; /* ✅ scroll only the chat list area */
    padding: 0 8px 12px;
    min-height: 0; /* ✅ ensures flexbox allows shrinking for scroll */
}
.conv-item {
    position: relative; /* This is crucial for positioning the dots */
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin: 6px 8px;
    border-radius: 12px;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: .2s ease;
}

    .conv-item:hover {
        background: var(--soft); /* ✅ theme-aware */
        border-color: var(--border);
    }

    .conv-item.active {
        background: var(--soft); /* ✅ theme-aware */
        border-color: var(--border);
    }

    .conv-item .dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--accent);
        box-shadow: 0 0 0 3px rgba(16,163,127,.12);
    }

    .conv-item .title {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        color: var(--text);
        font-size: 14px;
        padding-right: 14px;
    }
    /* Style for the disabled, processing chat room item */
    .conv-item.processing {
        opacity: 0.6;
        cursor: not-allowed;
        pointer-events: none; /* This makes the item unclickable */
    }

/* Style for the "Processing report..." text and spinner */
.processing-status {
    display: flex;
    align-items: center;
    font-size: 0.8em;
    color: #888; /* Or your theme's muted color */
    margin-top: 4px;
}

/* A simple CSS spinner animation */
.spinner {
    width: 12px;
    height: 12px;
    border: 2px solid #ccc;
    border-top-color: #333;
    border-radius: 50%;
    margin-right: 8px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
/*.sidebar .controls {
    padding: 12px;
    border-top: 1px solid var(--border);
    display: grid;
    gap: 8px;
}*/
.sidebar .controls {
    padding: 12px;
    border-top: 1px solid var(--border);
    display: grid;
    gap: 8px;
    flex-shrink: 0; /* ✅ keeps buttons always visible */
}

.sidebar .btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--panel);
    cursor: pointer;
    transition: .2s ease;
    text-align: left;
    color: var(--text);
}

    .sidebar .btn:hover {
        border-color: var(--border);
        background: var(--soft);
    }

    .sidebar .btn .icon {
        width: 16px;
        height: 16px;
        opacity: .9;
    }

/* Header */
.header {
    grid-area: header;
    position: sticky;
    top: 0;
    /*z-index: 1001;*/
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: color-mix(in srgb, var(--panel) 70%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

    .header .left {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .header .menu-btn {
        display: none;
    }

    .header .title {
        font-weight: 600;
        font-size: 14px;
        color: var(--text);
    }

    .header .actions {
        display: flex;
        gap: 8px;
    }

.ghost-btn {
    border: 1px solid var(--border);
    background: var(--panel);
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: .2s ease;
}

    .ghost-btn:hover {
        /* This adds a 5% black overlay, subtly darkening the button */
        background-color: rgba(0, 0, 0, 0.05);
        /* You can optionally make the border darker too for more contrast */
        border-color: var(--scrollbar-thumb);
    }

/* Make main chat area fill available space */
.main {
    grid-area: main;
    overflow: auto;
    padding: 20px 0 120px;
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    padding-bottom: 80px; /* leave space so messages don't hide behind composer */
    box-sizing: border-box;
}

/* Main wrapper */
.main {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 190px);
    padding: 0 12px;
    box-sizing: border-box;
}

.container {
    max-width: 860px;
    margin: 0 auto;
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    flex-direction: column;
    height: 100%;
    display: flex;
}

.msg {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 14px;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient( 180deg, var(--soft), rgba(var(--soft-rgb), 0.25) );
}

    .msg.user {
        background: transparent;
    }

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--soft);
    display: grid;
    place-items: center;
    font-size: 12px;
    color: var(--muted);
    border: 1px solid var(--border);
}

    .avatar.assistant {
        background: linear-gradient(135deg, var(--accent), var(--accent-2));
        color: var(--soft);
    }

.bubble {
    position: relative; /* Needed for absolute positioning of the button */
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow);
    transition: box-shadow .3s ease;
}
    .bubble:hover {
        background: var(--soft);
    }

.msg.user .bubble {
    background: var(--panel); /* ✅ theme-aware */
}

.bubble:hover {
    box-shadow: 0 14px 32px rgba(0,0,0,.45);
}

.bubble h3 {
    margin: 0 0 8px;
    font-size: 16px;
}

.bubble p {
    margin: 0;
    color: var(--text);
}

.bubble .meta {
    margin-top: 10px;
    font-size: 12px;
    color: var(--muted);
}

/* Markdown-ish content */
.bubble pre {
    background: #0c0f14;
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: 10px;
    overflow: auto;
}

.bubble code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 13px;
}

.bubble ul {
    margin: 6px 0 6px 20px;
}

.bubble blockquote {
    margin: 8px 0;
    padding-left: 12px;
    border-left: 3px solid var(--border);
    color: #b8c0cc;
}

/* Fix composer at bottom */
.composer {
    grid-area: composer;
    position: sticky; /* stays at bottom of viewport */
    bottom: 0;
    z-index: 10;
    background: linear-gradient(180deg, transparent, var(--panel) 40%, var(--panel) 70%);
    border-top: 1px solid var(--border);
}

    .composer .inner {
        max-width: 90%;
        margin: 0 auto;
        padding: 12px 16px 16px;
    }
.input-wrap {
    display: flex;
    flex-direction: column; /* stack chip row above input row */
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 8px;
    gap: 8px;
}
    .input-wrap textarea {
        width: 100%;
    }
textarea {
    background: transparent;
    border: 0;
    outline: none;
    resize: none;
    height: 48px;
    max-height: 220px;
    padding: 10px 12px;
    color: var(--text);
    scrollbar-width: thin;
    scrollbar-color: #2a3240 transparent;
}
.buttons {
    display: flex;
    align-items: center;
    gap: 8px; /* spacing between buttons */
}
.send-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--panel);
    cursor: pointer;
    transition: .2s ease;
}

    .send-btn:hover {
        color: white;
        background: var(--accent-2);
    }

    .send-btn:disabled {
        opacity: .5;
        cursor: not-allowed;
    }

.mic-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px; /* keeps same width/height as send */
    height: 42px;
    padding: 10px;
    border: none;
    background: none;
    cursor: pointer;
}

    .mic-btn svg {
        color: inherit; /* theme-aware */
    }

    .mic-btn.listening {
        color: var(--danger); /* red when active */
    }

.tips {
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    margin-top: 10px;
}
.upload-btn,
.mic-btn,
#sendBtn {
    /*display: inline-flex;*/
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--panel);
    cursor: pointer;
    transition: .2s ease;
}

    .upload-btn:hover,
    .mic-btn:hover,
    #sendBtn:hover {
        color: white;
        background: var(--accent-2);
    }
    .upload-btn{
        padding:10px;
    }
#sendBtn{
    padding:10px;
}
/* Utilities */
.row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.spacer {
    flex: 1;
}

.badge {
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #0f1219;
    color: #c5cbd6;
    font-size: 12px;
}

/* Mobile */
@media (max-width: 1000px) {
    .app {
        grid-template-columns: 1fr;
        grid-template-areas: "header" "main" "composer";
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: 90%;
        max-width: 320px;
        transform: translateX(-100%);
        transition: transform .3s ease;
        box-shadow: 30px 0 60px rgba(0,0,0,.45);
        z-index: 20;
    }

        .sidebar.open {
            transform: translateX(0);
        }

    .header .menu-btn {
        display: inline-flex;
    }
}

/* Nice scrollbars (desktop) */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--scrollbar-thumb-hover);
    }

.library-bar {
    background: var(--bg-light);
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

    .library-bar button {
        background: var(--accent);
        border: none;
        border-radius: 6px;
        padding: 6px 12px;
        color: white;
        cursor: pointer;
    }

        .library-bar button:hover {
            background: var(--accent-2);
        }

.modal {
    display: none; /* This keeps them hidden until opened by your JavaScript */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    /* These rules apply only when the modal is made visible */
    /* They will center the content box */
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--panel); /* ✅ theme-aware */
    margin: 7% auto;
    padding: 20px;
    border-radius: 10px;
    width: 400px;
    color: var(--text);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    /* Set a maximum height to prevent it from growing off-screen */
    max-height: 85vh;
    /* Add a scrollbar if the content inside is too tall */
    overflow-y: auto;
}
    .modal-content h2 {
        margin-top: 0;
        margin-bottom: 12px;
    }

/* Larger sizes */
.modal-lg {
    width: 600px;
}

.modal-xl {
    width: 900px;
}

.modal-xxl {
    width: 1200px;
}
.modal-xxxl {
    width: 90%;
}


.library-list {
    list-style: none;
    padding: 0;
}

    .library-list li {
        padding: 10px;
        border-radius: 6px;
        cursor: pointer;
        color: var(--text-light);
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
        .library-list li:hover {
            background: var(--bg-light);
            color: var(--text);
        }
        /* highlight selected item */
        .library-list li.selected {
            background-color: var(--accent);
            color: white;
            border-radius: 4px;
        }
.modal-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}
.library-settings-btn {
    /* Reset default button styles */
    background: none;
    border: none;
    /* Make the icon subtle by default */
    /* Interaction styles */
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm); /* Use your theme's small radius */
    /* Smooth transition for hover effect */
    transition: background-color 0.2s, color 0.2s;
}
    .library-settings-btn:hover {
        background-color: var(--soft); /* A subtle background on hover */
        color: var(--accent); /* Use your theme's accent color for the icon */
    }

.close {
    float: right;
    font-size: 20px;
    cursor: pointer;
}

.modal-footer {
    margin-top: 20px;
    text-align: right;
}
/* Main container for the new two-panel layout */
.step1-redesigned {
    display: flex;
    gap: 24px;
    border-top: 1px solid var(--border);
    margin-top: 16px;
    padding-top: 24px;
}

/* Left sidebar for categories */
.modal-sidebar {
    flex-shrink: 0; /* Prevents the sidebar from shrinking */
    width: 200px;
    border-right: 1px solid var(--border);
    padding-right: 24px;
}

.category-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    font-size: 1rem;
    background-color: transparent;
    border: none;
    color: var(--muted);
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 4px;
}

    .category-btn:hover {
        background-color: var(--soft);
        color: var(--text);
    }

    .category-btn.active {
        background-color: var(--accent-2);
        color: white;
        font-weight: 500;
    }

/* Main content area on the right */
.modal-main-content {
    flex-grow: 1; /* Allows the main content to take up the remaining space */
}

.category-description {
    color: var(--muted);
    margin-top: 0;
    margin-bottom: 24px;
}
.btn-primary {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s ease;
}

    .btn-primary:hover {
        background: var(--accent-2);
    }

.btn-secondary {
    background: var(--soft);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    cursor: pointer;
    white-space: nowrap;
}

    .btn-secondary:hover {
        background: var(--border);
    }

.chat-input {
    border-top: 1px solid #ddd;
    padding: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

    .chat-input textarea {
        flex: 1;
        min-height: 50px;
    }
.transcriptPagination {
    display: flex;
}
.flex-container {
    display: flex !important;
    align-items: flex-start;
    gap: 12px;
}
.hidden {
    display: none !important;
}

.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 16px;
}

    .empty-state textarea {
        width: 60%;
        min-height: 80px;
        margin: 1rem 0;
        padding: 10px;
        border-radius: var(--radius-sm);
        border: 1px solid var(--border);
        background: var(--soft);
        color: var(--text);
        resize: none;
    }

    .empty-state .ghost-btn {
        padding: 10px 16px;
        border-radius: var(--radius-sm);
        border: 1px solid var(--border);
        background: var(--panel);
        color: var(--text);
        cursor: pointer;
        transition: 0.2s;
    }

        .empty-state .ghost-btn:hover {
            background: var(--soft);
        }

.three-dots {
    position: absolute;
    right: 10px; /* Adjust as needed */
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    color: #888; /* A light grey color */
    padding: 5px; /* Makes it easier to click */
}
    .three-dots .system-lock-icon {
        color: var(--muted);
        font-size: 0.7rem;
        opacity: 0.7;
    }

.popup-menu {
    position: absolute;
    /* Use theme variables for colors */
    background-color: var(--panel);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    z-index: 1000;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.popup-option {
    padding: 10px 15px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    /* Use theme variables for text color */
    color: var(--text);
}

    .popup-option:hover {
        /* Use a color for hover effect, possibly a lighter version of the background */
        background-color: var(--soft);
    }

#txtRenameChatRoom {
    width: 100%; /* Makes the input fill the parent width */
    padding: 12px;
    margin: 10px 0;
    box-sizing: border-box; /* Ensures padding doesn't increase total width */
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    color: var(--text);
    background-color: var(--soft);
}

    #txtRenameChatRoom:focus {
        outline: none; /* Removes the default outline */
        border-color: var(--accent); /* Changes border color to accent color on focus */
        box-shadow: 0 0 5px var(--accent);
    }

.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100dvh;
    background: var(--bg);
    transition: background 0.3s ease, color 0.3s ease;
}

.login-box {
    background: var(--panel);
    padding: 32px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 380px;
    text-align: center;
    color: var(--text);
}

    .login-box .logo {
        width: 48px;
        height: 48px;
        border-radius: 12px;
        margin: 0 auto 12px;
        background: conic-gradient(from 180deg at 50% 50%, var(--accent), var(--accent-2));
        box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 2px 10px rgba(16,163,127,.35);
    }

    .login-box h1 {
        font-size: 20px;
        margin-bottom: 20px;
        font-weight: 600;
    }

    .login-box input {
        width: 100%;
        padding: 12px;
        margin: 10px 0;
        border-radius: var(--radius-sm);
        border: 1px solid var(--border);
        background: var(--soft);
        color: var(--text);
    }

        .login-box input:focus {
            border-color: var(--accent);
            outline: none;
            box-shadow: 0 0 5px var(--accent);
        }

    .login-box button[type="submit"] {
        width: 100%;
        padding: 12px;
        margin-top: 16px;
        background: var(--accent);
        color: #fff;
        border: none;
        border-radius: var(--radius-sm);
        font-weight: 600;
        cursor: pointer;
        transition: background 0.2s ease;
    }

        .login-box button[type="submit"]:hover {
            background: var(--accent-2);
        }

    .login-box .links {
        margin-top: 16px;
        font-size: 14px;
        color: var(--muted);
    }

        .login-box .links a {
            color: var(--accent);
            margin-left: 4px;
        }

/* Password Strength Meter */
.password-strength-meter {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    margin-bottom: 16px;
    height: 4px;
}

.strength-bar {
    flex: 1;
    height: 100%;
    background-color: var(--border); /* Default empty color */
    border-radius: 2px;
    transition: background-color 0.3s ease;
}

/* Strength Levels */
.strength-weak .bar-1 {
    background-color: #ef4444;
}
/* Red */

.strength-fair .bar-1,
.strength-fair .bar-2 {
    background-color: #f59e0b;
}
/* Orange */

.strength-good .bar-1,
.strength-good .bar-2,
.strength-good .bar-3 {
    background-color: #3b82f6;
}
/* Blue */

.strength-strong .bar-1,
.strength-strong .bar-2,
.strength-strong .bar-3,
.strength-strong .bar-4 {
    background-color: #10b981;
}
/* Green */

.strength-text {
    font-size: 12px;
    margin-top: 4px;
    color: var(--muted);
    text-align: right;
    min-height: 18px; /* Reserve space */
}

/* Wrapper to position the icon relative to the input */
.password-container {
    position: relative;
    display: block;
}

    /* The input needs space on the right so text doesn't overlap the icon */
    .password-container input {
        width: 100%;
        padding-right: 40px; /* Make room for the eye icon */
        box-sizing: border-box;
    }

/* The toggle button style */
.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%; /* Match input height for easier clicking */
}

    .password-toggle:hover {
        color: var(--text);
    }
.profile-dropdown {
    position: relative;
    display: inline-block;
}

.profile-btn {
    background: none;
    border: none;
    font-size: 14px;
    color: var(--text, #fff);
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 6px 10px;
}

    .profile-btn .chevron {
        width: 14px;
        height: 14px;
        margin-left: 6px;
        opacity: 0.6;
    }
.form-group {
    margin-bottom: 16px;
    position: relative;
}
    .form-group label {
        display: block;
        margin-bottom: 6px;
        font-size: 14px;
        color: var(--text);
        text-align: left;
    }

    .form-group input {
        width: 100%;
        padding: 12px;
        border-radius: 6px;
        border: 1px solid var(--border);
        font-size: 14px;
        background: var(--soft);
        color: var(--text);
    }
    .form-group select,
    .form-group textarea {
        width: 100%;
        padding: 10px 12px;
        border: 1px solid var(--border);
        border-radius: 4px;
        background-color: var(--textarea-background); /* Slightly lighter than modal background */
        color: var(--text);
        font-size: 1rem;
        box-sizing: border-box; /* Include padding and border in element's total width and height */
    }

    .form-group textarea {
        min-height: 120px;
        resize: vertical; /* Allow vertical resizing */
    }

        .form-group select:focus,
        .form-group textarea:focus {
            border-color: var(--primary-color);
            outline: none;
            box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.3); /* Assuming primary-rgb for shadow */
        }


.profile-menu {
    position: absolute;
    right: 2px;
    background: var(--panel, #1f1f1f);
    color: var(--text, #fff);
    border: 1px solid var(--border, #333);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    min-width: 180px;
    z-index: 1000;
    padding: 6px 0;
}

    .profile-menu.hidden {
        display: none;
    }

.menu-item {
    display: block;
    padding: 10px 14px;
    font-size: 14px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

    .menu-item:hover {
        background: rgba(255,255,255,0.1);
    }

.logout-form {
    margin: 0;
    padding: 0;
}

/*.logout-btn {
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    font-size: 14px;
    color: inherit;
    cursor: pointer;
}

    .logout-btn:hover {
        background: rgba(255,0,0,0.15);
        color: #ff6b6b;
    }*/
.logout-btn {
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    font-size: 14px;
    color: inherit;
    cursor: pointer;
    display: flex; /* flex row */
    align-items: center; /* vertical centering */
    gap: 8px; /* spacing between icon and text */
}

    .logout-btn:hover {
        background: rgba(255,0,0,0.15);
        color: #ff6b6b;
    }

    .logout-btn svg {
        display: block; /* remove baseline offset */
        width: 20px;
        height: 20px;
        flex-shrink: 0; /* keep icon size consistent */
    }


#profileForm {
    display: block; /* not flex */
    height: auto; /* shrink to fit */
}

    #profileForm hr {
        margin: 40px;
    }

.chat-layout {
    display: flex;
    gap: 24px;
    flex: 1 1 auto; /* take remaining height */
    overflow: hidden; /* prevent main scrollbar */
}

.chat-column {
    flex: 0 0 860px;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    scroll-behavior: smooth;
    border-right: 1px solid var(--border);
    padding-right: 4px;
}
.suggestions-btn {
    display: none;
}
.suggestions-sidebar {
    background: var(--soft);
    overflow-y: auto;
    padding: 12px;
    box-sizing: border-box;
    width: 320px; /* fixed width like left sidebar */
    border-left: 1px solid var(--border);
}
.suggestions-sidebar {
    flex: 0 0 360px;
    height: 100%; /* same as chat-column */
}
/* suggestions sidebar base */
.suggestions-sidebar {
    grid-area: suggestions;
    background: linear-gradient(180deg, var(--panel), var(--panel));
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

/* Header inside suggestions */
.suggestions-header {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 10px;
    display: flex;
    align-items: center; /* <-- vertically center icon + text */
    gap: 6px; /* optional spacing */
}

/* Make the chips vertical and small */
.suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Use your existing chip styles but make them block-level in a column */
.suggestion-chip {
    display: block;
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--soft);
    color: var(--text);
    cursor: pointer;
    font-size: 14px;
    line-height: 1.3;
    transition: background 0.15s ease, transform 0.08s ease;
    border: 1px solid transparent;
}

    .suggestion-chip:hover {
        background: var(--accent-2);
        color: #fff;
        transform: translateY(-1px);
    }

/* Responsive: stack on small screens */
@media (max-width: 1600px) {
    .chat-layout {
        flex-direction: column;
        gap: 12px;
    }

    .chat-column {
        flex: 1 1 auto;
    }

    .suggestions-btn {
        display: inline-flex; /* or flex/grid depending on your header buttons */
        align-items: center;
        justify-content: center;
        gap: 6px;
        cursor: pointer;
        padding: 8px 12px;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--panel);
    }
    .suggestions-sidebar {
        position: fixed;
        top: var(--header-height, 60px); /* adjust to your header’s real height */
        right: 0;
        bottom: 0;
        width: 90%;
        max-width: 320px;
        transform: translateX(100%);
        transition: transform .3s ease;
        z-index: 20;
        background: var(--soft);
        overflow-y: auto;
    }
        .suggestions-sidebar.open {
            transform: translateX(0);
        }
}

.chat-composer {
    flex: 0 0 auto; /* fixed height */
    display: flex;
    gap: 8px;
    padding: 12px 0;
    border-top: 1px solid var(--border);
}

/* New Library modal: grid & cards */
.new-lib-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 12px 0 8px;
}

.option-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    padding: 12px;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.02));
    border: 1px solid rgba(255,255,255,0.02);
    cursor: pointer;
    transition: transform .12s ease, background .12s ease, border-color .12s ease;
    text-align: left;
    color: var(--text);
}

    .option-card:hover {
        transform: translateY(-4px);
        background: var(--soft);
        border-color: var(--border);
    }

.option-icon {
    font-size: 22px;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(255,255,255,0.02);
}

.option-title {
    font-weight: 600;
    font-size: 15px;
}

.option-desc {
    font-size: 13px;
    color: var(--muted);
}

/* Make modal grid stack on narrow screens */
@media (max-width: 700px) {
    .new-lib-grid {
        grid-template-columns: 1fr;
    }

    .modal-content.modal-lg {
        width: 92%;
        margin: 6% auto;
    }
}

/* Trustpilot Preview Modal */
#trustpilotPreviewModal .modal-content.modal-xl {
    width: 90%; /* wider than normal */
    max-width: 1200px; /* optional hard cap */
    max-height: 90vh; /* never taller than viewport */
    overflow-y: auto; /* scroll reviews if too tall */
    display: flex;
    flex-direction: column; /* allow footer to stay at bottom */
    margin: 2% auto;
    position: relative;
}

#trustpilotPreviewModal .close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10; /* keep it above scrollable content */
}
/* Company info and review list should scroll inside */
#trustpilot-company-info {
    margin-bottom: 16px;
}

#trustpilot-review-list {
    flex: 1;
    overflow-y: auto;
    max-height: 60vh; /* keep space for header/footer */
    padding-right: 8px;
}

/* Review preview blocks */
.review-preview {
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
}

    .review-preview:last-child {
        border-bottom: none;
    }

.audio-transcript{
    width:100%;
}

/* Footer pinned at bottom */
#trustpilotPreviewModal .modal-footer {
    border-top: 1px solid var(--border);
    padding: 12px;
    background: var(--panel);
    position: sticky;
    bottom: 0;
}
/* optional quick spinner */
.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-left: 6px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}


.input-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto; /* textarea + 3 buttons */
    align-items: center;
    gap: 10px;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.file-chip {
    display: flex;
    align-items: center;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 4px 8px;
    font-size: 13px;
    color: var(--text);
}

    .file-chip .file-icon {
        margin-right: 6px;
    }

    .file-chip .remove-chip {
        background: none;
        border: none;
        color: var(--muted);
        margin-left: 8px;
        cursor: pointer;
    }
.file-uploader {
    display: flex!important;
    align-items: flex-start; /* Aligns items to the top */
    gap: 15px; /* Space between the button and the list */
}
.guidline-uploader {
    display: inline-flex !important;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding:5px;
}
#file-list-display {
    list-style: none;
    padding: 10px;
    margin: 0;
    font-family: sans-serif;
    font-size: 14px;
    line-height: 1.5;
    background-color: var(--soft);
    border: 1px solid #ccc;
    border-radius: 6px;
    flex: 1;
    min-height: 104px;
    /*overflow-y: auto;*/
}
    #file-list-display li {
        display: flex;
        justify-content: space-between; /* Pushes name and button to opposite ends */
        align-items: center; /* Vertically centers them */
        padding: 5px 10px;
        margin-bottom: 5px;
    }
.remove-file-btn {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
}
    .remove-file-btn:hover {
        color: var(--danger);
    }
.btn-danger {
    background-color: var(--danger);
    color: white;
    /* Inherits other .btn styles if you have them */
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
}

    .btn-danger:hover {
        opacity: 0.8;
    }
#newLibStepGuideline small {
    color: var(--muted);
    display: block;
    margin-top: 4px;
    text-align: right;
}
/* Style the parent label to be a flex container */
.file-uploader .upload-btn {
    display: flex; /* Arrange children (icon and text) in a row */
    align-items: center; /* Vertically align them in the middle */
    cursor: pointer; /* Show a pointer on hover */
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    width: 100%; /* Ensure it takes up the full width */
    box-sizing: border-box;
}

/* Style the text span to handle long filenames gracefully */
#fileNameDisplay {
    margin-left: 10px; /* Add some space between the icon and text */
    white-space: nowrap; /* Prevent the text from wrapping to a new line */
    overflow: hidden; /* Hide any text that overflows the container */
    text-overflow: ellipsis; /* Add "..." if the filename is too long */
    flex-grow: 1; /* Allow the text to take up available space */
}
/* Base style for the option cards */
.option-card.new-chat-option {
    border: 2px solid #ddd; /* A subtle default border */
    background-color: var(--panel); /* A light, complementary background */
    transition: all 0.2s ease-in-out; /* Smooth transition for all changes */
}

    /* Style for when the user hovers over an option */
    .option-card.new-chat-option:hover {
        border-color: #aaa;
        transform: translateY(-2px); /* Lifts the card slightly */
    }

    /* --- THIS IS THE KEY --- */
    /* Style for the selected/active option card */
    .option-card.new-chat-option.active {
        border-color: #007bff; /* A bright color to show selection */
        background-color: var(--accent);
        transform: translateY(-2px);
    }

.complianceBtn{
    color: inherit;
}
.progress-bar-container {
    width: 100%;
    background-color: var(--soft);
    border-radius: 5px;
    margin-top: 10px;
    overflow: hidden;
}

.progress-bar {
    width: 0%; 
    height: 24px;
    background-color: var(--accent); 
    text-align: center;
    line-height: 24px;
    color: white;
    transition: width 0.4s ease; /* Smooth animation for the bar */
}

/* in wwwroot/css/prompt-library.css */

.prompt-library-page .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid #333;
    padding-bottom: 1rem;
}

/* Empty State Styling */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background-color: var(--bg-surface); /* Replaces #2a2a2e */
    border: 2px dashed var(--border); /* Replaces #555 */
    border-radius: var(--radius-md); /* Replaces 8px (if using the variable) */

    margin-top: 2rem;
}
.empty-state-icon .icon {
    width: 64px;
    height: 64px;
    stroke: var(--muted); 
    margin-bottom: 1rem;
}
/* Prompt Definition Accordion */
.prompt-definition {
    background-color: var(--soft);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 32px;
}

    .prompt-definition summary {
        font-weight: 600;
        padding: 16px;
        cursor: pointer;
        outline: none;
    }

    .prompt-definition .prompt-parts {
        padding: 0 16px 16px 16px;
        border-top: 1px solid var(--border);
    }

    .prompt-definition h4 {
        color: var(--text);
        font-size: 0.8rem;
        text-transform: uppercase;
        margin: 16px 0 4px 0;
    }

    .prompt-definition p {
        margin: 0;
        color: var(--text);
    }
.date-filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-filter {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 16px; /* Pill shape */
    cursor: pointer;
    transition: all 0.2s ease;
    /* --- THEME UPDATES --- */
    border: 1px solid var(--border);
    background-color: var(--soft);
    color: var(--muted);
}

    .btn-filter:hover {
        /* Use a slightly lighter background on hover */
        background-color: var(--textarea-background);
        color: var(--text);
    }

    .btn-filter.active {
        /* Use your main accent color for the selected state */
        background-color: var(--accent);
        border-color: var(--accent-2);
        color: white; /* Use a high-contrast color for text */
        font-weight: 500;
    }
.schedule-options {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 16px;
    margin-top: 20px;
}

    .schedule-options legend {
        padding: 0 8px;
        font-weight: 600;
        color: #eee;
    }

.schedule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.form-group small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.8rem;
}
.markdown-body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text); /* Use the main text color for the theme */
}

    .markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4, .markdown-body h5, .markdown-body h6 {
        color: var(--text); /* Use the main text color for headings */
        margin-top: 1.5em;
        margin-bottom: 0.5em;
        line-height: 1.2;
    }

    .markdown-body h1 {
        font-size: 2.2em;
        /* Use the theme's border color */
        border-bottom: 1px solid var(--border);
        padding-bottom: 0.3em;
    }

    .markdown-body h2 {
        font-size: 1.8em;
        /* Use the theme's border color */
        border-bottom: 1px solid var(--border);
        padding-bottom: 0.3em;
    }

    .markdown-body h3 {
        font-size: 1.5em;
    }

    .markdown-body h4 {
        font-size: 1.2em;
    }

    .markdown-body p {
        margin-bottom: 1em;
    }

    .markdown-body ul, .markdown-body ol {
        margin-left: 20px;
        margin-bottom: 1em;
        list-style-type: disc;
    }

    .markdown-body ol {
        list-style-type: decimal;
    }

    .markdown-body li {
        margin-bottom: 0.5em;
    }

    .markdown-body strong {
        font-weight: bold;
        /* Use your theme's main accent color for consistency */
        color: var(--accent);
    }
.report-metadata {
    background-color: var(--border);
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid var(--accent);
}

    .report-metadata p {
        margin: 0;
        padding: 2px 0;
        color: var(--muted); 
    }

    .report-metadata strong {
        color: var(--text); 
    }
    
.header-title h1 {
    font-size: 1.8rem;
    margin: 0 0 4px 0;
}

.prompt-id {
    font-size: 0.8rem;
    color: var(--muted);
    font-family: monospace;
}

.header-actions {
    display: flex;
    gap: 12px;
}
.page-container {
    padding: 24px;
    height: 100%;
    overflow-y: auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 16px;
    margin-bottom: 24px;
}

    .page-header h1 {
        font-size: 1.8rem;
        margin: 0;
    }

    .page-header .btn {
        display: flex;
        align-items: center;
        gap: 8px;
    }

.prompt-meta-actions {
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: right;
    font-size: 0.8rem;
}

    .prompt-meta-actions a {
        margin-left: 16px;
    }

/* Run History Table */
.run-history h2 {
    font-size: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
    margin-bottom: 16px;
}

.run-history table {
    width: 100%;
    border-collapse: collapse;
}

.run-history th, .run-history td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.run-history th {
    color: #aaa;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.run-history tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}
.run-history .question-cell {
    max-width: 250px; /* Adjust width as needed */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}
.status-queued {
    color: var(--queued-text);
    background-color: rgba(var(--queued-rgb), 0.2);
}
.status-completed {
    color: var(--success-text);
    background-color: rgba(16, 185, 129, 0.2);
}

.status-failed {
    color: var(--failed-text);
    background-color: rgba(239, 68, 68, 0.2);
}
.status-processing {
    color: var(--processing-text);
    background-color: rgba(var(--processing-rgb), 0.2);
}




.form-column .form-group textarea {
    min-height:100px;
}

.step-indicator {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.step {
    background: var(--soft);
    color: var(--muted);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    border: 1px solid var(--border);
    transition: background 0.2s ease, color 0.2s ease;
}

    .step.active {
        background: var(--accent);
        color: var(--text);
        border-color: var(--accent-2);
    }

.form-flex {
    display: flex;
    gap: 25px;
}

.form-column {
    flex: 1;
}

.preview-column {
    flex: 1;
    background: var(--soft);
    border-left: 2px solid var(--border);
    padding: 15px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}

.prompt-preview {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px;
    height: 812px;
    overflow-y: auto;
    white-space: pre-wrap;
    color: var(--text);
}

/* Tooltip / Info icon */
.info-icon {
    cursor: help;
    margin-left: 6px;
    color: var(--muted);
    transition: color 0.2s ease;
}

    .info-icon:hover {
        color: var(--accent);
    }

/* Small secondary button */
.btn-small {
    margin-top: 5px;
    background: var(--soft);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 0.85em;
    color: var(--text);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

    .btn-small:hover {
        background: var(--accent);
        border-color: var(--accent-2);
        color: #fff;
    }

/* Outline secondary button (footer) */
.btn-outline-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px; /* matches .btn-primary and .btn-secondary */
    border-radius: var(--radius-sm); /* consistent with your button corners */
    font-size: 0.95em;
    font-weight: 500;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

    .btn-outline-secondary:hover {
        background: var(--accent);
        border-color: var(--accent-2);
        color: #fff;
        box-shadow: var(--shadow);
    }

    .btn-outline-secondary:active {
        background: var(--accent-2);
        border-color: var(--accent-2);
    }


.modal .subtext {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1em;
}

.hint {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5em;
}

.examples {
    list-style: disc;
    margin-left: 1.5em;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.date-filter-container.scrollable {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid var(--border);
    padding: 0.5em;
    border-radius: 0.5em;
}
#dateFilterSectionRunNow {
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}
#selectionSummary{
    min-height:20px;
}

input[type="file"] {
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
}

    input[type="file"]::file-selector-button {
        background-color: var(--accent);
        color: var(--text);
        border: none;
        padding: 6px 14px;
        border-radius: 6px;
        cursor: pointer;
        transition: background-color 0.2s ease;
    }

        input[type="file"]::file-selector-button:hover {
            background-color: var(--accent-2);
        }

        input[type="file"]::file-selector-button:active {
            background-color: #004fa8;
        }





/* Style for the status lists (processing and failed) */
.library-status-list {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background-color: var(--soft);
    overflow: hidden;
}

    .library-status-list li {
        padding: 12px 16px;
        border-bottom: 1px solid var(--border);
    }

        .library-status-list li:last-child {
            border-bottom: none;
        }

/* Specific styling for the "Failed" section */
.failed-title {
    color: var(--danger);
}

.failed-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.failed-name {
    font-weight: 500;
}

.failed-actions button {
    margin-left: 8px;
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid transparent;
}
.pending-item {
    display: flex;
    justify-content: space-between; /* Pushes the name and status to opposite ends */
    align-items: center;
    cursor: help; /* Indicates to the user that they can hover for more info (the title) */
    /* Apply a slightly different background to distinguish it from "available" libraries */
    background-color: var(--soft);
}

/* The <span> holding the library name */
.pending-name {
    font-weight: 500;
    color: var(--muted); /* Use muted text to show it's not active */
    font-style: italic;
}

/* The <span> holding the "Pending Import" text */
.pending-status-text {
    color: var(--queued-text); /* Use the theme's "queued" color */
    font-size: 0.8rem;
    font-weight: 500;
}

.btn-retry {
    background-color: var(--accent-2);
    color: white;
    border-color: var(--accent);
}

.btn-clear {
    background-color: transparent;
    color: var(--muted);
    border-color: var(--muted);
}

    .btn-clear:hover {
        background-color: var(--danger);
        color: white;
        border-color: var(--danger);
    }
.section-title h3 {
    display: flex;
    align-items: center;
    gap: 8px;
}

    .section-title h3 svg {
        flex-shrink: 0;
    }

    .section-title h3 span {
        line-height: 1.4;
    }
/* Typing Indicator Animation */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 10px 0; /* Add some vertical space */
}

    .typing-indicator span {
        height: 8px;
        width: 8px;
        border-radius: 50%;
        background-color: var(--muted); /* Use your theme's muted color */
        margin: 0 2px;
        animation: bounce 1.2s infinite ease-in-out;
    }

        /* Add delays to create the wave effect */
        .typing-indicator span:nth-child(2) {
            animation-delay: -1.0s;
        }

        .typing-indicator span:nth-child(3) {
            animation-delay: -0.8s;
        }

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1.0);
    }
}

.bubble-content details {
    margin-top: 16px;
    border-top: 1px solid var(--border);
    padding-top: 8px;
}

.bubble-content summary {
    cursor: pointer;
    font-weight: 500;
    color: var(--muted);
    outline: none; /* Removes the focus ring in some browsers */
}

    .bubble-content summary:hover {
        color: var(--accent);
    }

.bubble-content details ul {
    margin-top: 8px;
    margin-left: 20px;
    font-size: 0.9rem;
}
.btn-new-chat {
    display: flex;
    align-items: center;
    gap: 10px;
    width: calc(100% - 32px); /* Full width with 16px padding */
    margin: 10px 16px 16px 16px;
    padding: 10px 12px;
    font-size: 0.9rem;
    font-weight: 500;
    background-color: var(--soft);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color 0.2s;
}

    .btn-new-chat:hover {
        background-color: var(--border);
    }

    .btn-new-chat .fa-sparkle {
        color: var(--accent);
    }
/*
 * Button: Primary Subtle
 * A lighter, less obtrusive version of the primary button.
 * Perfect for secondary actions or actions within a card.
*/
.btn-primary-subtle {
    /* Reset default button styles */
    border: 1px solid var(--border);
    background-color: var(--soft);
    /* Text & Font */
    color: var(--accent); /* Use the accent color for the text */
    font-weight: 500;
    font-size: 0.85rem;
    /* Spacing & Shape */
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    /* Other */
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    /* Flex for the icon */
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

    /* Hover & Focus State */
    .btn-primary-subtle:hover,
    .btn-primary-subtle:focus {
        background-color: var(--accent); /* Invert to the solid primary color on hover */
        color: #ffffff; /* White text on hover */
        border-color: var(--accent);
    }

    /* Disabled State */
    .btn-primary-subtle:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        background-color: var(--soft);
        color: var(--muted);
        border-color: var(--border);
    }

    /* Styling for the FontAwesome icon inside the button */
    .btn-primary-subtle .fas {
        font-size: 0.8em; /* Make the icon slightly smaller than the text */
    }
/*
 * Button: Success Subtle
 * Used for positive confirmation states (e.g., "Added", "Saved").
 * Uses a light green background with darker green text.
*/
.btn-success-subtle {
    /* Structure (Matches btn-primary-subtle) */
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    /* Typography */
    font-weight: 500;
    font-size: 0.85rem;
    /* Colors: Emerald Green theme */
    /* Background: 10% opacity green */
    background-color: rgba(16, 185, 129, 0.1);
    /* Text: Solid green */
    color: #10b981;
    /* Border: 20% opacity green */
    border: 1px solid rgba(16, 185, 129, 0.2);
    /* Interaction */
    cursor: default; /* Use 'default' because the action ("Added") is already done */
    transition: background-color 0.2s, border-color 0.2s;
}

    /* Optional: Slight hover effect if you want it to feel interactive */
    .btn-success-subtle:hover {
        background-color: rgba(16, 185, 129, 0.2);
        border-color: #10b981;
    }

    /* Ensure the icon matches the text color */
    .btn-success-subtle i {
        font-size: 0.9em;
    }
/* Intro text */
.modal-intro {
    color: var(--muted);
    margin-bottom: 24px;
}

/* Grid for the two data sources */
.kb-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

/* Individual Card Styling */
.kb-card {
    display: flex;
    align-items: flex-start;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background-color: var(--bg-surface);
}

.kb-card-icon {
    font-size: 24px;
    margin-right: 16px;
    padding: 10px;
    border-radius: 50%;
}

    .kb-card-icon.primary {
        background-color: rgba(var(--accent-rgb), 0.1);
        color: var(--accent);
    }

    .kb-card-icon.secondary {
        background-color: #e2e8f0;
        color: #64748b;
    }

.kb-card-content h4 {
    margin: 0 0 4px 0;
    font-size: 1rem;
    font-weight: 600;
}

.kb-card-content p {
    margin: 0 0 12px 0;
    font-size: 0.85rem;
    color: var(--muted);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

    .status-badge.active {
        background-color: #dcfce7;
        color: #166534;
    }

    .status-badge.inactive {
        background-color: #f1f5f9;
        color: #64748b;
    }

/* Footer Action */
.kb-actions-footer {
    display: flex; /* Enables side-by-side layout */
    justify-content: flex-end; /* Pushes everything to the Right */
    align-items: center; /* Vertically centers buttons if heights differ */
    gap: 15px; /* Adds space between the two buttons */
    margin-top: 20px; /* Spacing from the content above */
    padding-top: 15px;
    border-top: 1px solid var(--border); /* Optional: Nice separator line */
}
.btn-lg {
    padding: 10px 24px;
    font-size: 1rem;
}
.html2pdf__page-break {
    margin-top: 1rem;
}

.pdf-export-mode {
    background-color: #ffffff !important;
    color: #000000 !important;
}

    /* Force all children (text, borders) to be high-contrast black for the printer */
    .pdf-export-mode * {
        color: #000000 !important;
        border-color: #dddddd !important; /* Keep borders visible but subtle */
    }

    /* Fix for Markdown tables in PDF */
    .pdf-export-mode table {
        width: 100% !important;
        table-layout: fixed;
    }


/* Fix for Markdown tables in PDF to ensure they span full width */
.markdown-body table {
    width: 100% !important;
    table-layout: fixed;
}
/* Action Buttons Container (Keeps them aligned) */
.action-buttons {
    display: flex;
    align-items: center;
    gap: 8px; /* Space between buttons */
    white-space: nowrap; /* Prevents wrapping */
}

/* Base style for ALL icon buttons in the table */
.btn-icon {
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    padding: 8px; /* Square-ish look */
    border-radius: 4px;
    font-size: 16px; /* Slightly larger suitable for icons */
    line-height: 1;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* View Variant (e.g., Blue) */
.btn-icon-primary {
    color: #0d6efd; /* Bootstrap primary blue, adjust as needed */
}

    .btn-icon-primary:hover:not(:disabled) {
        background-color: rgba(13, 110, 253, 0.1);
        border-color: rgba(13, 110, 253, 0.2);
    }

/* Delete Variant (Red) */
.btn-icon-danger {
    color: #ef4444;
}

    .btn-icon-danger:hover:not(:disabled) {
        background-color: rgba(239, 68, 68, 0.1);
        border-color: rgba(239, 68, 68, 0.2);
    }

/* Disabled State for Icons (e.g., greyed out eye) */
.btn-icon:disabled, .btn-icon.disabled {
    color: #adb5bd; /* Muted grey */
    cursor: not-allowed;
    pointer-events: none; /* Prevents clicks */
}

/* --- PDF Export Print Styles --- */

/* 1. Set the page background to white */
.pdf-export-mode {
    background-color: #ffffff !important;
    background-image: none !important;
}

    /* 2. Fix the Metadata Header (The "Shadow" fix) */
    .pdf-export-mode .report-metadata {
        /* Remove any shadows that look weird in PDF */
        box-shadow: none !important;
        border: none !important;
        background: transparent !important;
        /* Add a clean, sharp bottom line */
        /* Spacing */
        padding-bottom: 20px !important;
        margin-bottom: 25px !important;
    }

        /* 3. Ensure Metadata TEXT is black (so it's readable against white) */
        .pdf-export-mode .report-metadata p,
        .pdf-export-mode .report-metadata strong,
        .pdf-export-mode .report-metadata span {
            color: #000000 !important;
        }

    /* 4. Handle Body Text - Make paragraphs black for readability */
    .pdf-export-mode .markdown-body p,
    .pdf-export-mode .markdown-body li,
    .pdf-export-mode .markdown-body td {
        color: #1a1a1a !important; /* Dark Gray/Black */
    }

    /* 5. (Optional) Preserve Accent Colors for Headings & Links 
   If you want them to stay Green/Theme Colored, DO NOT add rules for h1-h6 here. 
   If they are White in your app (Dark Mode), you MUST force them to a color: */
    .pdf-export-mode h1,
    .pdf-export-mode h2,
    .pdf-export-mode h3,
    .pdf-export-mode h4 {
        color: #000000 !important;
        page-break-after: avoid !important; /* Don't break immediately after a header */
        break-after: avoid !important;
        page-break-inside: avoid !important; /* Don't slice a header in half */
        break-inside: avoid !important;
    }
    .pdf-export-mode p,
    .pdf-export-mode li,
    .pdf-export-mode span {
        page-break-inside: auto !important; /* ALLOW splitting */
        break-inside: auto !important;
    }
    /* Fix for tables stretching */
    .pdf-export-mode table {
        width: 100% !important;
        table-layout: fixed;
        border-collapse: collapse;
    }

    .pdf-export-mode th,
    .pdf-export-mode td {
        border: 1px solid #ddd !important;
        color: #000 !important;
    }
    .pdf-export-mode img,
    .pdf-export-mode tr,
    .pdf-export-mode table {
        page-break-inside: avoid !important; /* PREVENT splitting */
        break-inside: avoid !important;
    }
    /* 1. Turn off default numbering for OL inside the PDF mode */
    .pdf-export-mode ol {
        list-style: none !important;
        counter-reset: pdf-counter !important; /* Initialize a custom counter */
        padding-left: 10px !important; /* Reset default padding, keep it small */
    }

        /* 2. Style the list item to create space for our custom number */
        .pdf-export-mode ol > li {
            position: relative !important;
            counter-increment: pdf-counter !important; /* Increment the counter */
            padding-left: 25px !important; /* Create a "Safe Zone" on the left for the number */
            margin-bottom: 8px !important; /* Add space between items */
            color: #000000 !important;
        }

            /* 3. Create the custom number using ::before */
            .pdf-export-mode ol > li::before {
                content: counter(pdf-counter) "." !important; /* Display the number + dot */
                position: absolute !important;
                left: 0 !important;
                top: 0 !important;
                /* Styling to match your text */
                font-weight: bold !important;
                color: #000000 !important;
                width: 20px !important; /* Fixed width ensures alignment */
            }
    .pdf-export-mode .markdown-body div,
    .pdf-export-mode .markdown-body blockquote {
        page-break-inside: auto !important;
        break-inside: auto !important;
    }
    .pdf-export-mode blockquote,
    .pdf-export-mode pre {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
/* --- User Table Styles --- */

.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background-color: var(--accent); /* Default color */
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
}

.user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.user-name {
    font-weight: 500;
    color: var(--text);
}

.user-email {
    font-size: 0.85rem;
    color: var(--muted);
}

/* --- Role Badges --- */
.role-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Color coding for roles */
.role-admin {
    background-color: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
    border: 1px solid rgba(139, 92, 246, 0.2);
}
/* Purple */
.role-manager {
    background-color: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}
/* Blue */
.role-contributor {
    background-color: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}
/* Green */
.role-agent {
    background-color: rgba(100, 116, 139, 0.15);
    color: #64748b;
    border: 1px solid rgba(100, 116, 139, 0.2);
}
/* Slate/Gray */
.role-system {
    background-color: rgba(244, 63, 94, 0.15);
    color: #f43f5e;
    border: 1px solid rgba(244, 63, 94, 0.2);
}
/* Rose/Red */

/* --- Status Dots --- */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

    .status-dot.active {
        background-color: #10b981;
        box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
    }

    .status-dot.inactive {
        background-color: #cbd5e1;
    }

/* Checkbox grouping */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

    .checkbox-group input[type="checkbox"] {
        width: 18px;
        height: 18px;
        accent-color: var(--accent);
    }
/* 1. Ensure the container handles overflow correctly */
.table-scroll-container {
    /*width: 100%;*/
    flex: 1;
    overflow-x: auto; /* Adds scrollbar only if needed */
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background-color: var(--bg-surface); /* Ensures background fills the space */
}

/* 2. Force the table to fill the container */
.kb-table {
    width: 100% !important; /* Force full width */
    border-collapse: collapse;
    /* CRITICAL: This makes the browser strictly respect your "width: 40%" styles */
    /* Without this, the browser calculates column widths based on text content length */
    table-layout: fixed;
}
/* 1. General Table Styling */
.kb-table {
    width: 100% !important;
    border-collapse: collapse;
    margin-top: 10px;
}

    /* 2. SHARED STYLES for Headers and Cells */
    .kb-table th,
    .kb-table td {
        /* Adds substantial breathing room (Top/Bottom, Left/Right) */
        padding: 16px 24px;
        /* Align text to the left for better readability */
        text-align: left;
        /* Ensure borders match your theme */
        border-bottom: 1px solid var(--border);
        /* Align content to the top (useful if one cell wraps and becomes tall) */
        vertical-align: top;
    }

    /* 3. HEADER SPECIFIC STYLES */
    .kb-table th {
        background-color: var(--bg-surface); /* Slight background distinction */
        font-weight: 600;
        color: var(--muted);
        font-size: 0.85rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        /* Sticky Header (Optional: keeps header visible while scrolling) */
        position: sticky;
        top: 0;
        z-index: 10;
    }
    .kb-table th {
        position: sticky;
        top: 0;
        z-index: 10; /* Ensure it stays on top of the checkboxes */
        /* CRITICAL: Background color is needed so content doesn't show through */
        background-color: var(--panel);
        /* Optional: A subtle border or shadow helps separate header from scrolling content */
        box-shadow: 0 1px 0 var(--border);
    }

        /* 4. ACTION COLUMN SPECIFIC (The last column) */
        /* We usually want buttons to be centered and vertically aligned */
        .kb-table th:last-child,
        .kb-table td:last-child {
            text-align: center; /* Center the buttons horizontally */
            vertical-align: middle; /* Center the buttons vertically */
            width: 120px; /* Prevent it from getting squeezed */
            padding: 12px; /* Slightly tighter padding for buttons */
        }
/* Fix for the Modal Header layout */
#userManagementModal .kb-header-main {
    display: flex;
    justify-content: space-between; /* Pushes search to left, button to right */
    align-items: center; /* Vertically centers them */
    gap: 20px; /* Adds space between search and button */
    width: 100%;
}

/* Ensure the search container doesn't take up 100% width unnecessarily */
#userManagementModal .header-search-container {
    flex-grow: 1; /* Allows search to expand */
    max-width: 400px; /* But caps it at a reasonable width */
    margin: 0; /* Removes default margins */
}

/* Ensure the form inside is flex too */
#userManagementModal .search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}
/* 1. Align the container */
.search-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

    /* 2. Force exact matching height and shape */
    .search-form .header-search-input,
    .search-form .search-submit-btn {
        /* Explicit height ensures they are identical pixel-for-pixel */
        height: 36px;
        /* Ensure padding doesn't add to the height */
        box-sizing: border-box;
        /* Match the Border Radius (using your theme variable) */
        border-radius: var(--radius-sm) !important;
    }

    /* 3. Refine the Input Text */
    .search-form .header-search-input {
        /* Reset padding to center text vertically within the fixed height */
        padding: 0 12px;
        line-height: 36px;
    }

    /* 4. Refine the Button */
    .search-form .search-submit-btn {
        /* Make the button a square shape */
        width: 36px;
        /* Center the icon */
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        /* OPTIONAL: Give the button a border to match the input box visual weight */
        border: 1px solid var(--border);
    }
.btn-danger-subtle {
    /* Structure */
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px; /* Slightly larger padding for touch targets */
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    /* Colors: Red Theme */
    background-color: rgba(239, 68, 68, 0.1); /* Very light red */
    color: #ef4444; /* Standard red text */
    border: 1px solid rgba(239, 68, 68, 0.2); /* Subtle border */
}

    /* Hover State */
    .btn-danger-subtle:hover {
        background-color: rgba(239, 68, 68, 0.15); /* Slightly darker background */
        border-color: rgba(239, 68, 68, 0.4);
        transform: translateY(-1px); /* Tiny lift effect */
    }

    /* Active/Pressed State */
    .btn-danger-subtle:active {
        background-color: rgba(239, 68, 68, 0.25);
        transform: translateY(0);
    }

    /* Icon spacing fix */
    .btn-danger-subtle i {
        font-size: 1rem;
        opacity: 0.9;
    }
/* Container for the scrollable list */
#faqResultContainer {
    max-height: 65vh; /* Keep header/footer visible */
    overflow-y: auto;
    padding: 10px;
    background-color: var(--bg-surface);
    border-radius: 6px;
}

/* Individual FAQ Card */
.faq-card {
    background: var(--soft);
    border-left: 4px solid var(--accent); /* Primary accent color */
    border-radius: 0.35rem;
    margin-bottom: 1rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.1);
    transition: transform 0.15s ease-in-out;
}

    .faq-card:hover {
        transform: translateY(-2px); /* Subtle lift effect */
    }

/* Question Header */
.faq-question {
    padding: 1rem 1.25rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: flex-start;
}

    .faq-question i {
        color: var(--accent);
        margin-right: 10px;
        margin-top: 4px; /* Align icon with text */
    }

/* Answer Body */
.faq-answer {
    padding: 1rem 1.25rem;
    color: var(--text);
    line-height: 1.6;
    font-size: 0.95rem;
    display: flex;
    align-items: flex-start;
}

    .faq-answer i {
        color: #1cc88a; /* Green for answer */
        margin-right: 10px;
        margin-top: 5px;
    }

/* Source Link Badge */
.faq-source {
    font-size: 0.75rem;
    color: #858796;
    padding: 0.5rem 1.25rem;
    background-color: #f8f9fc;
    border-top: 1px solid #f1f1f1;
    text-align: right;
}
/* Container for the new section */
.additional-sources-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border); /* Light gray separator */
}

/* Header Row Flexbox */
.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

    .section-header-row h3 {
        font-size: 1.1rem;
        font-weight: 600;
        margin: 0 0 5px 0;
        color: var(--text);
    }

.section-desc {
    font-size: 0.9rem;
    color: var(--muted);
    margin: 0;
}

/* The List Container */
.external-sources-list {
    background-color: var(--panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px;
    min-height: 60px;
}

/* Individual Rows (Dynamic) */
.source-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--panel);
    padding: 8px 12px;
    margin-bottom: 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
}

    .source-row:last-child {
        margin-bottom: 0;
    }

.source-domain {
    font-weight: 500;
    margin-right: 10px;
}

.empty-state-text {
    text-align: center;
    color: var(--muted);
    font-style: italic;
    padding: 10px;
}

/* Badges for Categories */
.badge-warning {
    background-color: #fff3cd;
    color: #856404;
    padding: 0.25em 0.6em;
    font-size: 0.75em;
    border-radius: 4px;
}

.badge-info {
    background-color: #d1ecf1;
    color: #0c5460;
    padding: 0.25em 0.6em;
    font-size: 0.75em;
    border-radius: 4px;
}
/* Custom styling for the 'Add Website' button */
#btnAddExternalSource {
    display: inline-flex; /* Ensures icon and text align perfectly */
    align-items: center; /* Vertically centers the content */
    gap: 8px; /* Adds proper space between the (+) icon and text */
    padding: 6px 14px; /* Comfortable click area */
    font-weight: 500; /* Slightly bolder text for readability */
    border-radius: 5px; /* Pill shape looks more modern/friendly than square */
    transition: all 0.2s ease; /* Smooth hover animation */
    /* Colors (Bootstrap Primary Blue override) */
    color: var(--accent);
    border: 1px solid var(--accent);
    background-color: transparent;
}

    /* Hover State */
    #btnAddExternalSource:hover {
        background-color: var(--accent);
        color: #ffffff;
        transform: translateY(-1px); /* Subtle lift effect */
        box-shadow: 0 4px 6px rgba(0, 123, 255, 0.2); /* Soft shadow on hover */
        cursor: pointer;
    }

    /* Active/Click State */
    #btnAddExternalSource:active {
        transform: translateY(0);
        box-shadow: none;
    }

    /* Ensure the icon font size matches neatly */
    #btnAddExternalSource i {
        font-size: 0.9em;
    }

/* Form Container Styling */
.add-source-form {
    background-color: var(--panel);
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    border: 1px solid var(--border);
    animation: slideDown 0.3s ease-out;
}

/* Simple Slide Down Animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Spinner for the button during analysis */
.fa-spin {
    animation: fa-spin 1s infinite linear;
}

@keyframes fa-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Base Badge Style */
.badge {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
    text-transform: uppercase; /* Optional: makes them look more like tags */
    letter-spacing: 0.5px;
}

/* Success (Green) - for "Core Info" */
.badge-success {
    color: #fff;
    background-color: #28a745;
}

/* Warning (Yellow/Orange) - for "Retail / Shop" */
.badge-warning {
    color: #212529; /* Dark text for readability on yellow */
    background-color: #ffc107;
}

/* Info (Blue/Cyan) - for "Support" */
.badge-info {
    color: #fff;
    background-color: #17a2b8;
}

/* Optional: Danger (Red) - useful for errors or 'Deleted' status */
.badge-danger {
    color: #fff;
    background-color: #dc3545;
}



.section-header {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
}

    .section-header .icon {
        font-size: 24px;
    }

    .section-header strong {
        display: block;
        font-size: 16px;
    }

    .section-header .small {
        font-size: 12px;
        color: var(--muted);
        margin: 0;
    }

.file-preview-list {
    list-style: none;
    padding: 0;
    margin-top: 10px;
    font-size: 12px;
    color: var(--text);
}

.remove-file-btn {
    flex-shrink: 0; /* 👈 Prevents the 'X' button from getting squashed */
    cursor: pointer;
    border: none;
    background: transparent;
    color: var(--danger);
    font-weight: bold;
}
/* Small Button Styling for the Toolbar */
.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
    line-height: 1.5;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px; /* Space between the icon and text */
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

    /* Hover effect to make them feel interactive */
    .btn-sm:hover {
        filter: brightness(90%);
        transform: translateY(-1px);
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    /* Active/Clicked state */
    .btn-sm:active {
        transform: translateY(0);
        box-shadow: inset 0 1px 3px rgba(0,0,0,0.15);
    }

    /* Ensure FontAwesome icons inside btn-sm are sized correctly */
    .btn-sm i {
        font-size: 0.9rem;
    }

/* Specific styling for the toolbar container we added earlier */
.report-toolbar {
    padding: 12px 20px;
    background-color: var(--soft);
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 12px;
    align-items: center;
    /* This keeps the toolbar stuck to the top if you want (Optional) */
    position: sticky;
    top: 0;
    z-index: 10;
}
.d-none {
    display: none !important;
}

.tender-upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two columns */
    gap: 20px;
    margin-top: 20px;
}


.ai-processing-tag {
    font-size: 10px;
    color: #007bff;
    font-weight: bold;
    margin-top: 8px;
    text-transform: uppercase;
}
.file-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 8px;
    font-size: 0.9em;
}

    .file-list-item span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-right: 10px;
    }




/* 1. Force the grid to never expand beyond the modal width */

.tender-upload-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 15px;
    margin-top: 20px;
    width: 100% !important;
    table-layout: fixed; /* Extra enforcement */
}

/* 2. Prevent the upload section from being pushed out */
.upload-section {
    min-width: 0;
    overflow-wrap: break-word;
}
.upload-section {
    border: 1px solid var(--border);
    padding: 15px;
    border-radius: 8px;
    background: var(--soft);
}


    .upload-section.highlight-section {
        border: 2.5px dashed var(--border); /* Highlight the new QA section */
        background: var(--soft);
    }


/* 3. The wrapping magic for the list item */
.file-preview-list li {
    background: var(--soft);
    margin-bottom: 4px;
    padding: 6px 8px;
    border-radius: 4px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    /* CRITICAL: Force the flex item to respect parent width */
    width: 100%;
    min-width: 0;
}

    /* 4. Force the span to wrap text */
    .file-preview-list li span {
        flex: 1;
        min-width: 0; /* Allows the span to shrink below content size */
        word-break: break-word; /* Wraps at letters for long filenames */
        overflow-wrap: break-word;
        white-space: normal; /* Forces it to wrap to the next line */
        display: inline-block; /* Helps with word-wrap in some browsers */
    }

/* 5. Keep the button from shrinking */
.remove-file-btn {
    flex: 0 0 auto;
    margin-left: 5px;
}

.upload-drop-zone {
    transition: all 0.2s ease;
}

    .upload-drop-zone:hover {
        border-color: var(--primary) !important;
        background-color: var(--soft) !important;
    }

    .upload-drop-zone i {
        transition: transform 0.2s ease;
    }

    .upload-drop-zone:hover i {
        transform: translateY(-3px);
    }

.btn-link-small {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

    .btn-link-small:hover {
        opacity: 1;
        color: var(--accent-2);
    }

.source-group-header {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #ffffff;
    background: var(--accent);
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 4px;
}

.source-group-list {
    max-height: 100px;
    overflow-y: auto;
    margin-bottom: 10px;
    padding-left: 5px;
}

.tender-source-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
    font-size: 0.8rem;
}
.report-tabs .tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}
    .report-tabs .tab-btn:hover {
        color: var(--text);
    }
    .report-tabs .tab-btn.active {
        color: var(--accent);
        border-bottom-color: var(--accent);
    }

.qa-result-table th, .qa-result-table td {
    padding: 12px;
    vertical-align: top;
    border: 1px solid var(--border);
    color: var(--text);
}
.qa-result-table th {
    background-color: var(--panel);
    color: var(--muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
/* Zebra striping that works in both Dark and Light themes */
.qa-result-table tr:nth-child(even) {
    background: rgba(var(--soft-rgb), 0.5); /* Semi-transparent version of your soft panel color */
}

/* Optional: Add a hover effect to help the eye follow rows during the demo */
.qa-result-table tr:hover {
    background: var(--soft);
}


.btn-copy-msg {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--soft);
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: 6px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
    opacity: 0; /* Hidden by default */
}

/* Show button on hover of the message */
.msg:hover .btn-copy-msg {
    opacity: 1;
}

.btn-copy-msg:hover {
    background: var(--border);
    color: var(--accent);
}

.btn-copy-msg.success {
    color: var(--accent);
    border-color: var(--accent);
}