﻿/* ---- Premium Hover Effects ---- */
.tt-hover-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease !important;
}

    .tt-hover-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06) !important;
        border-color: #CBD5E1 !important;
        z-index: 1;
    }

.tt-hover-link {
    transition: all 0.2s ease !important;
}

    .tt-hover-link:hover {
        transform: translateX(4px);
        border-color: #93C5FD !important;
        background: #F8FAFC !important;
    }

        .tt-hover-link:hover .tt-dl-icon {
            background: #DBEAFE !important;
            color: #2563EB !important;
        }



.tt-markdown-block {
    margin-left: 15px;
}

    .tt-markdown-block ul {
        margin-bottom: 0px !important;
    }

/* ---- Responsive Grids & Layouts ---- */
.tt-boq-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

@media (max-width: 600px) {
    .tt-body {
        padding: 10px !important;
    }

    .tt-message-bubble {
        max-width: 100% !important;
        padding: 12px 14px !important;
        border-radius: 0 12px 12px 12px !important;
    }

    .tt-message-row.bot > img {
        width: 26px !important;
        height: 26px !important;
        margin-right: 8px !important;
        padding: 2px !important;
    }

    .tt-boq-grid {
        gap: 12px;
        flex-direction: column;
    }

    .tt-executive-summary {
        padding: 14px !important;
    }

    .tt-tender-card {
        padding: 12px !important;
    }

    .tt-tender-title {
        font-size: 0.9rem !important;
    }
}
/*     .tt-data-card.tt-data-card-sub {
    background: #f6f6f6;
    padding: 9px 8px;
    border-radius: 9px;
    margin-bottom: 13px;
    border: 1px solid #e5e5e5;
}

.tt-data-card.tt-data-card-sub span {
    display: block;
    margin-bottom: 6px;
} */


:root {
    --tt-primary: #111827;
    /* Dark slate, almost black for premium feel */
    --tt-primary-light: #374151;
    --tt-accent: #3B82F6;
    /* Vivid blue accent */
    --tt-accent-hover: #2563EB;
    --tt-bg: #F9FAFB;
    --tt-panel-bg: #FFFFFF;
    --tt-text-main: #1F2937;
    --tt-text-muted: #6B7280;
    --tt-border: #E5E7EB;
    --tt-shadow-card: 0 25px 50px -12px rgba(0, 0, 0, 0.15), 0 0 15px rgba(0, 0, 0, 0.03);
    --tt-shadow-btn: 0 10px 15px -3px rgba(17, 24, 39, 0.2), 0 4px 6px -2px rgba(17, 24, 39, 0.1);
    --tt-radius-panel: 20px;
    --tt-radius-bubble: 18px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: #E2E8F0;
    /* Just for contrast */
    margin: 0;
    height: 100vh;
}

/* Base Container */
.tt-widget-container {
    position: fixed;
    bottom:0px;
    right: 0px;
    z-index: 9999999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 16px;
}

/* Floating Trigger Button */
.tt-trigger-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--tt-primary);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: var(--tt-shadow-btn);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

    .tt-trigger-btn:hover {
        transform: scale(1.05);
        background-color: var(--tt-primary-light);
    }

    .tt-trigger-btn.active {
        background-color: var(--tt-text-muted);
        /* Softer close color */
        transform: rotate(90deg);
    }

/* Chat Panel */
.tt-panel {
    position: fixed;
    bottom: 60px;
    /* 60px (container bottom) + 40px (button) + 16px (gap) */
    right: 15px;
    /* Matches container right */
    width: 360px;
    /* Slightly slimmer for better laptop fit */
    max-width: calc(100vw - 30px);
    /* NEVER exceed screen width */
    height: 600px;
    max-height: calc(100vh - 146px);
    /* Prevent vertical cutoff */
    background: var(--tt-panel-bg);
    border-radius: var(--tt-radius-panel);
    box-shadow: var(--tt-shadow-card);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgb(204 204 204);
    z-index: 10000;
}

    .tt-panel.active {
        transform: scale(1) translateY(0);
        opacity: 1;
        visibility: visible;
    }

