/* Share Chat Modal Styles - Modern styling matching dashboard chat modal */

/* Modal backdrop styling is handled in public-board.css */

/* Share chat modal layout - match dashboard modal exactly */
#shareChatModal .modal-dialog {
    display: flex;
    flex-direction: column;
    height: 90vh; /* Match real chat modal height */
    max-height: 90vh;
    max-width: 95%; /* Take up more horizontal space */
    margin: 5vh auto; /* Reduced margins for larger modal */
    width: 100%; /* Ensure full width utilization */
}

/* Modal content with modern rounded corners and proper layout */
#shareChatModal .modal-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    border: 1px solid var(--bs-primary);
    background-color: var(--bs-dark);
    color: var(--bs-light);
    border-radius: 24px; /* Modern rounded corners */
}

/* Modal header with modern styling - match dashboard modal */
#shareChatModal .modal-header {
    flex-shrink: 0;
    padding: 1rem 1rem 0rem 1rem;
    border-bottom: 0;
}

/* Modern context toast styling */
#shareChatModal .modern-context-toast {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

#shareChatModal .modern-context-toast .toast-body {
    padding: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

/* Nav tabs with modern styling - match dashboard modal */
#shareChatModal .nav-tabs {
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0;
    padding: 0 1.5rem;
    background: transparent;
}

#shareChatModal .nav-tabs .nav-item {
    margin-bottom: 0;
}

#shareChatModal .nav-tabs .nav-link {
    background: transparent;
    border: none;
    border-radius: 12px 12px 0 0;
    color: #888899;
    padding: 0.875rem 1.25rem;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    margin-right: 0.5rem;
    /* Override the existing chat-modal-tab-title styles */
    font-family: inherit !important;
    letter-spacing: normal !important;
    text-transform: none !important;
}

#shareChatModal .nav-tabs .nav-link:hover {
    color: #EAEAEA;
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
}

#shareChatModal .nav-tabs .nav-link.active {
    color: #4A4AFF;
    background: rgba(74, 74, 255, 0.1);
    border-bottom: 2px solid #4A4AFF;
    transform: translateY(-1px);
}

#shareChatModal .nav-tabs .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #4A4AFF, transparent);
    border-radius: 2px;
}

/* Modal body should grow to fill available space between header and footer */
#shareChatModal .modal-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    height: 100%; /* Ensure it takes full available height */
}

/* Tab content container should fill modal body completely */
#shareChatModal .tab-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    overflow: hidden; /* Prevent overflow, let children handle scrolling */
}

/* All tab panes should be ready to flex when active */
#shareChatModal .tab-pane {
    display: none;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* Active tab pane should display as flex and fill all available space */
#shareChatModal .tab-pane.show.active {
    display: flex !important;
    flex: 1 1 auto;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

/* Share AI Chat tab specific layout - maximize space */
#shareAiChatTabPane {
    padding: 0 !important;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

/* Share chat messages area should grow to fill all available space */
#shareAiChatTabPane #shareChatMessages {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none; /* Remove any height constraints */
    overflow-y: auto;
    padding: 1rem;
    margin: 0;
    display: flex;
    flex-direction: column;
    word-wrap: break-word;
    scroll-behavior: smooth;
    position: relative;
}

/* Share chat messages scrollbar styling */
#shareChatMessages::-webkit-scrollbar {
    width: 8px;
}

#shareChatMessages::-webkit-scrollbar-track {
    background: var(--bs-dark);
}

#shareChatMessages::-webkit-scrollbar-thumb {
    background-color: var(--bs-primary);
    border-radius: 4px;
}

/* Modern share chat notice styling - positioned at bottom */
#shareChatModal .share-chat-notice-footer {
    flex-shrink: 0; /* Don't allow footer to shrink */
    flex-grow: 0; /* Don't allow footer to grow */
    margin: 0;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(74, 74, 255, 0.05), rgba(13, 202, 240, 0.05));
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border-radius: 0 0 24px 24px; /* Match modal rounded corners */
    max-height: 120px; /* Limit footer height to preserve chat space */
}

