/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .5; transform: scale(0.8); }
}

.proc-spinner {
    animation: rotate 2s linear infinite;
    width: 14px;
    height: 14px;
}
.proc-spinner .path {
    stroke: currentColor;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}
@keyframes rotate { 100% { transform: rotate(360deg); } }
@keyframes dash {
    0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
    100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}

/* Markdown Rendering in Chat */
.msg-text h1, .msg-text h2, .msg-text h3 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: white;
}
.msg-text h1 { font-size: 1.5rem; }
.msg-text h2 { font-size: 1.25rem; }
.msg-text h3 { font-size: 1.1rem; }

.msg-text p {
    margin-bottom: 1rem;
    line-height: 1.65;
    font-size: 0.95rem;
    color: #d1d5db;
}
.msg-text p:last-child {
    margin-bottom: 0;
}

.msg-text ul, .msg-text ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}
.msg-text ul {
    list-style-type: disc;
}
.msg-text ol {
    list-style-type: decimal;
}
.msg-text li {
    margin-bottom: 0.5rem;
    display: list-item;
    line-height: 1.6;
}
.msg-text li::marker {
    color: #10a37f;
}

.msg-text code {
    background: rgba(255,255,255,0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
}

.msg-text pre {
    background: #0d0d0d !important;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1rem;
    border: 1px solid rgba(255,255,255,0.1);
}

.msg-text pre code {
    background: transparent;
    padding: 0;
    color: #e5e5e5;
}

.msg-text table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    overflow: hidden;
    font-size: 0.9rem;
}
.msg-text th, .msg-text td {
    border-bottom: 1px solid rgba(255,255,255,0.05);
    border-right: 1px solid rgba(255,255,255,0.05);
    padding: 0.85rem 1rem;
    text-align: left;
}
.msg-text th:last-child, .msg-text td:last-child {
    border-right: none;
}
.msg-text tr:last-child td {
    border-bottom: none;
}
.msg-text th {
    background: rgba(255,255,255,0.05);
    font-weight: 600;
    color: #f3f4f6;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}
.msg-text tr:nth-child(even) {
    background: rgba(255,255,255,0.02);
}
.msg-text tr:hover {
    background: rgba(16, 163, 127, 0.03);
}

.msg-text a {
    color: #10a37f;
    text-decoration: none;
}
.msg-text a:hover {
    text-decoration: underline;
}

/* AI Thinking Block */
.ai-thinking-block {
    background: rgba(0,0,0,0.2);
    border-left: 2px solid #f59e0b;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    border-radius: 0 4px 4px 0;
    font-size: 0.85rem;
    color: #9ca3af;
    display: none;
}
.ai-thinking-block.show {
    display: block;
}

.msg-meta-stamp {
    font-size: 0.7rem;
    color: #6b7280;
    margin-top: 0.25rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Advanced User Management */
.user-row-interact {
    cursor: pointer;
    transition: all 0.2s ease;
}
.user-row-interact:hover {
    background: rgba(16, 163, 127, 0.05) !important;
}
.user-row-interact:hover .user-name-text {
    color: #10a37f;
}

.detail-section {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 1.5rem;
    padding: 1.5rem;
}
.detail-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin-bottom: 0.5rem;
    display: block;
}
.detail-value {
    color: #e5e7eb;
    font-size: 0.9rem;
}
.stat-pill {
    background: rgba(16, 163, 127, 0.1);
    color: #10a37f;
    padding: 0.5rem 1rem;
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(16, 163, 127, 0.2);
}
/* Compact Processing Indicator */
.proc-indicator-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
    font-family: 'Inter', sans-serif;
    animation: fadeIn 0.3s ease;
}

.proc-badge {
    background: rgba(16, 163, 127, 0.1);
    color: #10a37f;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid rgba(16, 163, 127, 0.2);
    white-space: nowrap;
}

.proc-text-sm {
    color: #9ca3af;
    font-size: 0.73rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.proc-spinner-sm {
    width: 14px;
    height: 14px;
    animation: rotate 2s linear infinite;
}

.proc-spinner-sm .path {
    stroke: #10a37f;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

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