﻿: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;
}

/* 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 */
    }

.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;
    border-bottom: 1px solid var(--border);
}

    .brand .logo {
        width: 28px;
        height: 28px;
        border-radius: 8px;
        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 h1 {
        font-size: 15px;
        margin: 0;
        letter-spacing: .4px;
        font-weight: 600;
    }

.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 {
        background: #171b25;
        border-color: #2b3240;
    }

/* 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 {
    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: 860px;
        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 {
    display: grid;
    grid-template-columns: 1fr auto;*/ /* left: textarea, right: buttons */
    /*gap: 10px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 8px;
    align-items: center;*/ /* vertical align */
/*}*/

    .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;
}


.library-list {
    list-style: none;
    padding: 0;
}

    .library-list li {
        padding: 10px;
        border-radius: 6px;
        cursor: pointer;
        color: var(--text-light);
    }

        .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;
        }
.close {
    float: right;
    font-size: 20px;
    cursor: pointer;
}        

.modal-footer {
    margin-top: 20px;
    text-align: right;
}

.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;
}

    .btn-secondary:hover {
        background: var(--border);
    }

.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

    .empty-state textarea {
        width: 60%;
        min-height: 80px;
        margin-top: 1rem;
    }

.chat-input {
    border-top: 1px solid #ddd;
    padding: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

    .chat-input textarea {
        flex: 1;
        min-height: 50px;
    }

.hidden {
    display: none;
}

.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 */
}

.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 {
        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: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;
        }

.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;
}

    .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 #ccc;
        font-size: 14px;
        background: var(--soft);
        color: var(--text);
    }

.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 320px;
    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;
}

/* 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;
    }

/* 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 */
}