/* --- A. MAIN CONTENT TABLE STYLING --- */
/* These styles apply to tables rendered in the main content area. */

#content-blocks table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 1rem;
    border-spacing: 0;
}

/* Base border style for all cells (th and td) in the main content */
#content-blocks th,
#content-blocks td {
    border: 1px solid #ccc; /* Light gray border for light mode */
    padding: 8px;
    text-align: left;
    vertical-align: top; /* Align content to the top of the cell */
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

/* Header-specific styling for LIGHT MODE in the main content */
#content-blocks th {
    background-color: #e7e7e7;
    font-weight: bold;
}


/* --- A. AI CHAT TABLE STYLING --- */
/*
  This section applies Bootstrap's table styles to any `<table>` element
  generated by Markdown within the AI chat panel. This avoids needing a
  custom JavaScript renderer.
*/
#chat-history .bg-body-secondary table {
    display: block;
    width: 100%;
    overflow-x: auto;
    border-spacing: 0;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

#chat-history .bg-body-secondary th,
#chat-history .bg-body-secondary td {
    padding: 0.5rem 0.5rem;
    border: 1px solid var(--bs-border-color-translucent);
    vertical-align: top;
}

#chat-history .bg-body-secondary thead th {
    vertical-align: bottom;
    background-color: var(--bs-secondary-bg);
}

#chat-history .bg-body-secondary tbody tr:nth-of-type(odd) > * {
    --bs-table-accent-bg: var(--bs-table-striped-bg);
    color: var(--bs-table-striped-color);
}

[data-bs-theme="dark"] #chat-history .bg-body-secondary thead th {
    background-color: rgba(255, 255, 255, 0.05);
}

/* --- C. AI CHAT TYPING INDICATOR --- */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 0.5rem;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    margin: 0 2px;
    background-color: var(--bs-secondary-color);
    border-radius: 50%;
    display: inline-block;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    } 40% {
        transform: scale(1.0);
    }
}