/* Header */
.tt-header {
    background: var(--tt-panel-bg);
    padding: 9px 20px 7px 20px;
    /* Reduced padding */
    border-bottom: 1px solid var(--tt-border);
    flex-shrink: 0;
}

.tt-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tt-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
    /* Reduced gap */
}

.tt-avatar-container {
    position: relative;
}

.tt-avatar-main {
    width: 36px;
    /* Reduced from 44px */
    height: 36px;
    /* Reduced from 44px */
    border-radius: 10px;
    /* Adjusted radius */
    background: #FFFFFF;
    border: 1px solid var(--tt-border);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}



.tt-status-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 10px;
    /* Reduced from 12px */
    height: 10px;
    /* Reduced from 12px */
    background-color: #10B981;
    border: 2px solid white;
    border-radius: 50%;
}

.tt-header-text h3 {
    margin: 0;
    font-size: 1rem;
    /* Reduced from 1.125rem */
    font-weight: 600;
    color: var(--tt-text-main);
    letter-spacing: -0.01em;
}

.tt-header-text p {
    margin: 2px 0 0 0;
    /* Reduced margin */
    font-size: 0.75rem;
    /* Reduced from 0.8125rem */
    color: var(--tt-text-muted);
    font-weight: 400;
}

.tt-action-btn {
    background: transparent;
    border: none;
    color: var(--tt-text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .tt-action-btn:hover {
        background: var(--tt-bg);
        color: var(--tt-text-main);
    }

/* Fullscreen Mode */
.tt-panel.fullscreen {
    bottom: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    transform: none !important;
    z-index: 10001;
    margin: 0 !important;
}

/* Hide floating bubble when fullscreen is active */
.tt-widget-container:has(.tt-panel.fullscreen) .tt-trigger-btn {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: scale(0) !important;
}

/* Fullscreen Inner Centering for perfect layout */
.tt-panel.fullscreen .tt-header-top,
.tt-panel.fullscreen .tt-body > *,
.tt-panel.fullscreen .tt-input-wrapper,
.tt-panel.fullscreen .tt-watermark {
    max-width: 70%;
    width: 100%;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Chat Body */
.tt-body {
    flex: 1;
    padding: 16px 6px 0 6px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-color: var(--tt-bg);
    /* Original background */
    width: 100%;
    /* Firefox Scrollbar Styling */
    scrollbar-width: thin;
    scrollbar-color: #D1D5DB transparent;
}

    .tt-body::after {
        content: '';
        display: block;
        min-height: 16px;
        flex-shrink: 0;
    }

    .tt-body::-webkit-scrollbar {
        width: 4px;
    }

    .tt-body::-webkit-scrollbar-thumb {
        background-color: #D1D5DB;
        border-radius: 4px;
    }

.tt-timestamp {
    text-align: center;
    font-size: 0.75rem;
    color: #9CA3AF;
    margin-bottom: 8px;
    font-weight: 500;
}

/* Message Rows */
.tt-message-row {
    display: flex;
    gap: 0px;
    width: 100%;
}

    .tt-message-row.user {
        justify-content: flex-end;
        margin-top: 28px;
        /* Creates clear visual separation between old and new questions */
    }

    .tt-message-row.bot {
        justify-content: flex-start;
    }

/* Chat Bubbles */
.tt-message-bubble {
    padding: 10px 14px;
    font-size: 0.9rem;
    line-height: 1.4;
    max-width: 85%;
    word-wrap: break-word;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

/* User Bubble (Right) */
.tt-message-row.user .tt-message-bubble {
    background-color: var(--tt-primary);
    /* Original Dark Slate */
    color: #FFFFFF;
    /* WhatsApp tail style */
    border-radius: 12px 0 12px 12px;
    font-weight: 400;
}

/* Bot Bubble (Left) - Ultimate Premium Floating Card */
.tt-message-row.bot .tt-message-bubble {
    background-color: #FFFFFF;
    color: var(--tt-text-main);
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    /* Softer, wider premium shadow */
    border-radius: 0 16px 16px 16px;
    padding: 16px 20px;
    /* Enhanced breathing room */
    width: fit-content;
    min-width: 150px;
    max-width: 90%;
}

    /* Paragraph spacing inside Bot Bubble */
    .tt-message-row.bot .tt-message-bubble p {
        margin: 0 0 15px 0;
        font-weight: normal;
    }

        .tt-message-row.bot .tt-message-bubble p:last-child {
            margin-bottom: 0;
        }



/* Inline Timestamp */
.tt-msg-time {
    font-size: 0.65rem;
    color: inherit;
    opacity: 0.7;
    align-self: flex-end;
    margin-top: 4px;
    margin-left: 12px;
}

/* Suggestions Area */
.tt-suggestions-wrapper {
    margin-top: 16px;
    margin-left: 0;
    margin-right: 0;
    padding-top: 12px;
    border-top: 0px dashed #E5E7EB;
    /* Distinct separator between answer and actions */
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    /* Align the wrapper contents to the right */
    gap: 10px;
}

.tt-suggestions-label {
    margin: 0;
    font-size: 0.75rem;
    color: var(--tt-text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    /* Align text to the right */
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tt-suggestions-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    /* Align chips to the right horizontally */
}

.tt-chip {
    background: #FFFFFF;
    border: 1px solid var(--tt-border);
    color: var(--tt-text-main);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-family: inherit;
    font-weight: 400;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.4;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

    .tt-chip::after {
        content: '→';
        opacity: 0;
        transform: translateX(-5px);
        transition: all 0.2s ease;
        color: var(--tt-accent);
        font-weight: 600;
    }

    .tt-chip:hover {
        background: #F0F9FF;
        border-color: #BAE6FD;
        color: var(--tt-accent-hover);
        transform: translateY(-1px);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    }

        .tt-chip:hover::after {
            opacity: 1;
            transform: translateX(0);
        }

/* Footer / Input Area */
.tt-footer {
    background: #f3f3f3;
    padding: 16px 24px;
    border-top: 1px solid var(--tt-border);
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}

.tt-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid var(--tt-border);
    border-radius: 25px;
    background-color: var(--tt-bg);
    padding: 6px 8px 6px 18px;
    transition: all 0.3s ease;
}

    .tt-input-wrapper:focus-within {
        border-color: transparent !important;
        background-image: linear-gradient(#FFFFFF, #FFFFFF), linear-gradient(92deg, #eaa230, #FF9800, #000000);
        background-origin: border-box;
        background-clip: padding-box, border-box;
        box-shadow: 0 4px 16px rgba(59, 130, 246, 0.15);
    }

.tt-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    padding: 6px 0;
    font-family: inherit;
    font-size: 0.9375rem;
    color: var(--tt-text-main);
    outline: none;
}

    .tt-input::placeholder {
        color: #9CA3AF;
    }

.tt-send-icon {
    position: static;
    flex-shrink: 0;
    margin-left: 8px;
    background: #000;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

    .tt-send-icon:hover {
        background: #1F2937;
    }

/* Watermark */
.tt-watermark {
    text-align: center;
    font-size: 0.7rem;
    color: #9CA3AF;
    font-weight: 400;
}

    .tt-watermark span {
        font-weight: 600;
        color: #6B7280;
    }

/* Mobile Adjustments */
@media (max-width: 480px) {
    .tt-panel {
        width: calc(100vw - 32px);
        height: calc(100vh - 120px);
    }

    .tt-widget-container {
        bottom: 16px;
        right: 16px;
    }
}

.footer-two.footer-dark.footer-bottom {
    z-index: 9999999 !important;
}

/* Typing Dots Indicator */
.typing-indicator-row .tt-message-bubble {
    padding: 12px 18px;
    min-width: auto;
    animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    transform-origin: bottom left;
}

@keyframes popIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.typing-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 16px;
}

    .typing-dots span {
        width: 8px;
        height: 8px;
        background-color: #000000;
        border-radius: 50%;
        opacity: 0.3;
        animation: ultraSmoothWave 1.4s infinite ease-in-out;
    }

        .typing-dots span:nth-child(1) {
            animation-delay: 0s;
        }

        .typing-dots span:nth-child(2) {
            animation-delay: 0.16s;
        }

        .typing-dots span:nth-child(3) {
            animation-delay: 0.32s;
        }

@keyframes ultraSmoothWave {

    0%, 80%, 100% {
        transform: translateY(0) scale(0.8);
        opacity: 0.3;
    }

    40% {
        transform: translateY(-4px) scale(1.1);
        opacity: 1;
    }
}

/* ============================================================
   TenderTiger AI Chat Widget — Markdown & Data-Card Styles
   Link this file in your Razor layout AFTER your base widget CSS:
   <link rel="stylesheet" href="~/css/tendertiger-widget-markdown.css">
   ============================================================ */

/* ---------- Markdown content (rendered via marked + DOMPurify) ---------- */
/* Scoped to .typing-content so it only affects bot message bodies,
   not the rest of your page. */

.typing-content p {
    margin: 0 0 10px 0;
    line-height: 1.5;
}

    .typing-content p:last-child {
        margin-bottom: 0;
    }

.typing-content strong {
    font-weight: 600;
    color: rgb(71, 85, 105);
}

.typing-content em {
    font-style: italic;
}

.typing-content ul,
.typing-content ol {
    margin: 8px 0 14px 0;
    padding-left: 0;
    list-style: none;
}

.typing-content li {
    position: relative;
    padding: 2px 0 2px 20px;
    margin-bottom: 4px;
    line-height: 1.6;
    background: transparent;
    border: none;
    border-radius: 0;
}

    .typing-content li:last-child {
        margin-bottom: 0;
    }

.typing-content ul > li::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 11px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--tt-text-muted);
}

.typing-content ol {
    counter-reset: tt-ol-counter;
}

    .typing-content ol > li {
        counter-increment: tt-ol-counter;
    }

        .typing-content ol > li::before {
            content: counter(tt-ol-counter);
            position: absolute;
            left: 8px;
            top: 6px;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            background: #2563eb;
            color: #ffffff;
            font-size: 10px;
            font-weight: 600;
            line-height: 16px;
            text-align: center;
        }

/* Nested lists: slightly indent and de-emphasize so the visual hierarchy
   stays readable instead of stacking identical cards inside cards */
.typing-content li ul,
.typing-content li ol {
    margin: 6px 0 0 0;
}

.typing-content li li {
    background: transparent;
}

.typing-content code {
    background: #f1f1f1;
    border-radius: 4px;
    padding: 2px 6px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.85em;
    color: #c7254e;
}

.typing-content pre {
    background: #1e1e1e;
    border-radius: 8px;
    padding: 12px 14px;
    overflow-x: auto;
    margin: 8px 0 12px 0;
}

    .typing-content pre code {
        background: none;
        color: #d4d4d4;
        padding: 0;
        font-size: 0.85em;
        line-height: 1.5;
    }

.typing-content blockquote {
    border-left: 3px solid #d1d5db;
    margin: 8px 0 12px 0;
    padding: 2px 0 2px 12px;
    color: #6b7280;
    font-style: italic;
}

.typing-content h1,
.typing-content h2,
.typing-content h3,
.typing-content h4 {
    margin: 14px 0 8px 0;
    font-weight: 600;
    line-height: 1.3;
    color: #111827;
}

.typing-content h1 {
    font-size: 1.25em;
}

.typing-content h2 {
    font-size: 1.15em;
}

.typing-content h3 {
    font-size: 1.05em;
}

.typing-content h4 {
    font-size: 1em;
}

.typing-content hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 12px 0;
}

.typing-content a {
    color: #2563eb;
    text-decoration: underline;
    word-break: break-word;
}

    .typing-content a:hover {
        color: #1d4ed8;
    }

/* ---------- Typography (Headings) ---------- */
.typing-content h3 {
    font-size: 1rem;
    color: var(--tt-accent);
    margin-top: 24px;
    margin-bottom: 8px;
    border-bottom: 0px solid #E5E7EB;
    padding-bottom: 6px;
    font-weight: 600;
}

    .typing-content h3:first-child {
        margin-top: 0;
    }

/* ---------- Tables (Premium Redesign) ---------- */
.typing-content {
    overflow-x: auto;
}

    .typing-content table {
        border-collapse: separate;
        /* Required for border-radius on table */
        border-spacing: 0;
        width: 100%;
        background: #fff;
        margin: 16px 0;
        border-radius: 12px;
        /* Smooth rounded corners */
        border: 1px solid #E5E7EB;
        /* Sleek outer border */
        overflow: hidden;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
        /* Very soft shadow for the table itself */
    }

.wide-table {
    width: max-content !important;
    min-width: 1200px;
}

.typing-content th,
.typing-content td {
    border: none;
    border-bottom: 1px solid #F1F5F9;
    padding: 14px 16px;
    text-align: left;
    vertical-align: top;
    line-height: 1.6;
}

/* Header */
.typing-content th {
    background: #F8FAFC;
    font-weight: 600;
    color: #475569;
    font-size: 0.75rem;
    /* Sleek small uppercase headers */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #E5E7EB;
}

/* Ensure top corners are rounded for headers */
.typing-content thead tr:first-child th:first-child {
    border-top-left-radius: 12px;
}

.typing-content thead tr:first-child th:last-child {
    border-top-right-radius: 12px;
}

/* Data */
.typing-content td {
    color: #334155;
    font-size: 0.875rem;
    /* Clean readable font */
    min-width: 150px;
    max-width: 400px;
    word-break: break-word;
}

/* Remove last row border */
.typing-content tbody tr:last-child td {
    border-bottom: none;
}

/* Hover Effect */
.typing-content tbody tr:hover {
    background: #F9FAFB;
}

/* Rounded Corners */
.typing-content thead tr:first-child th:first-child {
    border-top-left-radius: 10px;
}

.typing-content thead tr:first-child th:last-child {
    border-top-right-radius: 10px;
}

.typing-content tbody tr:last-child td:first-child {
    border-bottom-left-radius: 10px;
}

.typing-content tbody tr:last-child td:last-child {
    border-bottom-right-radius: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .typing-content table {
        min-width: 700px;
    }
}

/* ============================================================
   Wrappers used across every renderResponseData case
   (everything now renders as markdown - tables/lists/text -
   through the same .typing-content styles above)
   ============================================================ */

.tt-markdown-block {
    /* Wraps plain-string/markdown answers; no visual styling of its own,
       exists so all response cases share a consistent top-level container. */
}

.tt-result-summary {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 6px;
}

.tt-empty-state {
    padding: 10px 12px;
    border-radius: 8px;
    background: #fafafa;
    border: 1px dashed #d1d5db;
    color: #6b7280;
    font-size: 13px;
    font-style: italic;
}

/* Custom Tooltips */
[data-tt-tooltip] {
    position: relative;
}

    [data-tt-tooltip]::after {
        content: attr(data-tt-tooltip);
        position: absolute;
        left: 50%;
        background: #1e293b;
        color: #fff;
        padding: 4px 8px;
        border-radius: 6px;
        font-size: 0.75rem;
        font-weight: 500;
        white-space: nowrap;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        z-index: 1000;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        transition: all 0.2s ease;
        font-family: inherit;
    }

    /* Top Tooltip (Default) */
    [data-tt-tooltip]:not([data-tt-tooltip-pos])::after {
        bottom: 110%;
        transform: translateX(-50%) translateY(4px);
    }

    [data-tt-tooltip]:not([data-tt-tooltip-pos]):hover::after {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
        visibility: visible;
    }

    /* Bottom Right Tooltip (Header Icons) */
    [data-tt-tooltip][data-tt-tooltip-pos="bottom-right"]::after {
        bottom: auto;
        top: 120%;
        right: 0;
        left: auto;
        transform: translateY(-4px);
    }

    [data-tt-tooltip][data-tt-tooltip-pos="bottom-right"]:hover::after {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

details.tt-premium-accordion > summary::-webkit-details-marker {
    display: none;
}

details.tt-premium-accordion[open] > summary .tt-accordion-icon {
    transform: rotate(180deg);
}

.tt-panel .tt-message-row.bot .tt-message-bubble {
    max-width: 100%;
}

.tt-panel.fullscreen .tt-message-row.bot .tt-message-bubble {
    max-width: 90%;
}

.tt-footer input[type=text]:focus {
    border: 0px;
}
.tt-sidebar-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.25);
    backdrop-filter: blur(2px);
    z-index: 1040;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.tt-panel.sidebar-open .tt-sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
}

.tt-sidebar {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 270px;
    max-width: 85%;
    background: #FFFFFF;
    color: #1E293B;
    border-right: 1px solid #E2E8F0;
    z-index: 1050;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0,0,0,0.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.tt-panel.sidebar-open .tt-sidebar {
    transform: translateX(0);
}

.tt-sidebar-header {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #E2E8F0;
    background: #FFFFFF;
}

.tt-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    color: #0F172A;
}

.tt-sidebar-close {
    background: none;
    border: none;
    color: #64748B;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
}

    .tt-sidebar-close:hover {
        color: #0F172A;
        background: #F1F5F9;
    }

.tt-sidebar-new-chat-wrapper {
    padding: 12px 14px;
}

.tt-sidebar-new-chat-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #F1F5F9;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    color: #0F172A;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .tt-sidebar-new-chat-btn:hover {
        background: #E2E8F0;
        border-color: #CBD5E1;
    }

