/* mcp_framework/dashboard/style.css */
:root {
    --bg-dark: #070a13;
    --card-bg: rgba(13, 20, 38, 0.45);
    --border-color: rgba(59, 130, 246, 0.2);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    
    /* Cores de status */
    --clr-pending: #475569;
    --clr-active: #3b82f6;
    --clr-success: #10b981;
    --clr-failed: #ef4444;
    --clr-idle: #e2e8f0;
    
    /* Brilhos */
    --glow-active: 0 0 15px rgba(59, 130, 246, 0.6);
    --glow-success: 0 0 15px rgba(16, 185, 129, 0.6);
    --glow-failed: 0 0 15px rgba(239, 68, 68, 0.6);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Fundo Futurista Gradiente */
.glass-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.08) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.06) 0%, transparent 45%);
    z-index: -1;
}

.app-container {
    width: 95vw;
    max-width: 1600px;
    height: 90vh;
    background: rgba(10, 15, 30, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    padding: 24px;
    gap: 20px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 16px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-area h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 2px;
}

.accent {
    color: var(--clr-active);
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

.pulse-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.status-idle { background-color: var(--clr-idle); box-shadow: 0 0 8px var(--clr-idle); }
.status-active { background-color: var(--clr-active); animation: pulse 1.5s infinite; }
.status-success { background-color: var(--clr-success); box-shadow: 0 0 10px var(--clr-success); }
.status-failed { background-color: var(--clr-failed); animation: pulse-error 1s infinite; }

.system-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

.status-label {
    color: var(--text-secondary);
}

.status-value {
    letter-spacing: 1px;
}

.text-idle { color: #f1f5f9; }
.text-active { color: #60a5fa; text-shadow: 0 0 8px rgba(59, 130, 246, 0.5); }
.text-success { color: #34d399; text-shadow: 0 0 8px rgba(16, 185, 129, 0.5); }
.text-failed { color: #f87171; text-shadow: 0 0 8px rgba(239, 68, 68, 0.5); }

/* Main Content Layout */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    flex: 1;
    min-height: 0; /* Permite scroll interno */
}

/* Coluna de Fluxograma */
.visual-pipeline {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    justify-content: center;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 1.15rem;
    font-weight: 600;
}

.progress-pct {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--clr-active);
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--clr-active), var(--clr-success));
    border-radius: 10px;
    transition: width 0.5s ease-in-out;
}

/* Nós do Fluxo (Vertical Layout) */
.nodes-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    justify-content: space-around;
}

.node-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
}

.node {
    display: grid;
    grid-template-columns: 50px 1fr;
    grid-template-rows: auto auto;
    align-items: start;
    padding: 15px 20px;
    border-radius: 14px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.node-icon {
    grid-row: 1 / 3;
    font-size: 1.5rem;
    padding-top: 5px;
}

.node-header {
    display: flex;
    flex-direction: column;
}

.node h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 2px 0;
}

.node-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

.node-details {
    grid-column: 2;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.fixed-detail {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.4;
    margin: 0 0 8px 0;
}

.fixed-detail strong {
    color: rgba(255, 255, 255, 0.8);
}

.live-status {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--clr-active);
    background: rgba(59, 130, 246, 0.1);
    padding: 6px 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    border-left: 3px solid var(--clr-active);
    display: none;
    animation: pulse-text 2s infinite ease-in-out;
}

.btn-view-agent {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-view-agent:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

@keyframes pulse-text {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

.highlight-terminal {
    animation: flash-border 1.5s ease;
}

@keyframes flash-border {
    0% { box-shadow: 0 0 20px var(--clr-active); border-color: var(--clr-active); }
    100% { box-shadow: none; border-color: rgba(255, 255, 255, 0.05); }
}

.node-icon {
    font-size: 1.2rem;
}

/* Conectores */
.node-connector {
    width: 2px;
    height: 15px;
    background: var(--clr-pending);
    margin-left: 44px;
    transition: background 0.3s ease;
}

/* Estados dos Nós */
.state-pending {
    background: rgba(255, 255, 255, 0.02);
    color: rgba(255, 255, 255, 0.3);
}

.state-active {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--clr-active);
    color: var(--text-primary);
    box-shadow: var(--glow-active);
    animation: pulse-node 2s infinite ease-in-out;
}

.state-success {
    background: rgba(16, 185, 129, 0.08);
    border-color: var(--clr-success);
    color: var(--text-primary);
    box-shadow: 0 0 5px rgba(16, 185, 129, 0.2);
}

.state-failed {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--clr-failed);
    color: var(--text-primary);
    box-shadow: var(--glow-failed);
}

.conn-active {
    background: var(--clr-active);
    box-shadow: 0 0 8px var(--clr-active);
}

.conn-success {
    background: var(--clr-success);
}

