@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fadeIn { animation: fadeIn 0.3s ease-in-out; }
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}
#chat-box {
    background-attachment: fixed;
    overflow-x: hidden;
}
#main-chat {
    overflow-x: hidden;
}
.scrollbar-thin::-webkit-scrollbar { width: 6px; }
.scrollbar-thin::-webkit-scrollbar-thumb {
  background-color: rgba(168,85,247,0.4);
  border-radius: 10px;
}
.scrollbar-thin::-webkit-scrollbar-track { background: transparent; }
#voice-btn.recording {
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
#chat-box img {
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
    max-width: 100%;
    width: 100%;
    height: auto;
    border-radius: 18px;
    box-shadow: 0 15px 45px rgba(236, 72, 153, 0.25);
    margin: 1.5rem auto;
    display: block;
}
.group {
    transition: all 0.4s ease;
}
.group:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(168, 85, 247, 0.3) !important;
}

#three-d-container model-viewer {
    pointer-events: none;
}

#typing {
    display: flex;
    align-items: center;
    gap: 8px;
}
#typing::after {
    content: '';
    width: 8px; height: 8px;
    background: #a855f7;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}


.bot-markdown {
    font-size: 16px;
    line-height: 1.9;
    color: #f5f5f5;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.user-message {
    word-break: break-word;
    overflow-wrap: anywhere;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.user-message--file {
    max-height: none;
    overflow: visible;
    padding-right: 0;
}

.user-file-card {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    background: rgba(4, 7, 21, 0.92);
    border: 1px solid rgba(236, 72, 153, 0.45);
    box-shadow: 0 16px 35px rgba(5, 6, 15, 0.55);
    color: #f8fafc;
    max-width: 100%;
}

.user-file-card__icon {
    font-size: 1rem;
    flex: 0 0 auto;
}

.user-file-card__name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.user-file-card__action {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(248, 113, 113, 0.45);
    background: rgba(248, 113, 113, 0.12);
    color: #f9a8d4;
    transition: all 0.2s ease;
}

.user-file-card__action:hover {
    background: rgba(236, 72, 153, 0.35);
    color: #fff;
}

#attachment-pill-bar {
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
    min-height: 0;
    gap: 0.4rem;
}

.attachment-pill {
    background: rgba(255, 255, 255, 0.08);
    border: 0;
}

.user-message::-webkit-scrollbar {
    width: 4px;
}

.user-message::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.5);
    border-radius: 999px;
}

.bot-markdown p {
    margin: 0 0 1.2rem;
    color: #e2e8f0;
}
.bot-markdown ol {
    padding-left: 1.4rem;
    margin: 0 0 1rem;
    color: #e5e7eb;
}

.bot-markdown li {
    margin-bottom: 0.4rem;
}

.bot-markdown a {
    color: #c084fc;
    text-decoration: underline;
}

.bot-markdown pre {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.95));
    border: none;
    border-radius: 18px;
    padding: 1.4rem 1.6rem;
    overflow: auto;
    font-size: 14px;
    line-height: 1.7;
    box-shadow: 0 25px 60px rgba(8, 8, 20, 0.75);
}

.bot-markdown pre code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 15px;
    color: #e0e7ff;
}

.code-block-wrapper {
    position: relative;
    margin-top: 1.5rem;
}

.code-action-buttons button {
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.code-block-wrapper:hover .code-action-buttons button {
    opacity: 1;
    transform: translateY(0);
}

.code-file-label {
    font-family: 'Inter', sans-serif;
}

.bot-markdown hr {
    border: none;
    border-top: 1px solid rgba(148, 163, 184, 0.3);
    margin: 1.5rem 0;
}

.bot-markdown blockquote {
    border-left: 3px solid rgba(248, 113, 113, 0.6);
    padding-left: 1rem;
    color: #f8fafc;
    margin: 1rem 0;
}

.bot-markdown table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.6);
    overflow: hidden;
    box-shadow: 0 25px 70px rgba(15, 23, 42, 0.45);
}

.bot-markdown table caption {
    padding: 0.85rem 1rem;
    font-weight: 600;
    color: #cbd5f5;
    text-align: left;
    background: rgba(139, 92, 246, 0.18);
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.bot-markdown th,
.bot-markdown td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    text-align: left;
}

.bot-markdown thead th {
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #f8fafc;
    background: rgba(76, 29, 149, 0.55);
}

.bot-markdown tbody tr:nth-child(even) {
    background: rgba(15, 23, 42, 0.55);
}

.bot-markdown tbody tr:hover {
    background: rgba(124, 58, 237, 0.18);
}

.bot-markdown .code-block {
    background: transparent;
    box-shadow: none;
    border: none;
}

.code-action-buttons button,
.code-copy-btn,
.code-download-btn {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(139, 92, 246, 0.4);
    color: #f8fafc;
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    font-size: 0.75rem;
    text-transform: none;
    letter-spacing: 0.02em;
}

.code-action-buttons button:hover,
.code-copy-btn:hover,
.code-download-btn:hover {
    background: rgba(124, 58, 237, 0.9);
    border-color: rgba(248, 113, 113, 0.6);
    color: #fff;
}

[data-copy-btn] {
    backdrop-filter: blur(6px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.bot-markdown .inline-file-card {
    margin-top: 1.25rem;
    padding: 0.9rem 1.1rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.7);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: #e5e7eb;
}

.bot-markdown .inline-file-card i {
    color: #a855f7;
    font-size: 1.25rem;
}

.bot-markdown .inline-file-card button {
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    background: linear-gradient(120deg, rgba(236, 72, 153, 0.9), rgba(99, 102, 241, 0.85));
    border: none;
    color: #fff;
    font-weight: 500;
    box-shadow: 0 12px 35px rgba(236, 72, 153, 0.35);
}

