/* ============================================
   UNIFIED CHAT STYLES - INTELLISEA
   All chat message styling in ONE place
   ============================================ */

/* -- Base Message Text Container -- */
.message-text,
.chat-response-content,
.bot-response,
.modern-chat-message-bubble-ai {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-size: 16px !important;
    line-height: 1.5 !important;
    color: #2d3748 !important;
    word-wrap: break-word;
    margin: 0;
    padding: 8px 0 0 0;
}

/* -- Headings -- */
.message-text h1,
.message-text h2,
.message-text h3,
.message-text h4,
.chat-heading {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    font-weight: 700 !important;
    margin-top: 20px !important;
    margin-bottom: 12px !important;
    line-height: 1.3 !important;
    letter-spacing: -0.02em !important;
}

/* Heading 1 - Primary section headers */
.message-text h1,
.chat-h1 {
    font-size: 24px !important;
    color: #0e1369 !important;
    border-bottom: 3px solid #06b8a0 !important;
    padding-bottom: 10px !important;
    margin-top: 24px !important;
}

/* Heading 2 - Secondary section headers */
.message-text h2,
.chat-h2 {
    font-size: 20px !important;
    color: #1e3a8a !important;
    border-bottom: none !important;
    padding-bottom: 8px !important;
}

/* Heading 3 - Tertiary headers */
.message-text h3,
.chat-h3 {
    font-size: 17px !important;
    color: #1e40af !important;
    border-left: 4px solid #06b8a0 !important;
    padding-left: 12px !important;
    border-bottom: none !important;
}

/* Heading 4 - Minor headers */
.message-text h4 {
    font-size: 15px !important;
    color: #059669 !important;
    font-weight: 600 !important;
}

/* First heading in a response shouldn't have top margin */
.chat-response-content > h1:first-child,
.chat-response-content > h2:first-child,
.chat-response-content > h3:first-child,
.chat-response-content > .chat-heading:first-child {
    margin-top: 0 !important;
}

/* -- Paragraphs -- */
.message-text p {
    margin: 0 0 8px 0 !important;
    padding: 0 !important;
    line-height: 1.5 !important;
}

/* -- Text Formatting -- */
.message-text strong,
.message-text b {
    color: #0e1369 !important;
    font-weight: 600 !important;
}

.message-text em,
.message-text i {
    color: #059669 !important;
    font-style: italic !important;
}

/* -- Links -- */
.message-text a,
.chat-response-content a,
.bot-response a {
    color: #06b8a0 !important;
    text-decoration: none !important;
    border-bottom: 1px solid #06b8a0 !important;
    transition: all 0.2s ease;
}

.message-text a:hover,
.chat-response-content a:hover,
.bot-response a:hover {
    color: #0e1369 !important;
    border-bottom-color: #0e1369 !important;
}

/* ============================================
   UNORDERED LISTS (Bullets)
   ============================================ */

.message-text ul,
.chat-response-content ul,
.bot-response ul {
    list-style: none !important;
    padding-left: 40px !important;
    margin: 8px 0 !important;
}

.message-text ul li,
.chat-response-content ul li,
.bot-response ul li {
    position: relative !important;
    padding-left: 32px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin: 2px 0 !important;
    line-height: 1.4 !important;
}

.message-text ul li::before,
.chat-response-content ul li::before,
.bot-response ul li::before {
    content: "\2022" !important;
    position: absolute !important;
    left: 8px !important;
    top: 0 !important;
    color: #059669 !important;
    font-size: 18px !important;
    font-weight: bold !important;
}

/* ============================================
   ORDERED LISTS (Numbers)
   CRITICAL: Each <ol> gets its own counter
   ============================================ */

.message-text ol,
.chat-response-content ol,
.bot-response ol {
    list-style: decimal !important;
    counter-reset: none !important;
    padding-left: 40px !important;
    margin: 8px 0 !important;
}

.message-text ol li,
.chat-response-content ol li,
.bot-response ol li {
    position: relative !important;
    padding-left: 8px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin: 2px 0 !important;
    counter-increment: none !important;
    line-height: 1.4 !important;
}

/* Remove default ::before for regular ordered lists - they use browser default numbers */
.message-text ol li::before,
.chat-response-content ol li::before,
.bot-response ol li::before {
    content: none !important;
}

/* ============================================
   HORIZONTAL RULES (Section Breaks)
   ============================================ */

