@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@700&family=Orbitron:wght@400;700;900&family=JetBrains+Mono:wght@400;700&display=swap');

/* Base Styles & Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(13, 15, 27, 0.4);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #ef4444, #7c3aed);
    border-radius: 10px;
}

/* Floating Particles */
#particles {
    background: transparent;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.6), rgba(124, 58, 237, 0.1));
    pointer-events: none;
    animation: float linear infinite;
}

@keyframes float {
    0% {
        transform: translateY(105vh) rotate(0deg);
        opacity: 0;
    }
    10% { opacity: 0.8; }
    90% { opacity: 0.8; }
    100% {
        transform: translateY(-5vh) rotate(720deg);
        opacity: 0;
    }
}

/* Message In Animation */
@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-animate {
    animation: messageIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Typing Indicator Dots */
.typing-dots {
    display: inline-flex;
    gap: 5px;
    padding: 6px 10px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ef4444;
    animation: typingDot 1.4s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; background: #9333ea; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; background: #ef4444; }

@keyframes typingDot {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.3;
    }
    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* Markdown Rendering Engine Styling */
.markdown-body {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #cbd5e1;
}

.markdown-body p {
    margin-bottom: 0.75rem;
}

.markdown-body p:last-child {
    margin-bottom: 0;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3, 
.markdown-body h4, .markdown-body h5, .markdown-body h6 {
    font-family: 'Orbitron', sans-serif;
    color: #fca5a5;
    font-weight: 700;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.markdown-body h1 { font-size: 1.2rem; border-bottom: 1px solid rgba(239, 68, 68, 0.2); padding-bottom: 4px; }
.markdown-body h2 { font-size: 1.1rem; }
.markdown-body h3 { font-size: 1.0rem; }

.markdown-body ul, .markdown-body ol {
    margin-bottom: 0.75rem;
    padding-left: 1.25rem;
}

.markdown-body ul {
    list-style-type: square;
}

.markdown-body ol {
    list-style-type: decimal;
}

.markdown-body li {
    margin-bottom: 0.25rem;
}

.markdown-body strong {
    color: #ef4444;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

.markdown-body em {
    color: #c084fc;
    font-style: italic;
}

/* Code & Preformatted Text */
.markdown-body code:not(pre code) {
    background-color: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.8em;
}

.markdown-body pre {
    background-color: #0b0c16 !important;
    border: 1px solid rgba(124, 58, 237, 0.25) !important;
    border-radius: 12px !important;
    padding: 1rem !important;
    margin: 1rem 0 !important;
    overflow-x: auto;
    position: relative;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.8);
}

.markdown-body pre code {
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 0.8rem !important;
    line-height: 1.5 !important;
    background: transparent !important;
    padding: 0 !important;
    border: none !important;
}

.markdown-body blockquote {
    border-left: 3px solid #ef4444;
    background: rgba(239, 68, 68, 0.05);
    padding: 8px 12px;
    margin: 0.75rem 0;
    border-radius: 0 8px 8px 0;
}

.markdown-body table {
    width: 100%;
    margin-bottom: 1rem;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.markdown-body th, .markdown-body td {
    border: 1px solid rgba(139, 92, 246, 0.2);
    padding: 6px 10px;
    text-align: left;
}

.markdown-body th {
    background-color: rgba(124, 58, 237, 0.15);
    color: #c084fc;
}

.markdown-body tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Custom CSS Classes for the Copy Button Overlay */
.code-container {
    position: relative;
}

.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    transition: all 0.2s;
    z-index: 10;
}

.copy-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    color: #ffffff;
}