.tt-sidebar-recent-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 0 10px;
}

    .tt-sidebar-recent-container::-webkit-scrollbar {
        width: 4px;
    }

    .tt-sidebar-recent-container::-webkit-scrollbar-thumb {
        background: #CBD5E1;
        border-radius: 4px;
    }

.tt-sidebar-section-title {
    padding: 8px 10px 4px 10px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94A3B8;
}

.tt-sidebar-recent-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tt-sidebar-recent-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: #334155;
    font-size: 0.88rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

    .tt-sidebar-recent-item:hover {
        background: #F1F5F9;
        color: #0F172A;
    }

    .tt-sidebar-recent-item svg {
        flex-shrink: 0;
        color: #64748B;
    }

.tt-sidebar-recent-empty {
    padding: 20px 10px;
    text-align: center;
    font-size: 0.85rem;
    color: #94A3B8;
}

.tt-sidebar-footer {
    padding: 12px;
    border-top: 1px solid #E2E8F0;
    background: #F8FAFC;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tt-sidebar-action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0px 11px;
    width: 100%;
    background: none;
    border: none;
    border-radius: 8px;
    color: #64748B;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    text-align: center;
    justify-content: center;
}

    .tt-sidebar-action-btn:hover {
      
        color: #a00b0b;
    }

.tt-sidebar-user-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: #FFFFFF;
    border: 0px solid #E2E8F0;
    border-radius: 10px;
    margin-top: 4px;
}

.tt-sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.tt-sidebar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #3B82F6;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.tt-sidebar-user-text {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tt-sidebar-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #0F172A;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tt-sidebar-user-sub {
    font-size: 0.72rem;
    color: #64748B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}