/* MCP Demo Styles */

:root {
    --primary-color: #1e40af;
    --primary-hover: #1e3a8a;
    --secondary-color: #667eea;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --light-bg: #f8f9fa;
    --border-color: #e5e7eb;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1e40af 0%, #3730a3 100%);
    min-height: 100vh;
    padding-bottom: 2rem;
}

/* Header */
.header {
    background: white;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    transition: opacity 0.2s;
}

.logo:hover {
    opacity: 0.8;
}

.header-cta {
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: white;
    padding: 9px 18px;
    border-radius: 7px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.header-cta:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    color: white;
}

/* Hero Section */
.hero-section {
    background: white;
    border-radius: 12px;
    padding: 40px 24px;
    margin: 24px 0 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.hero-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.hero-section p {
    margin-bottom: 0.75rem;
    font-size: 1.05rem;
}

/* Stats Container */
.stats-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 24px 20px;
    border-radius: 12px;
    color: white;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.stats-container > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 140px;
}

.stats-container span {
    font-size: 0.85rem;
    opacity: 0.95;
    line-height: 1.4;
}

.stats-container strong {
    font-size: 1.75rem;
    font-weight: 700;
    display: block;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

/* Examples Section */
.examples-section {
    background: white;
    padding: 24px;
    margin: 16px 0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.examples-section p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.example-chips {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.chip {
    padding: 12px 20px;
    background: white;
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 0.95rem;
    font-weight: 600;
}

.chip:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

/* Example Query Buttons - Enhanced styling */
.example-query-btn {
    font-weight: 600;
    transition: all 0.25s ease;
}

.example-query-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

.example-query-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

/* Chat Container */
.chat-container {
    background: white;
    min-height: 500px;
    max-height: none;
    height: auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px;
    margin: 16px 0;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    scroll-behavior: smooth;
}

.welcome-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    text-align: center;
}

.message {
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease-in;
}

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

.message.user {
    text-align: right;
}

.message.assistant {
    text-align: left;
}

.message-content {
    display: inline-block;
    max-width: 80%;
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.6;
    word-wrap: break-word;
}

.message.user .message-content {
    background: var(--secondary-color);
    color: white;
    border-radius: 12px 12px 0 12px;
}

.message.assistant .message-content {
    background: var(--light-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px 12px 12px 0;
}

.message.thinking .message-content {
    background: #fff3cd;
    color: #856404;
    font-style: italic;
    border: 1px solid #ffc107;
}

.message.error .message-content {
    background: #fee;
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

/* Results Table */
.results-table {
    width: 100%;
    margin-top: 15px;
    border-collapse: collapse;
    background: white;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

.results-table th {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
}

.results-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f3f4f6;
}

.results-table tbody tr {
    transition: all 0.15s ease;
    position: relative;
}

/* Hover effect removed per user request - jarring effect */
/*.results-table tbody tr:hover {
    background: rgba(102, 126, 234, 0.04);
}

.results-table tbody tr:hover::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--primary-color);
}*/

.results-table tr:last-child td {
    border-bottom: none;
}

/* Fintool-Inspired Table Styles */
.screening-table-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    margin: 16px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.screening-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.screening-table thead {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-bottom: 2px solid #e5e7eb;
}

.screening-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.screening-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: all 0.15s ease;
    position: relative;
}

/* Hover effect removed per user request - jarring effect */
/*.screening-table tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.04);
}

.screening-table tbody tr:hover::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--primary-color);
}*/

.screening-table tbody tr:last-child {
    border-bottom: none;
}

.screening-table td {
    padding: 14px 16px;
    color: #374151;
    vertical-align: top;
}

/* Ticker column - bold */
.screening-table td:first-child {
    font-weight: 600;
    color: #111827;
}

/* Number formatting */
.screening-table .number-positive {
    color: #059669;
    font-weight: 600;
}

.screening-table .number-negative {
    color: #dc2626;
    font-weight: 600;
}

.screening-table .number-neutral {
    color: #6b7280;
}

/* Expandable row details */
.row-details {
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.row-details td {
    padding: 16px;
    font-size: 0.875rem;
    color: #4b5563;
    line-height: 1.6;
}

.row-details-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: #9ca3af;
    margin-bottom: 4px;
}

.detail-value {
    font-size: 0.9rem;
    color: #111827;
    font-weight: 500;
}

/* Table action buttons (Copy, Export) */
.table-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding: 12px 16px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.table-action-btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.table-action-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.table-action-btn i {
    font-size: 0.875rem;
}

/* Toggle details button in table */
.toggle-details-btn {
    background: none;
    border: none;
    color: #6366f1;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-decoration-color: transparent;
    transition: all 0.15s;
}

.toggle-details-btn:hover {
    text-decoration-color: #6366f1;
}

/* Result count summary */
.result-summary {
    padding: 12px 16px;
    background: #eff6ff;
    border-left: 3px solid #3b82f6;
    border-radius: 6px;
    margin: 12px 0;
    font-size: 0.9rem;
    color: #1e40af;
}

.result-summary strong {
    font-weight: 600;
}

/* Input Container */
.input-container {
    background: white;
    padding: 18px 24px;
    margin: 16px 0;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.input-group {
    display: flex;
    gap: 10px;
}

#questionInput {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

#questionInput:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#submitBtn {
    padding: 14px 30px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

#submitBtn:hover:not(:disabled) {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#submitBtn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Footer */
.demo-footer {
    background: white;
    padding: 24px 30px;
    margin: 24px 0 20px;
    border-radius: 12px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    line-height: 1.6;
}

.demo-footer p {
    margin-bottom: 8px;
}

.demo-footer p:last-child {
    margin-bottom: 0;
}

.demo-footer a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
}

.demo-footer a:hover {
    text-decoration: underline;
}

.disclaimer {
    font-size: 0.85rem;
    color: #6b7280;
}

/* Error Message */
.error-message {
    background: #fee;
    color: var(--danger-color);
    padding: 12px;
    border-radius: 8px;
    margin: 10px 0;
    border: 1px solid var(--danger-color);
    animation: fadeIn 0.3s ease-in;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-container {
        padding: 0 18px;
    }

    .hero-section {
        padding: 24px 20px;
    }

    .hero-section h1 {
        font-size: 1.75rem;
    }

    .stats-container {
        gap: 20px;
        padding: 20px 16px;
    }

    .stats-container > div {
        min-width: 120px;
    }

    .stats-container strong {
        font-size: 1.5rem;
    }

    .stats-container span {
        font-size: 0.8rem;
    }

    .examples-section {
        padding: 18px 20px;
    }

    .example-chips {
        flex-direction: column;
    }

    .chip {
        width: 100%;
        text-align: center;
        padding: 12px 18px;
    }

    .chat-container {
        padding: 20px;
        min-height: 300px;
    }

    .message-content {
        max-width: 90%;
    }

    .input-group {
        flex-direction: column;
    }

    #submitBtn {
        width: 100%;
    }

    .results-table {
        font-size: 0.75rem;
    }

    .results-table th,
    .results-table td {
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .header-cta {
        padding: 8px 14px;
        font-size: 0.8rem;
    }

    .logo {
        font-size: 1.1rem;
    }

    .hero-section h1 {
        font-size: 1.5rem;
    }
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* Scrollbar Styling */
.chat-container::-webkit-scrollbar {
    width: 6px;
}

.chat-container::-webkit-scrollbar-track {
    background: transparent;
}

.chat-container::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Firefox */
.chat-container {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

/* Turnaround Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 12px;
    white-space: nowrap;
}

.badge-success {
    background-color: #10b981;
    color: white;
}

.badge-warning {
    background-color: #fbbf24;
    color: #78350f;
}