/* Coluna de Logs */
.logs-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 0;
}

.info-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px 20px;
}

.info-card h3 {
    font-size: 0.8rem;
    color: var(--clr-active);
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.info-content {
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.4;
}

/* Terminal de Logs */
.terminal-card {
    background: rgba(5, 7, 15, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

.terminal-header {
    background: rgba(13, 20, 38, 0.8);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    display: inline-block;
}

.terminal-dot.red { background: #ff5f56; }
.terminal-dot.yellow { background: #ffbd2e; }
.terminal-dot.green { background: #27c93f; }

.terminal-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-left: 12px;
    flex-weight: 600;
}

.clear-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    margin-left: auto;
    transition: all 0.2s;
}

.clear-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.terminal-body {
    flex: 1;
    padding: 16px 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    line-height: 1.5;
    overflow-y: auto;
    color: #e2e8f0;
}

.log-line {
    margin-bottom: 6px;
    white-space: pre-wrap;
    word-break: break-all;
}

.log-success { color: #10b981; }
.log-info { color: #3b82f6; }
.log-warning { color: #f59e0b; }
.log-error { color: #ef4444; }
.text-muted { color: #64748b; }

/* Animações */
@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

@keyframes pulse-error {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@keyframes pulse-node {
    0%, 100% { border-color: rgba(59, 130, 246, 0.2); }
    50% { border-color: rgba(59, 130, 246, 0.8); }
}
/* Sidebar Multi-Projetos */
body { display: flex; }
.sidebar {
    width: 250px;
    background: rgba(10, 15, 30, 0.7);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    height: 100vh;
    backdrop-filter: blur(20px);
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    z-index: 10;
}
.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.sidebar-header h2 {
    font-size: 1.2rem;
    color: var(--text-muted);
    letter-spacing: 2px;
}
.project-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
}
.project-item {
    padding: 15px 20px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    transition: all 0.3s ease;
    font-weight: 600;
}
.project-item:hover {
    background: rgba(255, 255, 255, 0.05);
}
.project-item.active {
    background: rgba(59, 130, 246, 0.1);
    border-left: 4px solid var(--accent);
    color: var(--accent);
}
.app-container.with-sidebar {
    flex: 1;
    max-width: calc(100% - 250px);
    margin: 0;
    padding: 30px;
    height: 100vh;
    overflow-y: auto;
}

/* Estilos do Acionamento Direto (Trigger) */
.trigger-card {
    background: rgba(59, 130, 246, 0.05) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    margin-top: 15px;
}

.trigger-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

#prompt-input {
    background: rgba(5, 7, 15, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-primary);
    padding: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    resize: none;
    outline: none;
    transition: border-color 0.3s;
}

#prompt-input:focus {
    border-color: var(--clr-active);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.trigger-btn {
    background: linear-gradient(90deg, var(--clr-active), #2563eb);
    color: var(--text-primary);
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--glow-active);
    letter-spacing: 1px;
    text-align: center;
}

.trigger-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.8);
}

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

.trigger-btn:disabled {
    background: #475569;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Estilização de Abas (Tabs) */
.tabs-header {
    display: flex;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 12px;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: rgba(59, 130, 246, 0.3);
}

.tab-btn.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--text-primary);
    border-color: var(--clr-active);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
    text-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

.tab-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.tab-content {
    display: none;
    flex-direction: column;
    gap: 20px;
    flex: 1;
}

.tab-content.active {
    display: flex;
}

/* Painel de Chat Premium */
.chat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: calc(100vh - 180px);
    min-height: 500px;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.3);
}

.chat-header h2 {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.chat-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    background: rgba(5, 7, 15, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: inset 0 4px 20px rgba(0, 0, 0, 0.6);
}

.chat-message {
    padding: 12px 18px;
    border-radius: 16px;
    max-width: 85%;
    line-height: 1.5;
    font-size: 0.9rem;
    word-break: break-word;
    animation: slideUp 0.3s ease;
}

.chat-message p {
    margin-bottom: 8px;
}
.chat-message p:last-child {
    margin-bottom: 0;
}

.chat-message.bot {
    background: rgba(13, 20, 38, 0.7);
    border: 1px solid rgba(139, 92, 246, 0.25); /* Roxo neon */
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.chat-message.user {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3); /* Azul/Ciano */
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.sender-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.chat-message.bot .sender-label {
    color: #a78bfa; /* Lilás */
}

.chat-message.user .sender-label {
    color: #60a5fa; /* Azul claro */
}

.message-text {
    font-family: inherit;
    white-space: pre-wrap;
}

.message-text code {
    font-family: 'JetBrains Mono', monospace;
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #f43f5e; /* Coral rosa para código inline */
}

.message-text pre {
    background: rgba(5, 5, 8, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 14px;
    margin: 10px 0;
    overflow-x: auto;
}

.message-text pre code {
    background: transparent;
    padding: 0;
    color: #e2e8f0;
    font-size: 0.8rem;
}

.chat-input-area {
    display: flex;
    gap: 12px;
}

#chat-input {
    flex: 1;
    background: rgba(5, 7, 15, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-primary);
    padding: 14px 20px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s;
}

#chat-input:focus:not(:disabled) {
    border-color: var(--clr-active);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
}

#chat-input:disabled {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.05);
    cursor: not-allowed;
    opacity: 0.5;
}

.chat-send-btn {
    background: linear-gradient(90deg, #10b981, #059669); /* Esmeralda */
    color: var(--text-primary);
    border: none;
    border-radius: 12px;
    padding: 0 24px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
    letter-spacing: 1px;
    text-align: center;
}

.chat-send-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.7);
}

.chat-send-btn:active:not(:disabled) {
    transform: translateY(0);
}

.chat-send-btn:disabled {
    background: #475569;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.5;
    transform: none;
}

/* Animações e Efeitos */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

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

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* --- HISTÓRICO DE EXECUÇÕES DA ESTEIRA --- */
.history-card {
    border-color: rgba(59, 130, 246, 0.25) !important;
    background: rgba(13, 20, 38, 0.3) !important;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 170px;
    overflow-y: auto;
    padding-right: 6px;
    margin-top: 6px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    font-size: 0.85rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.history-item:hover {
    background: rgba(59, 130, 246, 0.05);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateX(2px);
}

.history-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0; /* Permite truncar o texto do prompt */
}

.history-prompt {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 12px;
}

.history-time {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.history-status-badge {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
}

.badge-failed {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.2);
}

.badge-running {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.2);
    animation: badge-pulse 1.5s infinite ease-in-out;
}

.badge-aborted {
    background: rgba(100, 116, 139, 0.1);
    color: #94a3b8;
    border: 1px solid rgba(100, 116, 139, 0.2);
}

@keyframes badge-pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; box-shadow: 0 0 12px rgba(59, 130, 246, 0.4); }
}