/* Try Board button in modal footer - inherits Bootstrap and header styles */
#try-board-button-modal {
    font-weight: 600; /* Match header button weight */
    border-radius: 8px; /* Match header button rounded corners */
}

#try-board-button-modal i.bi-play-circle {
    margin-right: 0.125rem; /* Tight spacing to match header button */
    color: white !important; /* Ensure icon is white like header button */
}

/* Chat message styling - match dashboard with proper font sizing */
#shareChatModal .chat-message {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    position: relative;
    font-size: 1.1rem; /* Match dashboard font size */
    color: rgba(255, 255, 255, 0.95); /* Bright text like dashboard */
}

.user-message {
    background-color: var(--bs-primary);
    margin-right: 1rem;
}

.assistant-message {
    background-color: var(--bs-dark-text-emphasis);
    margin-left: 1rem;
    position: relative;
    padding-top: 1rem;
}

/* Add gradient line to all assistant messages */
.assistant-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--bs-primary), transparent);
    border-radius: 0;
}

.system-message {
    background-color: rgba(255, 255, 255, 0.1);
    font-style: italic;
    font-size: 0.9rem;
}

/* Message content with integrated header */
#shareChatModal .message-content {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Message text container for proper spacing */
#shareChatModal .message-text-container {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Message body contains the actual content */
#shareChatModal .message-body {
    width: 100%;
}

/* Header section inside message text */
#shareChatModal .message-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Enhanced styling for non-fuzzed message headers to match fuzzed appearance */
#shareChatModal .chat-message:not(.fuzzed-message) .message-header {
    opacity: 0.9; /* Slightly higher opacity for better readability */
}

#shareChatModal .chat-message:not(.fuzzed-message) .assistant-name,
#shareChatModal .chat-message:not(.fuzzed-message) .user-name {
    font-family: monospace; /* Match the fuzzed message font */
    font-weight: 600;
    font-size: 0.9rem; /* Match the base message-header font size */
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 1px; /* Match the fuzzed message letter spacing */
}

#shareChatModal .chat-message:not(.fuzzed-message) .message-time {
    font-family: monospace; /* Match the fuzzed message font */
    font-size: 0.8rem; /* Match proportional size to 0.9rem names */
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
    letter-spacing: 1px; /* Match the fuzzed message letter spacing */
}

/* Name and timestamp styling */
#shareChatModal .user-name,
#shareChatModal .assistant-name {
    display: block;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}

#shareChatModal .message-time {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}



#shareChatModal .message-time {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400; /* Lighter weight for subtle appearance */
}

/* Modern message content styling - match dashboard */
#shareChatModal .message-content {
    line-height: 1.6;
    word-wrap: break-word;
    font-size: 1.1rem; /* Match dashboard content font size */
    color: rgba(255, 255, 255, 0.95); /* Brighter text like dashboard */
}

/* Message content typography - match dashboard chat.css */
#shareChatModal .chat-message p {
    margin-bottom: 0.5rem;
}

#shareChatModal .chat-message ul, 
#shareChatModal .chat-message ol {
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
}

#shareChatModal .chat-message code {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: monospace;
}

#shareChatModal .chat-message pre {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-bottom: 0.5rem;
}

#shareChatModal .chat-message pre code {
    background-color: transparent;
    padding: 0;
}

#shareChatModal .chat-message a {
    color: var(--bs-info);
    text-decoration: underline;
}

#shareChatModal .chat-message blockquote {
    border-left: 3px solid var(--bs-info);
    margin-left: 0;
    padding-left: 1rem;
    color: rgba(255, 255, 255, 0.92); /* Brighter blockquote text */
}

/* Table styles in share chat messages */
#shareChatModal .chat-message table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

