﻿


: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: 60px;
    right: 15px;
    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 {
    width: 360px;
    /* Slightly slimmer for better laptop fit */
    max-width: calc(100vw - 40px);
    /* 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);
}

    .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 {
    position: fixed !important;
    top: 0 !important;
    left: 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 {
    display: none !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: 900px;
    width: 100%;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Chat Body */
.tt-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-color: var(--tt-bg);
    /* Original background */
    scroll-behavior: smooth;
    width: 100%;
}

    .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: 8px;
    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 8px 0;
        font-weight: normal;
    }

        .tt-message-row.bot .tt-message-bubble p:last-child {
            margin-bottom: 0;
        }

    .tt-message-row.bot .tt-message-bubble strong {
        font-weight: 600;
        color: #000;
    }

/* 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: 1px 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;
}

.tt-input {
    width: 100%;
    border: 1px solid var(--tt-border);
    border-radius: 25px;
    padding: 12px 44px 12px 18px;
    font-family: inherit;
    font-size: 0.9375rem;
    color: var(--tt-text-main);
    background-color: var(--tt-bg);
    outline: none;
    transition: all 0.3s ease;
}

    .tt-input::placeholder {
        color: #9CA3AF;
    }

    .tt-input:focus {
        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);
        background-color: #FFFFFF;
    }

.tt-send-icon {
    position: absolute;
    right: 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-dots {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 20px;
    padding: 4px;
}

    .typing-dots span {
        width: 6px;
        height: 6px;
        background-color: var(--tt-text-muted);
        border-radius: 50%;
        animation: typingBounce 1.4s infinite ease-in-out both;
    }

        .typing-dots span:nth-child(1) {
            animation-delay: -0.32s;
        }

        .typing-dots span:nth-child(2) {
            animation-delay: -0.16s;
        }

@keyframes typingBounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(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: #111827;
}

.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: 1px 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;
}

/* ---- 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;
        }

/* ---- Responsive Grids & Layouts ---- */
.tt-boq-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
}

@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;
    }
}
