.judge0-file-menu {
    min-width: 15rem !important;
}

#judge0-chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0;
}

#judge0-chat-container > .ui.menu {
    border-bottom: none;
    margin: 0;
    border-radius: 0;
}

#judge0-chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 8px 12px;
    scroll-behavior: smooth;
}

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

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

#judge0-chat-messages::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 3px;
}

#judge0-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

#judge0-chat-messages {
    scrollbar-width: thin;
    scrollbar-color: #c0c0c0 transparent;
}

#judge0-chat-messages pre {
    overflow-x: auto;
    border-radius: 4px;
}

#judge0-chat-messages pre code {
    white-space: pre-wrap;
    word-break: break-word;
}

#judge0-chat-input-container {
    margin-top: 0;
    padding: 8px 12px 12px 12px;
    border-top: 1px solid #e0e0e0;
}

#judge0-chat-input-container .ui.action.input {
    width: 100%;
}

#judge0-chat-user-input {
    border-radius: 20px 0 0 20px !important;
}

#judge0-chat-send-button {
    border-radius: 0 20px 20px 0 !important;
}

#judge0-status-line:empty {
    display: none;
}

.judge0-hidden,
.judge0-style-hidden {
    display: none !important;
}

@media (display-mode: standalone) {
    .judge0-standalone-hidden {
        display: none !important;
    }
}

.judge0-user-message {
    background-color: #2185d0;
    border-radius: 12px 12px 2px 12px;
    color: #ffffff;
    margin: 0.5em 0 0.5em auto !important;
    max-width: 70%;
    overflow-wrap: break-word;
    padding: 0.75em 1.2em;
    width: fit-content;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.judge0-user-message p {
    margin: 0;
}

.judge0-chat-assistant {
    background-color: #ffffff;
    border: 1px solid #d4d4d5;
    border-radius: 12px 12px 12px 2px;
    color: #1b1c1d;
    margin: 0.5em 0 0.5em 0 !important;
    max-width: 80%;
    overflow-wrap: break-word;
    padding: 0.75em 1.2em;
    width: fit-content;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.judge0-chat-assistant p {
    margin: 0 0 0.75em 0;
}

.judge0-chat-assistant p:last-child {
    margin-bottom: 0;
}

.judge0-chat-assistant pre {
    background-color: #1b1c1d;
    border-radius: 4px;
    color: #ffffff;
    margin: 0.75em 0;
    overflow-x: auto;
    padding: 1em;
}

.judge0-chat-assistant code {
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
    font-family: "JetBrains Mono", monospace;
    padding: 0.2em 0.4em;
    font-size: 0.9em;
}

.judge0-chat-assistant pre code {
    background-color: transparent;
    padding: 0;
    font-size: 0.9em;
}

.judge0-chat-assistant ul,
.judge0-chat-assistant ol {
    margin: 0.5em 0;
    padding-left: 1.5em;
}

.judge0-chat-assistant li {
    margin: 0.25em 0;
}

.judge0-chat-assistant blockquote {
    border-left: 3px solid #2185d0;
    margin: 0.5em 0;
    padding-left: 1em;
    color: #555;
}

.judge0-chat-assistant table {
    border-collapse: collapse;
    margin: 0.5em 0;
    width: 100%;
}

.judge0-chat-assistant th,
.judge0-chat-assistant td {
    border: 1px solid #ddd;
    padding: 6px 12px;
    text-align: left;
}

.judge0-chat-assistant th {
    background-color: #f5f5f5;
    font-weight: 600;
}

.judge0-chat-typing {
    background-color: #ffffff;
    border: 1px solid #d4d4d5;
    border-radius: 12px 12px 12px 2px;
    color: #1b1c1d;
    margin: 0.5em 0 0.5em 0 !important;
    padding: 0.75em 1.2em;
    width: fit-content;
    display: flex;
    gap: 4px;
    align-items: center;
}

.judge0-chat-typing span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite both;
}

.judge0-chat-typing span:nth-child(1) {
    animation-delay: 0s;
}
.judge0-chat-typing span:nth-child(2) {
    animation-delay: 0.2s;
}
.judge0-chat-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

body.judge0-dark-mode #judge0-chat-input-container {
    border-top-color: #4a4b4c;
}

body.judge0-dark-mode #judge0-chat-messages::-webkit-scrollbar-thumb {
    background: #4a4b4c;
}

body.judge0-dark-mode #judge0-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #5a5b5c;
}

body.judge0-dark-mode #judge0-chat-messages {
    scrollbar-color: #4a4b4c transparent;
}

body.judge0-dark-mode .judge0-user-message {
    background-color: #1678c2;
    color: #ffffff;
}

body.judge0-dark-mode .judge0-chat-assistant {
    background-color: #2b2c2d;
    border: 1px solid #4a4b4c;
    color: #e0e0e0;
}

body.judge0-dark-mode .judge0-chat-assistant pre {
    background-color: #121314;
    border: 1px solid #3a3b3c;
    color: #e0e0e0;
}

body.judge0-dark-mode .judge0-chat-assistant code {
    background-color: rgba(255, 255, 255, 0.08);
    color: #e0e0e0;
}

body.judge0-dark-mode .judge0-chat-assistant pre code {
    background-color: transparent;
}

body.judge0-dark-mode .judge0-chat-assistant blockquote {
    border-left-color: #1678c2;
    color: #aaa;
}

body.judge0-dark-mode .judge0-chat-assistant th,
body.judge0-dark-mode .judge0-chat-assistant td {
    border-color: #4a4b4c;
}

body.judge0-dark-mode .judge0-chat-assistant th {
    background-color: #1b1c1d;
}

body.judge0-dark-mode .judge0-chat-typing {
    background-color: #2b2c2d;
    border-color: #4a4b4c;
    color: #e0e0e0;
}

body.judge0-dark-mode .judge0-chat-typing span {
    background: #aaa;
}
