/**
 * Enhanced Chat Response Formatter Styles
 * 
 * This file contains all the CSS styles for formatted chat responses
 * including links, lists, code blocks, quotes, tables, and callouts.
 */

/* Enhanced Link Styles */
.chat-link {
    color: #4F46E5;
    text-decoration: underline;
    word-break: break-all;
    transition: color 0.2s ease;
    position: relative;
    font-weight: 500;
}

.chat-link:hover {
    color: #3730A3;
    text-decoration: none;
}

.chat-link.external-link {
    color: #059669;
}

.chat-link.external-link:hover {
    color: #047857;
}

.external-link-icon {
    font-size: 0.8em;
    margin-left: 2px;
    opacity: 0.7;
}

/* Enhanced List Styles */
.chat-list {
    margin: 12px 0;
    padding-left: 24px;
    line-height: 1.6;
}

.chat-list li {
    margin: 6px 0;
    line-height: 1.5;
    position: relative;
}

.chat-list-nested {
    margin: 4px 0;
    padding-left: 20px;
}

.chat-list-level-1 { 
    padding-left: 16px; 
}

.chat-list-level-2 { 
    padding-left: 12px; 
}

.chat-list-level-3 { 
    padding-left: 8px; 
}

/* Enhanced Text Formatting */
.chat-inline-code {
    background-color: #F3F4F6;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
    font-size: 0.9em;
    color: #374151;
    border: 1px solid #E5E7EB;
}

.chat-inline-code:hover {
    background-color: #E5E7EB;
}

/* Enhanced Code Blocks */
.chat-code-block {
    background-color: #1F2937;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
    overflow-x: auto;
    font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
    font-size: 0.9em;
    line-height: 1.5;
    position: relative;
}

.chat-code-block::before {
    content: "Code";
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 0.75em;
    color: #9CA3AF;
    font-weight: 500;
}

.chat-code {
    color: #F9FAFB;
    background: none;
    padding: 0;
    border: none;
    font-size: inherit;
}

/* Enhanced Quote Styles */
.chat-quote {
    border-left: 4px solid #4F46E5;
    margin: 16px 0;
    padding: 12px 16px;
    background-color: #F8FAFC;
    border-radius: 0 8px 8px 0;
    position: relative;
}

.chat-quote::before {
    content: """;
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 2em;
    color: #4F46E5;
    opacity: 0.3;
}

.chat-quote p {
    margin: 0;
    padding-left: 20px;
    font-style: italic;
    color: #374151;
}

/* Heading Styles */
.chat-heading {
    margin: 20px 0 12px 0;
    color: #111827;
    font-weight: 600;
    line-height: 1.3;
}

.chat-h1 { 
    font-size: 1.5em; 
}

.chat-h2 { 
    font-size: 1.3em; 
}

.chat-h3 { 
    font-size: 1.1em; 
}

.chat-h4 { 
    font-size: 1em; 
}

.chat-h5 { 
    font-size: 0.9em; 
}

.chat-h6 { 
    font-size: 0.8em; 
}

/* Table Styles */
.chat-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chat-table th {
    background-color: #F3F4F6;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #E5E7EB;
}

.chat-table td {
    padding: 12px;
    border-bottom: 1px solid #E5E7EB;
    color: #374151;
}

.chat-table tr:hover {
    background-color: #F9FAFB;
}

/* Callout Styles */
.chat-callout {
    margin: 16px 0;
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    border-left: 4px solid;
}

.chat-callout .callout-icon {
    font-size: 1.2em;
    flex-shrink: 0;
    margin-top: 2px;
}

.chat-callout .callout-text {
    flex: 1;
    line-height: 1.5;
}

.chat-info {
    background-color: #EFF6FF;
    border-left-color: #3B82F6;
    color: #1E40AF;
}

.chat-warning {
    background-color: #FFFBEB;
    border-left-color: #F59E0B;
    color: #92400E;
}

.chat-error {
    background-color: #FEF2F2;
    border-left-color: #EF4444;
    color: #991B1B;
}

.chat-success {
    background-color: #ECFDF5;
    border-left-color: #10B981;
    color: #065F46;
}

/* Label-Description Styles */
.chat-label {
    font-weight: 600;
    color: #1F2937;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding: 2px 0;
    position: relative;
}

.chat-label::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 1px;
    opacity: 0.3;
}

/* Structured Content Containers */
.faq-container {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}

.steps-container {
    background: #F0F9FF;
    border: 1px solid #BAE6FD;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}

.product-info-container {
    background: #FEF3C7;
    border: 1px solid #FCD34D;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chat-list {
        padding-left: 20px;
    }
    
    .chat-code-block {
        padding: 12px;
        font-size: 0.85em;
    }
    
    .chat-table {
        font-size: 0.9em;
    }
    
    .chat-table th,
    .chat-table td {
        padding: 8px;
    }
    
    .chat-heading {
        margin: 16px 0 8px 0;
    }
    
    .chat-callout {
        padding: 10px 12px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .chat-inline-code {
        background-color: #374151;
        color: #F9FAFB;
        border-color: #4B5563;
    }
    
    .chat-code-block {
        background-color: #111827;
        border-color: #374151;
    }
    
    .chat-quote {
        background-color: #1F2937;
        color: #F9FAFB;
    }
    
    .chat-quote p {
        color: #F9FAFB;
    }
    
    .chat-table {
        background-color: #1F2937;
    }
    
    .chat-table th {
        background-color: #374151;
        color: #F9FAFB;
        border-bottom-color: #4B5563;
    }
    
    .chat-table td {
        color: #F9FAFB;
        border-bottom-color: #4B5563;
    }
    
    .chat-table tr:hover {
        background-color: #374151;
    }
    
    .chat-heading {
        color: #F9FAFB;
    }
}

/* Animation for better UX */
.chat-link,
.chat-inline-code,
.chat-code-block,
.chat-quote,
.chat-table,
.chat-callout {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* Print styles */
@media print {
    .chat-link {
        color: #000 !important;
        text-decoration: underline !important;
    }
    
    .chat-code-block {
        background-color: #f5f5f5 !important;
        border: 1px solid #ccc !important;
        color: #000 !important;
    }
    
    .chat-table {
        border: 1px solid #000 !important;
    }
    
    .chat-table th,
    .chat-table td {
        border: 1px solid #000 !important;
    }
}