.message-text hr,
.message-text hr.section-break,
.chat-response-content hr,
.chat-response-content hr.section-break,
.bot-response hr,
.bot-response hr.section-break {
    display: none !important;
}

/* ============================================
   BLOG POST CONTENT (Tan Background, Indented, Smaller Font)
   ============================================ */

.message-text .blog-content,
.chat-response-content .blog-content,
.bot-response .blog-content {
    background: linear-gradient(135deg, #fef7ed 0%, #fffbf5 100%) !important;
    border-left: 4px solid #d97706 !important;
    border-radius: 0 12px 12px 0 !important;
    padding: 20px 24px !important;
    margin: 16px 0 16px 20px !important;
    font-size: 14px !important;
    line-height: 1.7 !important;
    color: #44403c !important;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.1) !important;
}

.message-text .blog-content h1,
.chat-response-content .blog-content h1,
.bot-response .blog-content h1 {
    font-size: 20px !important;
    color: #92400e !important;
    margin-top: 0 !important;
    margin-bottom: 16px !important;
    border-bottom: 2px solid #fbbf24 !important;
    padding-bottom: 8px !important;
}

.message-text .blog-content h2,
.chat-response-content .blog-content h2,
.bot-response .blog-content h2 {
    font-size: 17px !important;
    color: #b45309 !important;
    margin-top: 20px !important;
    margin-bottom: 12px !important;
}

.message-text .blog-content h3,
.chat-response-content .blog-content h3,
.bot-response .blog-content h3 {
    font-size: 15px !important;
    color: #d97706 !important;
    margin-top: 16px !important;
    margin-bottom: 8px !important;
}

.message-text .blog-content p,
.chat-response-content .blog-content p,
.bot-response .blog-content p {
    margin-bottom: 12px !important;
}

.message-text .blog-content strong,
.chat-response-content .blog-content strong,
.bot-response .blog-content strong {
    color: #78350f !important;
}

.message-text .blog-content em,
.chat-response-content .blog-content em,
.bot-response .blog-content em {
    color: #92400e !important;
}

/* Blog content lists - use native bullets, no pseudo-elements */
.message-text .blog-content ul,
.chat-response-content .blog-content ul,
.bot-response .blog-content ul {
    margin: 3px 0 3px 0 !important;
    padding-left: 24px !important;
    margin-left: 0 !important;
    list-style: disc outside none !important;
}

.message-text .blog-content ol,
.chat-response-content .blog-content ol,
.bot-response .blog-content ol {
    margin: 3px 0 10px 0 !important;
    padding-left: 24px !important;
    margin-left: 0 !important;
    list-style: decimal outside none !important;
}

.message-text .blog-content li,
.chat-response-content .blog-content li,
.bot-response .blog-content li {
    margin: 1px 0 !important;
    padding: 0 0 0 4px !important;
    line-height: 1.1 !important;
    position: static !important;
}

/* Remove pseudo-element bullets for blog-content - uses native list-style */
.message-text .blog-content ul li::before,
.chat-response-content .blog-content ul li::before,
.bot-response .blog-content ul li::before,
.message-text .blog-content ol li::before,
.chat-response-content .blog-content ol li::before,
.bot-response .blog-content ol li::before {
    content: none !important;
    display: none !important;
}

.blog-content-label {
    display: inline-block;
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
    color: white !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    padding: 4px 10px !important;
    border-radius: 4px !important;
    margin-bottom: 12px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

/* ============================================
   AGENT CREATED BLOG (Light Tan, Smaller Font, Content Specialist)
   ============================================ */

.message-text .agent-created-blog,
.chat-response-content .agent-created-blog,
.bot-response .agent-created-blog {
    background: linear-gradient(135deg, #faf5eb 0%, #f5efe3 100%) !important;
    border: 1px solid #e5d9c3 !important;
    border-left: 4px solid #c9a66b !important;
    border-radius: 8px !important;
    padding: 20px 24px !important;
    margin: 16px 0 !important;
    font-size: 13px !important;
    line-height: 1.65 !important;
    color: #4a4438 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05) !important;
}

.message-text .agent-created-blog h1,
.chat-response-content .agent-created-blog h1,
.bot-response .agent-created-blog h1 {
    font-size: 18px !important;
    color: #5c4d3c !important;
    margin-top: 0 !important;
    margin-bottom: 14px !important;
    border-bottom: 2px solid #d4c4a8 !important;
    padding-bottom: 8px !important;
    font-weight: 600 !important;
}

.message-text .agent-created-blog h2,
.chat-response-content .agent-created-blog h2,
.bot-response .agent-created-blog h2 {
    font-size: 15px !important;
    color: #6b5b47 !important;
    margin-top: 18px !important;
    margin-bottom: 10px !important;
    font-weight: 600 !important;
}

.message-text .agent-created-blog h3,
.chat-response-content .agent-created-blog h3,
.bot-response .agent-created-blog h3 {
    font-size: 13px !important;
    color: #7a6a55 !important;
    margin-top: 14px !important;
    margin-bottom: 6px !important;
    font-weight: 600 !important;
}

.message-text .agent-created-blog p,
.chat-response-content .agent-created-blog p,
.bot-response .agent-created-blog p {
    margin-bottom: 10px !important;
    font-size: 13px !important;
}

.message-text .agent-created-blog ul,
.chat-response-content .agent-created-blog ul,
.bot-response .agent-created-blog ul {
    margin: 3px 0 3px 0 !important;
    padding-left: 24px !important;
    margin-left: 0 !important;
    list-style: disc outside none !important;
}

.message-text .agent-created-blog ol,
.chat-response-content .agent-created-blog ol,
.bot-response .agent-created-blog ol {
    margin: 3px 0 10px 0 !important;
    padding-left: 24px !important;
    margin-left: 0 !important;
    list-style: decimal outside none !important;
}

/* Nested lists - additional indentation */
.message-text .agent-created-blog ul ul,
.message-text .agent-created-blog ol ul,
.chat-response-content .agent-created-blog ul ul,
.chat-response-content .agent-created-blog ol ul,
.bot-response .agent-created-blog ul ul,
.bot-response .agent-created-blog ol ul {
    margin-left: 20px !important;
    list-style-type: circle !important;
}

.message-text .agent-created-blog ul ol,
.message-text .agent-created-blog ol ol,
.chat-response-content .agent-created-blog ul ol,
.chat-response-content .agent-created-blog ol ol,
.bot-response .agent-created-blog ul ol,
.bot-response .agent-created-blog ol ol {
    margin-left: 20px !important;
    list-style-type: lower-alpha !important;
}

.message-text .agent-created-blog li,
.chat-response-content .agent-created-blog li,
.bot-response .agent-created-blog li {
    margin: 1px 0 !important;
    padding: 0 0 0 4px !important;
    font-size: 13px !important;
    line-height: 1.1 !important;
    position: static !important;
}

/* CRITICAL: Remove pseudo-element bullets for agent-created-blog - uses native list-style */
.message-text .agent-created-blog ul li::before,
.chat-response-content .agent-created-blog ul li::before,
.bot-response .agent-created-blog ul li::before,
.message-text .agent-created-blog ol li::before,
.chat-response-content .agent-created-blog ol li::before,
.bot-response .agent-created-blog ol li::before {
    content: none !important;
    display: none !important;
}

.message-text .agent-created-blog strong,
.chat-response-content .agent-created-blog strong,
.bot-response .agent-created-blog strong {
    color: #4a3f2f !important;
}

.message-text .agent-created-blog em,
.chat-response-content .agent-created-blog em,
.bot-response .agent-created-blog em {
    color: #6b5b47 !important;
    font-style: italic !important;
}

.agent-blog-label {
    display: inline-block;
    background: linear-gradient(135deg, #a08060 0%, #8b7355 100%) !important;
    color: white !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    padding: 3px 8px !important;
    border-radius: 4px !important;
    margin-bottom: 12px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.agent-blog-label i {
    margin-right: 4px !important;
}

/* ============================================
   VIDEO & IMAGE RENDERING IN CHAT
   ============================================ */

/* Standalone video in chat messages */
.chat-video-container {
    margin: 8px 0 !important;
    text-align: center !important;
}

.chat-video-container video {
    max-width: 100% !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12) !important;
}

.chat-video-caption {
    font-size: 12px !important;
    color: #6b7280 !important;
    text-align: center !important;
    margin-top: 4px !important;
    margin-bottom: 0 !important;
}

/* Video inside blog preview cards */
.blog-video-container {
    margin: 12px 0 !important;
    text-align: center !important;
}

.agent-created-blog .blog-video-container video,
.blog-content .blog-video-container video {
    max-width: 100% !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12) !important;
}

.blog-video-caption {
    font-size: 12px !important;
    color: #6b5b47 !important;
    text-align: center !important;
    margin-top: 4px !important;
    margin-bottom: 0 !important;
}

/* Standalone image in chat messages */
.chat-image-container {
    margin: 8px 0 !important;
    text-align: center !important;
}

/* ============================================
   ACTION PLAN SECTION (Tan Box with Green Border)
   ============================================ */

.message-text .action-plan-section,
.chat-response-content .action-plan-section,
.bot-response .action-plan-section {
    background: linear-gradient(135deg, #fef3c7 0%, #fef9e7 100%) !important;
    border: 2px solid #10b981 !important;
    border-radius: 12px !important;
    padding: 16px 20px !important;
    margin: 20px 0 !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15) !important;
    display: block !important;
}

.message-text .action-plan-section strong,
.chat-response-content .action-plan-section strong,
.bot-response .action-plan-section strong {
    color: #0e1369 !important;
}

/* CRITICAL: Action Plan uses GREEN NUMBERED CIRCLES */
.message-text .action-plan-section ol,
.chat-response-content .action-plan-section ol,
.bot-response .action-plan-section ol {
    list-style: none !important;
    counter-reset: item !important;
    padding-left: 0 !important;
}

.message-text .action-plan-section ol li,
.chat-response-content .action-plan-section ol li,
.bot-response .action-plan-section ol li {
    position: relative !important;
    padding-left: 38px !important;
    counter-increment: item !important;
}

.message-text .action-plan-section ol li::before,
.chat-response-content .action-plan-section ol li::before,
.bot-response .action-plan-section ol li::before {
    content: counter(item) !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 24px !important;
    height: 24px !important;
    background: linear-gradient(135deg, #06b8a0 0%, #059669 100%) !important;
    color: white !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 24px !important;
    text-align: center !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

/* ============================================
   TABLES
   ============================================ */

.message-text table,
.chat-response-content table,
.bot-response table {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    margin: 12px 0 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.message-text thead,
.chat-response-content thead,
.bot-response thead {
    background: linear-gradient(135deg, #0e1369 0%, #1e40af 100%) !important;
}

.message-text thead th,
.chat-response-content thead th,
.bot-response thead th {
    color: white !important;
    font-weight: 600 !important;
    text-align: center !important;
    padding: 12px 16px !important;
    font-size: 13px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.message-text tbody tr:nth-child(even),
.chat-response-content tbody tr:nth-child(even),
.bot-response tbody tr:nth-child(even) {
    background: #f8fafc !important;
}

.message-text tbody tr:hover,
.chat-response-content tbody tr:hover,
.bot-response tbody tr:hover {
    background: #e0f2f1 !important;
}

.message-text tbody td,
.chat-response-content tbody td,
.bot-response tbody td {
    padding: 10px 14px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    font-size: 14px !important;
}

.message-text tbody tr:last-child td,
.chat-response-content tbody tr:last-child td,
.bot-response tbody tr:last-child td {
    border-bottom: none !important;
}

/* ============================================
   CODE BLOCKS
   ============================================ */

.message-text code {
    background: #f1f5f9 !important;
    color: #0e1369 !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
    font-size: 13px !important;
    border: 1px solid #e2e8f0 !important;
}

.message-text pre {
    background: #1e293b !important;
    color: #e2e8f0 !important;
    padding: 16px !important;
    border-radius: 8px !important;
    overflow-x: auto !important;
    margin: 12px 0 !important;
    border-left: 4px solid #06b8a0 !important;
}

.message-text pre code {
    background: transparent !important;
    color: inherit !important;
    padding: 0 !important;
    border: none !important;
}

/* ============================================
   BLOCKQUOTES
   ============================================ */

.message-text blockquote {
    margin: 10px 0 !important;
    padding: 10px 16px !important;
    background: linear-gradient(to right, #e0f2f1 0%, #f8fafc 100%) !important;
    border-left: 4px solid #06b8a0 !important;
    border-radius: 0 8px 8px 0 !important;
    font-style: italic !important;
    color: #475569 !important;
}

.message-text blockquote p {
    margin: 0 !important;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .message-text {
        font-size: 14px !important;
    }
    
    .message-text h1 { font-size: 18px !important; }
    .message-text h2 { font-size: 16px !important; }
    .message-text h3 { font-size: 15px !important; }
    
    .message-text table {
        font-size: 12px !important;
    }
}

/* ============================================
   AGENT DELEGATION TABLE - Professional Styling
   ============================================ */

.table-container {
    width: 100%;
    overflow-x: auto;
    margin: 16px 0;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.agent-delegation-table,
.chat-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
}

/* Table Header */
.agent-delegation-table thead,
.chat-data-table thead {
    background: linear-gradient(135deg, #0e1369 0%, #1e40af 100%);
}

.agent-delegation-table thead th,
.chat-data-table thead th {
    padding: 14px 16px;
    text-align: center;
    font-weight: 600;
    color: #ffffff;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    border-bottom: 3px solid #06b8a0;
}

.agent-delegation-table thead th:first-child {
    border-radius: 12px 0 0 0;
}

.agent-delegation-table thead th:last-child {
    border-radius: 0 12px 0 0;
}

/* Table Body */
.agent-delegation-table tbody tr,
.chat-data-table tbody tr {
    transition: background 0.2s ease;
    border-bottom: 1px solid #e2e8f0;
}

.agent-delegation-table tbody tr:hover,
.chat-data-table tbody tr:hover {
    background: linear-gradient(to right, #f0fdfa 0%, #f8fafc 100%);
}

.agent-delegation-table tbody tr:last-child {
    border-bottom: none;
}

.agent-delegation-table tbody td,
.chat-data-table tbody td {
    padding: 12px 16px;
    color: #334155;
    vertical-align: middle;
    text-align: center;
    line-height: 1.5;
}

/* Alternating row colors */
.agent-delegation-table tbody tr:nth-child(even),
.chat-data-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.agent-delegation-table tbody tr:nth-child(even):hover,
.chat-data-table tbody tr:nth-child(even):hover {
    background: linear-gradient(to right, #f0fdfa 0%, #f1f5f9 100%);
}

/* Priority Column Styling */
.priority-col {
    width: 100px;
    text-align: center !important;
}

/* Priority Cell Colors */
.priority-critical {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%) !important;
    color: #dc2626 !important;
    font-weight: 600;
    border-left: 4px solid #dc2626;
}

.priority-high {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%) !important;
    color: #ea580c !important;
    font-weight: 600;
    border-left: 4px solid #ea580c;
}

.priority-medium {
    background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%) !important;
    color: #ca8a04 !important;
    font-weight: 600;
    border-left: 4px solid #ca8a04;
}

.priority-low {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%) !important;
    color: #16a34a !important;
    font-weight: 600;
    border-left: 4px solid #16a34a;
}

/* Director Agent Column */
.agent-delegation-table tbody td:nth-child(2) {
    font-weight: 500;
    color: #0e1369;
}

/* Instructions Column */
.agent-delegation-table tbody td:nth-child(3) {
    color: #475569;
    font-size: 13px;
}

/* Responsive Table */
@media (max-width: 768px) {
    .agent-delegation-table,
    .chat-data-table {
        font-size: 12px;
    }
    
    .agent-delegation-table thead th,
    .chat-data-table thead th {
        padding: 10px 12px;
        font-size: 11px;
    }
    
    .agent-delegation-table tbody td,
    .chat-data-table tbody td {
        padding: 10px 12px;
    }
    
    .priority-col {
        width: 80px;
    }
}

/* ============================================
   SORTABLE TABLE HEADERS
   ============================================ */

/* Sortable header styling */
.sortable-header {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.sortable-header:hover {
    background: rgba(6, 184, 160, 0.2) !important;
}

/* Header content layout */
.th-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.th-text {
    flex: 1;
}

/* Sort arrows container */
.sort-arrows {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    font-size: 8px;
    line-height: 1;
    opacity: 0.4;
    transition: opacity 0.2s ease;
}

.sortable-header:hover .sort-arrows {
    opacity: 0.7;
}

/* Individual arrows */
.sort-arrow {
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.2s ease;
    line-height: 1;
}

.sort-asc {
    margin-bottom: -2px;
}

.sort-desc {
    margin-top: -2px;
}

/* Active sort states */
.sort-active-asc .sort-arrows,
.sort-active-desc .sort-arrows {
    opacity: 1;
}

.sort-active-asc .sort-asc {
    color: #06b8a0 !important;
    font-size: 10px;
    text-shadow: 0 0 4px rgba(6, 184, 160, 0.5);
}

.sort-active-asc .sort-desc {
    opacity: 0.3;
}

.sort-active-desc .sort-desc {
    color: #06b8a0 !important;
    font-size: 10px;
    text-shadow: 0 0 4px rgba(6, 184, 160, 0.5);
}

.sort-active-desc .sort-asc {
    opacity: 0.3;
}

/* Hover effect on arrows */
.sortable-header:hover .sort-arrow {
    color: rgba(255, 255, 255, 0.9);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .sort-arrows {
        font-size: 7px;
    }
    
    .sort-active-asc .sort-asc,
    .sort-active-desc .sort-desc {
        font-size: 9px;
    }
}

/* ============================================
   STREAMING MESSAGE STYLES
   Cursor animation and buffered content display
   ============================================ */

/* Streaming cursor animation */
.streaming-cursor {
    display: inline-block;
    animation: blink 1s step-end infinite;
    color: #06b8a0;
    font-weight: bold;
    margin-left: 2px;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Streaming message container */
.modern-chat-message-ai.streaming .modern-chat-message-bubble {
    min-height: 40px;
}

/* Raw content during streaming (incomplete tables/lists) */
.streaming-raw {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 13px;
    background: rgba(6, 184, 160, 0.05);
    border-left: 3px solid #06b8a0;
    padding: 8px 12px;
    margin: 8px 0;
    white-space: pre-wrap;
    color: #64748b;
}

/* Streaming content area */
.streaming-content {
    min-height: 20px;
}

/* ============================================
   THINKING DISPLAY - A2A Agent Reasoning
   Shows agent thinking steps like Claude
   ============================================ */

.thinking-display {
    display: none !important;
}

.thinking-display.completed {
    opacity: 0.6;
    transform: scale(0.98);
}

.thinking-display.collapsed .thinking-steps {
    display: none;
}

.thinking-display.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.thinking-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #0e1369 0%, #1e40af 100%);
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.thinking-icon {
    font-size: 18px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.thinking-title {
    flex: 1;
}

.thinking-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    color: white;
    transition: background 0.2s;
}

.thinking-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.toggle-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

.thinking-steps {
    padding: 12px 16px;
}

.thinking-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    margin: 4px 0;
    background: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.thinking-step .step-icon {
    font-size: 16px;
    min-width: 24px;
    text-align: center;
}

.thinking-step .step-message {
    flex: 1;
    color: #334155;
    font-size: 13px;
}

.thinking-step .step-time {
    color: #94a3b8;
    font-size: 11px;
    font-family: monospace;
}

/* Step-specific styling */
.thinking-step[data-step="analyzing"] {
    border-left: 3px solid #3b82f6;
}

.thinking-step[data-step="routing"] {
    border-left: 3px solid #8b5cf6;
}

.thinking-step[data-step="delegating"] {
    border-left: 3px solid #06b8a0;
}

.thinking-step[data-step="processing"] {
    border-left: 3px solid #f59e0b;
}

.thinking-step[data-step="fetching"] {
    border-left: 3px solid #10b981;
}

.thinking-step[data-step="complete"] {
    border-left: 3px solid #22c55e;
    background: #f0fdf4;
}

/* ============================================
   AGENT FILE DOWNLOAD BLOCKS
   ============================================ */

.agent-file-download {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 16px;
    margin: 10px 0;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.agent-file-download:hover {
    border-color: #06b8a0;
    box-shadow: 0 2px 8px rgba(6, 184, 160, 0.1);
}

.agent-file-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #06b8a0, #0891b2);
    border-radius: 8px;
    color: #fff;
    font-size: 18px;
    flex-shrink: 0;
    position: relative;
}

.agent-file-ext {
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-top: 1px;
    opacity: 0.9;
}

.agent-file-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.agent-file-name {
    color: #1e293b !important;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agent-file-name:hover {
    color: #06b8a0 !important;
}

.agent-file-desc {
    color: #64748b;
    font-size: 12px;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agent-file-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #06b8a0;
    border-radius: 8px;
    color: #fff !important;
    text-decoration: none !important;
    font-size: 14px;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.15s;
}

.agent-file-btn:hover {
    background: #059283;
    transform: scale(1.05);
}

/* Agent Action Links (e.g., "Submit to Google Search Console") */
.agent-action-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff !important;
    text-decoration: none !important;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    margin: 6px 4px 6px 0;
    transition: transform 0.15s, box-shadow 0.2s;
}

.agent-action-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.agent-action-link i {
    font-size: 12px;
}