#shareChatModal .chat-message th,
#shareChatModal .chat-message td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#shareChatModal .chat-message th {
    background-color: rgba(255, 255, 255, 0.1);
    font-weight: 600;
    color: #ffffff; /* Pure white for headers */
}

#shareChatModal .chat-message td {
    color: rgba(255, 255, 255, 0.92); /* Brighter table text */
}

/* Simplified fuzzed message styling - focus on content obfuscation */
#shareChatModal .chat-message.fuzzed-message {
    opacity: 0.5;
    position: relative;
}

#shareChatModal .chat-message.fuzzed-message .message-content {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Hide action buttons on fuzzed messages */
#shareChatModal .chat-message.fuzzed-message .chat-message-actions {
    display: none !important;
}

/* Simplified fuzzed content placeholder styling */
#shareChatModal .fuzzed-message .message-content {
    font-family: monospace;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
}

/* Fuzzed summary styling - match fuzzed message appearance */
#shareChatModal .context-entry.fuzzed-summary {
    opacity: 0.5;
    position: relative;
}

#shareChatModal .fuzzed-summary .context-entry-summary,
#shareChatModal .fuzzed-summary .summary-text-styled {
    font-family: monospace;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Note: .summary-title-styled (card title) intentionally excluded from obfuscation styling */

/* Override old chat modal tab titles with modern styling */
#shareChatModal .chat-modal-tab-title {
    font-family: inherit !important;
    font-weight: 500 !important;
    font-size: 1rem !important;
    letter-spacing: normal !important;
    text-transform: none !important;
}

/* Deep Research message styling */
.deep-research-assistant-message {
    border: 2px solid #ffc107;
    box-shadow: 0 0 8px rgba(255, 193, 7, 0.25);
}

.deep-research-user-message {
    border: 2px solid #ffc107;
    box-shadow: 0 0 8px rgba(255, 193, 7, 0.25);
}

/* Lightning icon for Deep Research */
.deep-research-lightning-icon {
    color: #ffc107;
    margin-right: 0.25rem;
}

/* Agent update styling */
.agent-update {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background-color: rgba(255, 193, 7, 0.1);
    border-left: 3px solid #ffc107;
    border-radius: 0.25rem;
}

.agent-name-prefix {
    color: #ffc107;
    font-weight: bold;
}

.agent-content {
    color: rgba(255, 255, 255, 0.9);
}

/* Final summary styling */
.final-summary {
    margin-top: 1rem;
    padding: 1rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Deep Research status line */
.deep-research-status-line {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background-color: rgba(255, 193, 7, 0.15);
    border-radius: 0.25rem;
    font-weight: 500;
    color: #ffc107;
}

/* Research complete indicator */
.research-complete-indicator {
    color: #28a745;
    font-weight: bold;
    text-align: center;
    padding: 0.5rem;
    background-color: rgba(40, 167, 69, 0.1);
    border-radius: 0.25rem;
    margin-bottom: 1rem;
}

/* Summary and context tab content - maximize available space */
#shareChatModal .direct-chat-summary-content,
#shareChatModal .direct-extended-context-content {
    padding: 1rem;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    height: 100%;
}

/* Context entry styling */
.context-entry {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.context-entry.current-card {
    border-color: var(--bs-primary);
    background-color: rgba(var(--bs-primary-rgb), 0.1);
}

.context-entry-summary {
    margin-top: 0.75rem;
    line-height: 1.6;
}

/* Summary styling classes */
.summary-present-bg {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    border-color: var(--bs-primary);
}

.summary-empty {
    background-color: rgba(108, 117, 125, 0.1);
    border-color: #6c757d;
}

.summary-title-styled {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
}

.summary-content-styled {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.summary-text-styled {
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
}

/* Modern loading states and animations */
.gradient-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--bs-primary) 50%, transparent 100%);
    background-size: 200% 100%;
    opacity: 0.8;
    box-shadow: 0 0 8px rgba(var(--bs-primary-rgb), 0.3);
    z-index: 1000;
    animation: moveGradient 1.5s ease-in-out infinite alternate;
}

