/* 
 * Analytics Hub - Custom Styles
 * Estilos específicos e extensões do tema shadcn/ui
 */

/* 
 * Este arquivo contém apenas estilos específicos que não podem ser 
 * facilmente representados por componentes shadcn/ui ou classes Tailwind.
 * A maioria dos estilos agora está em tailwind.input.css usando @layer components.
 */

/* ==============================================
   MARKDOWN FORMATTING IN CHAT MESSAGES
   ============================================== */

/* Headers */
.chat-message-content h1,
.chat-message-content h2,
.chat-message-content h3 {
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.chat-message-content h1:first-child,
.chat-message-content h2:first-child,
.chat-message-content h3:first-child {
    margin-top: 0;
}

.chat-message-content h1 {
    font-size: 1.125rem;
}

.chat-message-content h2 {
    font-size: 1rem;
}

.chat-message-content h3 {
    font-size: 0.9375rem;
}

/* Paragraphs */
.chat-message-content p {
    margin: 0.5rem 0;
    line-height: 1.6;
}

.chat-message-content p:first-child {
    margin-top: 0;
}

.chat-message-content p:last-child {
    margin-bottom: 0;
}

/* Lists */
.chat-message-content ul,
.chat-message-content ol {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
    line-height: 1.6;
}

.chat-message-content ul {
    list-style-type: disc;
}

.chat-message-content ol {
    list-style-type: decimal;
}

.chat-message-content li {
    margin: 0.375rem 0;
    line-height: 1.6;
}

.chat-message-content li > p {
    margin: 0.25rem 0;
}

/* Code */
.chat-message-content code {
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.8125rem;
}

/* Code inline in user message (blue bubble) */
.chat-message-user .chat-message-content code {
    background-color: rgba(0, 0, 0, 0.15);
    color: hsl(222, 47%, 11%);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Code inline in bot message (dark bubble) */
.chat-message-bot .chat-message-content code {
    background-color: hsl(220, 14%, 25%);
    color: hsl(189, 83%, 60%);
    border: 1px solid hsl(215, 20%, 35%);
}

/* ============================================== 
   LIGHT MODE VARIANTS FOR CHAT
   ============================================== */

/* Light mode - User message (blue bubble) */
.light .chat-message-user .chat-message-content {
    background-color: hsl(221, 83%, 53%) !important;
    color: hsl(0, 0%, 100%) !important;
}

/* Light mode - Bot message (light bubble) */
.light .chat-message-bot .chat-message-content {
    background-color: hsl(0, 0%, 95%) !important;
    border: 2px solid hsl(215, 20%, 75%) !important;
    color: hsl(224, 44%, 14%) !important;
}

/* Light mode - Code inline */
.light .chat-message-content code {
    background-color: hsl(215, 20%, 88%);
    color: hsl(221, 83%, 53%);
    border: 1px solid hsl(215, 20%, 80%);
}

/* Light mode - Code blocks */
.light .chat-message-content pre {
    background-color: hsl(215, 20%, 92%);
    border: 1px solid hsl(215, 20%, 80%);
}

.light .chat-message-content pre code {
    color: hsl(224, 44%, 14%);
}

/* Light mode - Links */
.light .chat-message-content a {
    color: hsl(221, 83%, 53%);
}

.light .chat-message-content a:hover {
    color: hsl(221, 83%, 43%);
}

/* Light mode - Blockquotes */
.light .chat-message-content blockquote {
    border-left-color: hsl(221, 83%, 53%);
    background-color: hsl(221, 83%, 96%);
}

/* Light mode - Tables */
.light .chat-message-content table th,
.light .chat-message-content table td {
    border-color: hsl(215, 20%, 80%);
}

.light .chat-message-content table th {
    background-color: hsl(215, 20%, 92%);
}

.light .chat-message-content table td {
    background-color: hsl(0, 0%, 98%);
}

/* Light mode - Horizontal rule */
.light .chat-message-content hr {
    border-top-color: hsl(215, 20%, 80%);
}

/* Code blocks */
.chat-message-content pre {
    margin: 0.75rem 0;
    padding: 0.875rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    background-color: hsl(220, 14%, 20%);
    border: 1px solid hsl(215, 20%, 30%);
}

.chat-message-content pre code {
    padding: 0;
    border: none;
    background-color: transparent;
    color: hsl(213, 31%, 91%);
    font-size: 0.8125rem;
    line-height: 1.5;
}

/* Blockquotes */
.chat-message-content blockquote {
    margin: 0.75rem 0;
    padding: 0.5rem 0 0.5rem 1rem;
    border-left: 3px solid hsl(210, 100%, 66%);
    background-color: rgba(16, 52, 242, 0.05);
    font-style: italic;
}

/* Tables */
.chat-message-content table {
    margin: 0.75rem 0;
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.chat-message-content table th,
.chat-message-content table td {
    padding: 0.5rem 0.75rem;
    border: 1px solid hsl(215, 20%, 30%);
    text-align: left;
}

.chat-message-content table th {
    background-color: hsl(222, 47%, 20%);
    font-weight: 600;
}

.chat-message-content table td {
    background-color: hsl(224, 44%, 16%);
}

/* Links */
.chat-message-content a {
    color: hsl(189, 83%, 60%);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s;
}

.chat-message-content a:hover {
    color: hsl(189, 83%, 70%);
}

/* Strong/Bold */
.chat-message-content strong {
    font-weight: 600;
}

/* Emphasis/Italic */
.chat-message-content em {
    font-style: italic;
}

/* Horizontal rule */
.chat-message-content hr {
    margin: 1rem 0;
    border: none;
    border-top: 1px solid hsl(215, 20%, 30%);
}


/* ==============================================
   ADMIN PANEL - Status específicos
   ============================================== */

/* Status badges - estende .badge do shadcn */
.status-badge {
    @apply badge badge-default;
}

.status-healthy {
    @apply badge-success;
}

.status-warning {
    @apply badge-warning;
}

.status-error {
    @apply bg-red-500/10 text-red-500 border-red-500/20;
}

/* Metrics display */
.metric-item {
    @apply rounded-lg border bg-card p-4;
}

.metric-label {
    @apply text-sm font-medium text-muted-foreground mb-1;
}

.metric-value {
    @apply text-2xl font-bold text-foreground;
}

/* KB Admin status */
.kb-admin__status {
    @apply text-muted-foreground empty:hidden;
}

.kb-admin__status:not(:empty) {
    @apply rounded-md bg-muted p-2;
}