.history-list::-webkit-scrollbar {
    width: 4px;
}
.history-list::-webkit-scrollbar-track {
    background: transparent;
}
.history-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}
.history-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Botão de Disparo Rápido de Esteira no Chat */
.chat-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    background: linear-gradient(90deg, #3b82f6, #10b981); /* Gradiente azul para esmeralda */
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 10px 18px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-trigger-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
    background: linear-gradient(90deg, #2563eb, #059669);
}

.chat-trigger-btn:active {
    transform: translateY(0);
}

/* --- PREMIUM STYLING FOR CHAT UPGRADE --- */

/* Code block wrapper & header */
.code-block-wrapper {
    margin: 16px 0;
    background: rgba(5, 7, 15, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: all 0.3s;
}
.code-block-wrapper:hover {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
}

.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: rgba(13, 20, 38, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.code-lang {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    color: #3b82f6;
    letter-spacing: 1px;
}

.copy-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #94a3b8;
    font-family: 'Outfit', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.copy-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
}
.copy-btn.copied {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.3);
}

/* Collapsible thinking block (accordion) */
.thinking-details {
    margin: 12px 0 16px 0;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 12px;
    padding: 12px 16px;
    transition: all 0.3s ease;
}
.thinking-details[open] {
    background: rgba(15, 23, 42, 0.75);
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.1);
}

.thinking-details summary {
    font-size: 0.82rem;
    font-weight: 600;
    color: #a78bfa;
    cursor: pointer;
    outline: none;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.thinking-details summary::-webkit-details-marker {
    display: none;
}
.thinking-details summary::before {
    content: "▶";
    font-size: 0.65rem;
    transition: transform 0.2s ease;
    display: inline-block;
    color: #8b5cf6;
}
.thinking-details[open] summary::before {
    transform: rotate(90deg);
}

.thinking-text {
    margin-top: 12px;
    font-size: 0.82rem;
    line-height: 1.6;
    color: #94a3b8;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 10px;
    font-style: italic;
}

/* Chat tool steps (badges of execution) */
.chat-tool-steps {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 10px 0 14px 0;
}

.chat-tool-step {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 8px;
    font-size: 0.8rem;
    color: #cbd5e1;
    font-weight: 500;
}
.chat-tool-step code {
    font-family: 'JetBrains Mono', monospace;
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.75rem;
}
.chat-tool-step.error {
    border-color: rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.05);
}
.chat-tool-step.error code {
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
}

.step-icon {
    font-size: 0.9rem;
}

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #10b981;
    border-radius: 50%;
    animation: spin 1s infinite linear;
    vertical-align: middle;
    margin-right: 8px;
}

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