/* Features: Specific Page Styles */

/* --- DASHBOARD GRID --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(140px, auto);
    gap: 1.5rem;
    padding-bottom: 2rem;
}

.dashboard-grid .card {
    margin-bottom: 0;
    height: 100%;
}

.briefing-area {
    grid-column: span 2;
    grid-row: span 2;
}

.kpi-card {
    grid-column: span 1;
}

.urgent-list {
    grid-column: span 2;
    grid-row: span 2;
}

.recent-list {
    grid-column: span 4;
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .briefing-area,
    .urgent-list,
    .recent-list,
    .kpi-card {
        grid-column: span 1;
        grid-row: auto;
    }
}

/* --- CHAT INTERFACE --- */
.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.message {
    display: flex;
    gap: 1rem;
    max-width: 80%;
    animation: fadeIn 0.3s ease-in-out;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message.assistant {
    align-self: flex-start;
}

.message .avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.message.assistant .avatar {
    background: var(--color-primary-subtle);
    color: var(--color-primary);
}

.message.user .avatar {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.message .content {
    padding: 1rem 1.25rem;
    border-radius: 1.25rem;
    font-size: 0.9375rem;
    line-height: 1.6;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: relative;
    color: var(--text-primary);
}

.message.user .content {
    background: var(--color-primary);
    color: var(--text-inverse);
    border-color: transparent;
    border-bottom-right-radius: 0.25rem;
}

.message.assistant .content {
    background: var(--bg-primary);
    border-bottom-left-radius: 0.25rem;
}

/* Remove default paragraph margin from the last element to avoid double spacing */
.message .content p:last-child,
.message .content>div>p:last-child {
    margin-bottom: 0 !important;
}

/* Suggested Questions Pills */
.message button.btn-sm {
    border-radius: 2rem;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    transition: all 0.2s;
    background: white;
    border: 1px solid var(--color-primary-subtle) !important;
    color: var(--color-primary);
}

.message button.btn-sm:hover {
    background: var(--color-primary-subtle) !important;
    transform: translateY(-1px);
}

/* Loading Indicator Style */
.message.loading-indicator .content {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9em;
    font-style: italic;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    /* Slightly different bg */
    border: 1px dashed var(--border-color);
    /* Dashed border to indicate temporary state */
}

.typing-dots {
    display: inline-block;
    color: var(--color-primary);
    font-weight: 500;
}

/* --- THINKING & DEBUG BLOCKS --- */

/* 1. Thinking Process (Business Focused) */
.thinking-block {
    margin-top: 1rem;
    margin-bottom: 0;
    /* Handled by parent gap */
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid rgba(220, 150, 20, 0.2);
    background: rgba(255, 248, 220, 0.5);
    /* AntiqueWhite with opacity */
}

.thinking-block summary {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    color: #b07d10;
    /* Darker amber */
    display: flex;
    align-items: center;
    gap: 0.5rem;
    user-select: none;
    transition: background 0.2s;
}

.thinking-block summary:hover {
    background: rgba(220, 150, 20, 0.1);
}

.thinking-block[open] summary {
    border-bottom: 1px solid rgba(220, 150, 20, 0.1);
}

.thinking-block .thinking-content {
    padding: 1rem;
    font-size: 0.95em;
    line-height: 1.6;
    color: #856404;
    white-space: pre-wrap;
    font-style: italic;
    background: white;
}

/* 2. Debug/Technical Info (Dev Focused) - DRACULA THEME */
.debug-block {
    margin-top: 0;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid #44475a;
    background: #282a36;
    /* Dracula Background */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.debug-block summary {
    padding: 0.6rem 1rem;
    cursor: pointer;
    font-size: 0.85em;
    /* Increased size */
    font-family: 'Fira Code', 'Cascadia Code', Consolas, monospace;
    color: #f8f8f2;
    /* Dracula Foreground */
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #44475a;
    /* Dracula Current Line */
    font-weight: 600;
}

.debug-block summary:hover {
    background: #6272a4;
    /* Dracula Comment */
}

.debug-block .debug-content {
    padding: 1rem;
    color: #f8f8f2;
    font-size: 0.9em;
    /* Logic text larger */
    font-family: 'Fira Code', 'Cascadia Code', Consolas, monospace;
    line-height: 1.5;
}

/* JSON Dump Styling */
.debug-json {
    background: #1e1f29;
    /* Slightly darker than bg */
    padding: 1rem;
    border-radius: 0.35rem;
    overflow-x: auto;
    color: #8be9fd;
    /* Dracula Cyan */
    border: 1px solid #44475a;
    margin-top: 0.5rem;
    font-size: 0.85em;
    /* Json text slightly smaller but clear */
}

/* Tool Badges in Debug */
.debug-tool-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25em 0.6em;
    font-size: 0.8em;
    font-weight: 700;
    line-height: 1;
    color: #282a36;
    /* Text dark for contrast */
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
    background-color: #bd93f9;
    /* Dracula Purple */
    margin-right: 0.5em;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

.debug-tool-badge.bg-primary {
    background-color: #ff79c6 !important;
    /* Dracula Pink */
    color: #282a36;
}

/* 3. Debug Text Overrides (Fix Bootstrap conflicts) */
.debug-block .text-muted {
    color: #bd93f9 !important;
    /* Dracula Purple (readable) instead of gray */
    opacity: 0.9;
}

.debug-block strong {
    color: #50fa7b !important;
    /* Dracula Green */
}

.debug-block .text-dark {
    color: #f8f8f2 !important;
    /* Force white text */
}

.debug-block .text-info {
    color: #8be9fd !important;
    /* Dracula Cyan */
}