/* ==========================================
   KUSOYA AI - CHAT & MESSAGES STYLES
   ========================================== */

.ai-chat-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: #ffffff;
}

.ai-main-content, .main-chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    position: relative;
    margin-left: 260px;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-topbar, .navbar {
    height: 60px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 2001;
    flex-shrink: 0;
}

.topbar-center {
    flex: 1;
    text-align: center;
}

.chat-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.topbar-actions {
    display: flex;
    gap: 8px;
}

.icon-button {
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-button:hover {
    background: #f3f4f6;
    color: #111827;
}

.messages-container, .chat-messages-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    background: #ffffff;
    scroll-behavior: smooth;
    min-height: 0;
}

.messages-container::-webkit-scrollbar, .chat-messages-area::-webkit-scrollbar {
    width: 8px;
}

.messages-container::-webkit-scrollbar-thumb, .chat-messages-area::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.message-wrapper {
    display: flex;
    margin-bottom: 24px;
    animation: fadeInSlide 0.4s;
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-wrapper.user-message {
    justify-content: flex-end;
}

.message-content.user-content, .user-bubble {
    background: #004589;
    color: #ffffff;
    border-radius: 18px 18px 4px 18px;
    padding: 12px 18px;
    max-width: 70%;
    box-shadow: 0 2px 8px rgba(0, 69, 137, 0.2);
}

.message-wrapper.ai-message {
    justify-content: flex-start;
    gap: 12px;
}

.ai-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #004589 0%, #f95c38 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 18px;
    flex-shrink: 0;
}

.message-content.ai-content, .ai-bubble {
    background: #f3f4f6;
    color: #111827;
    border-radius: 18px 18px 18px 4px;
    padding: 12px 18px;
    max-width: 70%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.message-content p {
    margin: 0;
    line-height: 1.6;
}

.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 40px 20px 20px;
    text-align: center;
    height: auto;
    min-height: auto;
}

.ai-avatar-large {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #004589 0%, #f95c38 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 36px;
    margin-bottom: 24px;
    flex-shrink: 0;
}

.welcome-title {
    font-size: 32px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 12px;
}

.welcome-subtitle {
    font-size: 18px;
    color: #6b7280;
    margin-bottom: 32px;
}

.example-prompts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    max-width: 900px;
    width: 100%;
}

.prompt-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.prompt-card:hover {
    border-color: #004589;
    background: #f9fafb;
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 69, 137, 0.15);
}

.prompt-card i {
    color: #004589;
    font-size: 20px;
    flex-shrink: 0;
}

.prompt-card span {
    color: #374151;
    font-size: 14px;
    line-height: 1.5;
}

/* ==========================================
   AI MESSAGE CONTENT FORMATTING
   ========================================== */

