/* Forum Bot Styles with Python Server Integration */
.forum-bot-container {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    margin: 15px 0;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    font-family: inherit;
}

.forum-bot-header {
    background-color: #f5f5f5;
    padding: 10px 15px;
    border-bottom: 1px solid #e0e0e0;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.forum-bot-header i {
    margin-right: 8px;
    color: #2196F3;
}

/* Bot type toggle styles */
.bot-type-toggle {
    display: flex;
    border-radius: 15px;
    overflow: hidden;
    background-color: #e0e0e0;
    margin-left: auto;
    border: 1px solid #ccc;
}

.toggle-label {
    padding: 3px 8px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    margin: 0;
    transition: background-color 0.2s;
}

.toggle-label input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.toggle-label input:checked + span {
    color: #fff;
    font-weight: bold;
}

.toggle-label:first-child input:checked + span {
    background-color: #4CAF50; /* Chat - Green */
}

.toggle-label:nth-child(2) input:checked + span {
    background-color: #2196F3; /* Auto - Blue */
}

.toggle-label:last-child input:checked + span {
    background-color: #FF9800; /* Code - Orange */
}

.toggle-label span {
    padding: 3px 8px;
    border-radius: 12px;
}

/* Bot status styles */
.bot-status {
    margin-left: 10px;
    font-size: 12px;
    color: #666;
}

/* Forum bot messages container */
.forum-bot-messages {
    height: 250px;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bot-message, .user-message {
    display: flex;
    max-width: 80%;
}

.user-message {
    margin-left: auto;
    flex-direction: row-reverse;
}

.bot-avatar {
    width: 36px;
    height: 36px;
    background-color: #2196F3;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-right: 8px;
}

.user-message .bot-avatar {
    margin-right: 0;
    margin-left: 8px;
}

.message-content {
    background-color: #f1f1f1;
    padding: 10px 15px;
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    line-height: 1.4;
}

.user-message .message-content {
    background-color: #e3f2fd;
}

/* System messages */
.system-message {
    text-align: center;
    font-size: 12px;
    color: #888;
    margin: 8px 0;
    font-style: italic;
}

/* Thinking animation */
.thinking-dots {
    display: inline-flex;
    gap: 4px;
}

.thinking-dots .dot {
    width: 8px;
    height: 8px;
    background-color: #888;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

.thinking-dots .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.thinking-dots .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes pulse {
    0%, 60%, 100% {
        transform: scale(1);
        opacity: 0.4;
    }
    20% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Code styles */
.code-block {
    background-color: #282c34;
    color: #abb2bf;
    border-radius: 6px;
    padding: 10px;
    margin: 8px 0;
    overflow-x: auto;
    font-family: monospace;
    max-width: 100%;
}

.inline-code {
    background-color: #f0f0f0;
    padding: 2px 5px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 85%;
}

/* Input area */
.forum-bot-input {
    display: flex;
    padding: 10px;
    border-top: 1px solid #e0e0e0;
    background-color: #f9f9f9;
}

.forum-bot-input textarea {
    flex-grow: 1;
    border: 1px solid #e0e0e0;
    border-radius: 18px;
    padding: 8px 15px;
    resize: none;
    height: 38px;
    outline: none;
    font-family: inherit;
    font-size: 14px;
}

.bot-send-btn {
    width: 38px;
    height: 38px;
    border: none;
    background-color: #2196F3;
    color: white;
    border-radius: 50%;
    margin-left: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.bot-send-btn:hover {
    background-color: #1976D2;
}

/* Footer with connection status */
.forum-bot-footer {
    padding: 8px 15px;
    background-color: #f5f5f5;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
}

.bot-status-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
}

.bot-status-indicator i {
    font-size: 10px;
}

.status-online {
    color: #4CAF50;
}

.status-offline {
    color: #F44336;
}

.status-unknown {
    color: #FFC107;
}

.bot-info {
    font-style: italic;
}

/* Dark theme support */
[data-theme="dark"] .forum-bot-container {
    border-color: #444;
    background-color: #222;
}

[data-theme="dark"] .forum-bot-header {
    background-color: #333;
    border-color: #444;
    color: #eee;
}

[data-theme="dark"] .bot-type-toggle {
    background-color: #555;
    border-color: #666;
}

[data-theme="dark"] .toggle-label {
    color: #ccc;
}

[data-theme="dark"] .bot-status {
    color: #aaa;
}

[data-theme="dark"] .forum-bot-messages {
    background-color: #222;
}

[data-theme="dark"] .message-content {
    background-color: #333;
    color: #eee;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .user-message .message-content {
    background-color: #1a3a5f;
}

[data-theme="dark"] .system-message {
    color: #aaa;
}

[data-theme="dark"] .forum-bot-input {
    background-color: #333;
    border-color: #444;
}

[data-theme="dark"] .forum-bot-input textarea {
    background-color: #444;
    border-color: #555;
    color: #eee;
}

[data-theme="dark"] .inline-code {
    background-color: #3a3a3a;
    color: #ddd;
}

[data-theme="dark"] .forum-bot-footer {
    background-color: #333;
    color: #aaa;
    border-color: #444;
}