/* Modern streaming indicator */
#shareChatModal .streaming-indicator {
    display: none;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.5rem;
}

#shareChatModal .streaming-indicator.active {
    display: flex;
    justify-content: center;
    padding: 10px;
}

/* Modern typing dots */
#shareChatModal .typing-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

#shareChatModal .typing-dots span {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

#shareChatModal .typing-dots span:nth-child(1) { animation-delay: 0.1s; }
#shareChatModal .typing-dots span:nth-child(2) { animation-delay: 0.2s; }
#shareChatModal .typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes moveGradient {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spin {
    display: inline-block;
    animation: spin 1s linear infinite;
}

/* Modern copy and print button styling - match dashboard chat */
#shareChatModal .chat-message-actions {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

#shareChatModal .chat-message:hover .chat-message-actions {
    opacity: 1;
}

#shareChatModal .chat-message-copy-btn,
#shareChatModal .chat-message-print-btn {
    background-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 2px;
}

#shareChatModal .chat-message-copy-btn:hover,
#shareChatModal .chat-message-print-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

#shareChatModal .chat-message-copy-btn:active,
#shareChatModal .chat-message-print-btn:active {
    transform: scale(0.95);
}

#shareChatModal .chat-message-copy-btn.copied {
    background-color: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border-color: #28a745;
}

#shareChatModal .chat-message-print-btn.printing {
    background-color: rgba(23, 162, 184, 0.2);
    color: #17a2b8;
    border-color: #17a2b8;
}

#shareChatModal .chat-message-copy-btn i,
#shareChatModal .chat-message-print-btn i {
    font-size: 0.875rem;
}

#shareChatModal .chat-message-copy-btn .copy-text,
#shareChatModal .chat-message-print-btn .print-text {
    font-size: 0.75rem;
    margin-left: 2px;
}

/* Hide print buttons on mobile phones */
@media (max-width: 576px) {
    #shareChatModal .chat-message-print-btn {
        display: none !important;
    }
    
    #shareChatModal .chat-message-actions {
        gap: 0;
    }
}

/* Modern alert styling - match dashboard */
#shareChatModal .alert {
    border: none;
    border-radius: 12px;
    background: rgba(26, 26, 35, 0.95);
    color: #EAEAEA;
    border: 2px solid rgba(255, 255, 255, 0.1);
    padding: 1rem;
    margin: 0;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#shareChatModal .alert:hover {
    transform: translateY(-1px);
}

#shareChatModal .alert-info {
    border-color: #0dcaf0;
    box-shadow: 0 4px 12px rgba(13, 202, 240, 0.15);
}

#shareChatModal .alert-info:hover {
    border-color: rgba(13, 202, 240, 0.8);
    box-shadow: 0 6px 16px rgba(13, 202, 240, 0.2);
}

#shareChatModal .alert-info i {
    color: #0dcaf0;
    margin-right: 0.25rem;
    font-size: 1.1rem;
}

#shareChatModal .alert-link {
    color: #ffffff;
    text-decoration: underline;
    font-weight: 500;
    transition: all 0.2s ease;
}

#shareChatModal .alert-link:hover {
    color: #4A4AFF;
    text-decoration: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #shareChatModal .modal-dialog {
        height: 95vh;
        max-height: 95vh;
        margin: 2.5vh auto;
    }
    
    .user-message {
        margin-right: 0.5rem;
    }
    
    .assistant-message {
        margin-left: 0.5rem;
    }
    
    #shareAiChatTabPane #shareChatMessages {
        padding: 0.75rem;
    }
    
    #shareChatModal .share-chat-notice-footer {
        padding: 0.75rem;
    }
}

@media (max-width: 576px) {
    .chat-modal-tab-title {
        font-size: 0.75rem;
    }
    
    .user-message,
    .assistant-message {
        margin-left: 0.25rem;
        margin-right: 0.25rem;
    }
}