/* Headers */
.ai-content h2, .ai-content h3, .ai-content h4, .ai-content h5 {
    color: #111827;
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.ai-content h2 {
    font-size: 1.5rem;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
    margin-top: 1.5rem;
}

.ai-content h3 {
    font-size: 1.25rem;
}

.ai-content h4 {
    font-size: 1.1rem;
}

.ai-content h5 {
    font-size: 1rem;
}

/* Lists */
.ai-content ul, .ai-content ol {
    padding-left: 1.5rem;
    margin: 0.75rem 0;
    list-style-position: outside;
}

.ai-content ul {
    list-style-type: disc;
}

.ai-content ul ul {
    list-style-type: circle;
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
    padding-left: 1.25rem;
}

.ai-content ul ul ul {
    list-style-type: square;
}

.ai-content ol {
    list-style-type: decimal;
}

.ai-content ol ol {
    list-style-type: lower-alpha;
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
    padding-left: 1.25rem;
}

.ai-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.ai-content .nested-list {
    margin-top: 0.5rem;
}

/* Text Formatting */
.ai-content strong {
    font-weight: 600;
    color: #004589;
}

.ai-content em {
    font-style: italic;
    color: #374151;
}

.ai-content a.ai-link {
    color: #004589;
    text-decoration: underline;
    transition: color 0.2s;
}

.ai-content a.ai-link:hover {
    color: #f95c38;
}

/* Code */
.ai-content code.inline-code {
    background-color: #f1f5f9;
    color: #e11d48;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 0.875rem;
}

.ai-content pre {
    background-color: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ai-content pre code {
    background: none;
    color: inherit;
    padding: 0;
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Blockquotes */
.ai-content .blockquote-custom {
    border-left: 4px solid #004589;
    padding-left: 1rem;
    margin: 1rem 0;
    font-style: italic;
    color: #4b5563;
    background: #f9fafb;
    padding: 0.75rem 1rem;
    border-radius: 4px;
}

/* Horizontal Rules */
.ai-content hr {
    border: none;
    border-top: 2px solid #e5e7eb;
    margin: 1.5rem 0;
}

/* Paragraphs */
.ai-content p {
    margin-bottom: 0.75rem;
    line-height: 1.7;
    color: #374151;
}

/* Table styling for AI responses */
.ai-content .table-responsive {
    margin: 1rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.ai-content table {
    font-size: 0.9rem;
    margin-bottom: 0;
    width: 100%;
    border-collapse: collapse;
}

.ai-content table thead {
    background-color: #f8f9fa;
}

.ai-content table th {
    font-weight: 600;
    color: #004589;
    border-bottom: 2px solid #dee2e6;
    padding: 0.75rem;
    text-align: left;
}

.ai-content table td {
    padding: 0.75rem;
    vertical-align: top;
    border-bottom: 1px solid #e5e7eb;
}

.ai-content table tbody tr:hover {
    background-color: rgba(0, 69, 137, 0.05);
}

.ai-content table tbody tr:last-child td {
    border-bottom: none;
}

/* ==========================================
   PROVIDER BADGE
   ========================================== */
.provider-badge {
    margin-top: 8px;
    font-size: 0.75rem;
}

.provider-badge .badge {
    padding: 4px 8px;
    font-weight: 500;
    border-radius: 4px;
}

.provider-badge .badge.bg-success {
    background-color: #10b981 !important;
}

.provider-badge .badge.bg-primary {
    background-color: #0066cc !important;
}

/* ==========================================
   THINKING INDICATOR
   ========================================== */
.thinking-indicator .ai-content {
    background: #ffffff;
    border: 1px solid #e5e7eb;
}

.thinking-animation {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.thinking-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #004589;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.thinking-text {
    color: #6b7280;
    font-size: 14px;
}

/* ==========================================
   TOAST NOTIFICATIONS
   ========================================== */
.toast-container {
    z-index: 9999;
}

.toast {
    min-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: none;
}

.toast-header {
    border-bottom: none;
    font-weight: 600;
}

.toast-header.bg-kusoya-blue {
    background-color: var(--kusoya-blue) !important;
}

/* ==========================================
   ALERTS
   ========================================== */
.alert {
    border-radius: 10px;
    border: none;
}

/* ==========================================
   FORM CONTROLS
   ========================================== */
.form-control:focus, .form-select:focus {
    border-color: var(--kusoya-blue, #004589);
    box-shadow: 0 0 0 0.2rem rgba(0, 69, 137, 0.25);
}

.form-check-input:checked {
    background-color: var(--kusoya-blue, #004589);
    border-color: var(--kusoya-blue, #004589);
}

/* ==========================================
   CARDS
   ========================================== */
.card {
    border: none;
    border-radius: 12px;
    transition: all 0.3s ease;
}

/* ==========================================
   TABLES (GENERAL)
   ========================================== */
.table-responsive {
    max-height: 400px;
    overflow-y: auto;
    border-radius: 8px;
}

.table {
    font-size: 0.9em;
    margin-bottom: 0;
}

.table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 69, 137, 0.05);
}

/* ==========================================
   BADGES
   ========================================== */
.badge {
    font-weight: 500;
    padding: 0.4em 0.8em;
}

/* ==========================================
   MOBILE RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
    .ai-main-content, .main-chat-area {
        margin-left: 0;
    }
    
    .message-content.user-content,
    .message-content.ai-content {
        max-width: 85%;
    }
    
    .welcome-title {
        font-size: 24px;
    }
    
    .welcome-subtitle {
        font-size: 16px;
    }
    
    .example-prompts-grid {
        grid-template-columns: 1fr;
    }
    
    .ai-content table {
        font-size: 0.8rem;
    }
    
    .ai-content table th,
    .ai-content table td {
        padding: 0.5rem;
    }
    
    /* Mobile keyboard handling */
    body.keyboard-open .messages-container,
    body.keyboard-open .chat-messages-area {
        padding-bottom: 80px;
    }
}

@media (max-width: 480px) {
    .messages-container, .chat-messages-area {
        padding: 12px;
    }
    
    .message-wrapper {
        margin-bottom: 16px;
    }
    
    .ai-avatar {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .message-content {
        font-size: 14px;
    }
    
    .ai-content h2 {
        font-size: 1.25rem;
    }
    
    .ai-content h3 {
        font-size: 1.1rem;
    }
    
    .ai-content h4 {
        font-size: 1rem;
    }
    
    .ai-content table {
        font-size: 0.75rem;
    }
}

/* ==========================================
   DARK MODE SUPPORT (OPTIONAL)
   ========================================== */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles if needed */
}

/* ==========================================
   PRINT STYLES
   ========================================== */
@media print {
    .ai-topbar,
    .navbar,
    .topbar-actions,
    .provider-badge,
    .thinking-indicator {
        display: none !important;
    }
    
    .messages-container,
    .chat-messages-area {
        overflow: visible !important;
        height: auto !important;
    }
    
    .message-wrapper {
        break-inside: avoid;
    }
}
/* ==========================================
   NEW ADDITIONS FOR KUSOYA-CHAT.CSS
   Add these styles at the bottom of your existing kusoya-chat.css file
   ========================================== */

/* ==========================================
   CODE BLOCK WRAPPER WITH COPY BUTTON
   ========================================== */

.code-block-wrapper {
    margin: 1rem 0;
    border-radius: 8px;
    overflow: hidden;
    background: #1e293b;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #0f172a;
    border-bottom: 1px solid #334155;
}

.code-language {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.code-copy-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #334155;
    border: 1px solid #475569;
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.code-copy-btn:hover {
    background: #475569;
    border-color: #64748b;
    transform: translateY(-1px);
}

.code-copy-btn:active {
    transform: translateY(0);
}

.code-copy-btn.copied {
    background: #10b981;
    border-color: #059669;
    color: #ffffff;
}

.code-copy-btn i {
    font-size: 13px;
}

.code-copy-btn .copy-text {
    font-weight: 500;
}

/* Code block pre and code styling */
.code-block-wrapper pre {
    margin: 0;
    padding: 1rem;
    background: #1e293b;
    overflow-x: auto;
}

.code-block-wrapper pre code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #e2e8f0;
}

/* Syntax highlighting (basic) */
.code-block-wrapper pre code .keyword {
    color: #c792ea;
}

.code-block-wrapper pre code .string {
    color: #c3e88d;
}

.code-block-wrapper pre code .comment {
    color: #697098;
    font-style: italic;
}

.code-block-wrapper pre code .function {
    color: #82aaff;
}

/* ==========================================
   MESSAGE ACTION BUTTONS
   ========================================== */

.message-actions {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* Show actions on hover or touch */
.message-wrapper:hover .message-actions,
.message-wrapper:focus-within .message-actions {
    opacity: 1;
}

/* Always show on mobile/touch devices */
@media (hover: none) {
    .message-actions {
        opacity: 0.7;
    }
}

.message-action-btn {
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.message-action-btn:hover {
    background: rgba(0, 69, 137, 0.1);
    border-color: #004589;
    color: #004589;
    transform: translateY(-1px);
}

.message-action-btn:active {
    transform: translateY(0);
}

/* Specific button styles */
.copy-message-btn:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
    color: #10b981;
}

.message-action-btn[onclick*="retry"]:hover {
    background: rgba(249, 92, 56, 0.1);
    border-color: #f95c38;
    color: #f95c38;
}

.message-action-btn[onclick*="edit"]:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
    color: #3b82f6;
}

/* For user messages - align actions to the right */
.user-message .message-actions {
    justify-content: flex-end;
}

/* For AI messages - align actions to the left */
.ai-message .message-actions {
    justify-content: flex-start;
}

/* ==========================================
   MESSAGE ACTION BUTTON TOOLTIPS
   ========================================== */

.message-action-btn {
    position: relative;
}

.message-action-btn::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    padding: 4px 8px;
    background: #1f2937;
    color: #ffffff;
    font-size: 11px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.message-action-btn:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-8px);
}

/* ==========================================
   ENHANCED INLINE CODE
   ========================================== */

.ai-content code.inline-code {
    background-color: #f1f5f9;
    color: #e11d48;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    border: 1px solid #e2e8f0;
}

/* ==========================================
   COPY FEEDBACK ANIMATIONS
   ========================================== */

@keyframes copySuccess {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.message-action-btn.copied,
.code-copy-btn.copied {
    animation: copySuccess 0.3s ease;
}

/* ==========================================
   ENHANCED PROVIDER BADGE
   ========================================== */

.provider-badge {
    margin-top: 8px;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.provider-badge .badge {
    padding: 4px 10px;
    font-weight: 500;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    letter-spacing: 0.3px;
}

.provider-badge .badge.bg-success {
    background-color: #10b981 !important;
    color: #ffffff;
}

.provider-badge .badge.bg-primary {
    background-color: #0066cc !important;
    color: #ffffff;
}

/* ==========================================
   ENHANCED THINKING INDICATOR
   ========================================== */

.thinking-indicator .ai-content {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    min-width: 120px;
}

.thinking-animation {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.thinking-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #004589;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { 
        transform: rotate(0deg); 
    }
    100% { 
        transform: rotate(360deg); 
    }
}

.thinking-text {
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
}

/* ==========================================
   ERROR MESSAGE STYLING
   ========================================== */

.ai-content .text-danger {
    color: #dc2626;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-content .text-danger i {
    font-size: 18px;
}

/* Retry button in error messages */
.ai-content .btn-outline-primary {
    border-color: #004589;
    color: #004589;
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ai-content .btn-outline-primary:hover {
    background: #004589;
    color: #ffffff;
    transform: translateY(-1px);
}

/* ==========================================
   MOBILE RESPONSIVE ADJUSTMENTS
   ========================================== */

@media (max-width: 768px) {
    .code-block-header {
        padding: 6px 10px;
    }
    
    .code-copy-btn {
        padding: 3px 8px;
        font-size: 11px;
    }
    
    .code-block-wrapper pre {
        padding: 0.75rem;
    }
    
    .code-block-wrapper pre code {
        font-size: 12px;
    }
    
    .message-action-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    /* Always show message actions on mobile */
    .message-actions {
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .code-language {
        font-size: 10px;
    }
    
    .code-copy-btn .copy-text {
        display: none; /* Hide text, show only icon on small screens */
    }
    
    .message-action-btn {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    /* Disable tooltips on mobile */
    .message-action-btn::after {
        display: none;
    }
}

/* ==========================================
   ACCESSIBILITY ENHANCEMENTS
   ========================================== */

.message-action-btn:focus-visible,
.code-copy-btn:focus-visible {
    outline: 2px solid #004589;
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .code-block-wrapper {
        border: 2px solid #000000;
    }
    
    .message-action-btn {
        border: 2px solid #000000;
    }
    
    .code-copy-btn {
        border: 2px solid #ffffff;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .message-action-btn,
    .code-copy-btn {
        transition: none;
    }
    
    .message-action-btn:hover,
    .code-copy-btn:hover {
        transform: none;
    }
    
    .thinking-spinner {
        animation: none;
        border-top-color: #004589;
    }
    
    .message-action-btn.copied,
    .code-copy-btn.copied {
        animation: none;
    }
}

/* ==========================================
   PRINT STYLES
   ========================================== */

@media print {
    .message-actions,
    .code-copy-btn,
    .provider-badge {
        display: none !important;
    }
    
    .code-block-header {
        background: #f3f4f6;
        border-bottom-color: #d1d5db;
    }
    
    .code-block-wrapper pre {
        background: #f9fafb;
    }
    
    .code-block-wrapper pre code {
        color: #000000;
    }
}

/* ==========================================
   DARK MODE SUPPORT (OPTIONAL - FOR FUTURE)
   ========================================== */

@media (prefers-color-scheme: dark) {
    .message-action-btn {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
        color: #9ca3af;
    }
    
    .message-action-btn:hover {
        background: rgba(0, 69, 137, 0.2);
        border-color: #004589;
        color: #60a5fa;
    }
    
    .ai-content code.inline-code {
        background-color: #1f2937;
        color: #fca5a5;
        border-color: #374151;
    }
}

/* ==========================================
   SMOOTH SCROLLBAR FOR CODE BLOCKS
   ========================================== */

.code-block-wrapper pre::-webkit-scrollbar {
    height: 8px;
}

.code-block-wrapper pre::-webkit-scrollbar-track {
    background: #0f172a;
}

.code-block-wrapper pre::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

.code-block-wrapper pre::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* ==========================================
   LOADING STATE FOR MESSAGES
   ========================================== */

.message-wrapper.loading {
    opacity: 0.6;
    pointer-events: none;
}

.message-wrapper.loading .message-content {
    position: relative;
}

.message-wrapper.loading .message-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}
/* ==========================================
   TABLE SCROLLING FIX - ADD TO KUSOYA-CHAT.CSS
   Fixes tables cutting off words by adding horizontal scroll
   ========================================== */

/* Custom table wrapper with horizontal scroll */
.table-responsive-custom {
    overflow-x: auto;
    overflow-y: visible;
    margin: 1rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Table styling */
.table-responsive-custom table {
    font-size: 0.9rem;
    margin-bottom: 0;
    width: 100%;
    min-width: 600px; /* Ensures table doesn't squish too much */
    border-collapse: collapse;
    white-space: nowrap; /* Prevents text wrapping in cells */
}

/* Table header */
.table-responsive-custom table thead {
    background-color: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table-responsive-custom table th {
    font-weight: 600;
    color: #004589;
    border-bottom: 2px solid #dee2e6;
    padding: 0.75rem;
    text-align: left;
    white-space: nowrap;
}

/* Table body */
.table-responsive-custom table td {
    padding: 0.75rem;
    vertical-align: top;
    border-bottom: 1px solid #e5e7eb;
    white-space: normal; /* Allow text to wrap in cells if needed */
    word-wrap: break-word;
    max-width: 300px; /* Prevents cells from getting too wide */
}

/* Hover effect on rows */
.table-responsive-custom table tbody tr:hover {
    background-color: rgba(0, 69, 137, 0.05);
}

/* Last row no border */
.table-responsive-custom table tbody tr:last-child td {
    border-bottom: none;
}

/* Custom scrollbar for tables */
.table-responsive-custom::-webkit-scrollbar {
    height: 10px;
}

.table-responsive-custom::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-responsive-custom::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.table-responsive-custom::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Scroll indicator (subtle shadow on right when scrollable) */
.table-responsive-custom {
    position: relative;
}

.table-responsive-custom::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(to left, rgba(255,255,255,0.9), transparent);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Show scroll indicator when table is scrollable */
.table-responsive-custom.has-scroll::after {
    opacity: 1;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .table-responsive-custom table {
        font-size: 0.8rem;
        min-width: 500px; /* Smaller minimum width on mobile */
    }
    
    .table-responsive-custom table th,
    .table-responsive-custom table td {
        padding: 0.5rem;
        max-width: 200px; /* Smaller max width on mobile */
    }
}

@media (max-width: 480px) {
    .table-responsive-custom table {
        font-size: 0.75rem;
        min-width: 400px; /* Even smaller on very small screens */
    }
    
    .table-responsive-custom table th,
    .table-responsive-custom table td {
        padding: 0.4rem;
        max-width: 150px;
    }
    
    .table-responsive-custom::-webkit-scrollbar {
        height: 6px;
    }
}

/* Print styles - no scrolling needed */
@media print {
    .table-responsive-custom {
        overflow: visible !important;
    }
    
    .table-responsive-custom table {
        min-width: auto !important;
        white-space: normal !important;
    }
    
    .table-responsive-custom::after {
        display: none !important;
    }
}

/* ==========================================
   END OF TABLE SCROLLING FIX
   ========================================== */
/* ==========================================
   END OF NEW ADDITIONS
   ========================================== */