/* Bot Manager Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

header {
    background-color: #343a40;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
}

#userStatus {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

#connectionStatus {
    font-weight: bold;
    color: #7fff7f;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

section {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

h2 {
    color: #343a40;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0.5rem;
    margin-top: 0;
    font-size: 1.5rem;
}

h3 {
    color: #495057;
    font-size: 1.2rem;
    margin: 1.5rem 0 0.8rem 0;
}

.control-section {
    margin-bottom: 1.5rem;
}

.control-group {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.full-width {
    flex-direction: column;
    align-items: flex-start;
}

label {
    font-weight: 600;
    margin-right: 1rem;
    min-width: 100px;
}

select, input, textarea {
    padding: 0.6rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.9rem;
}

textarea {
    width: 100%;
    resize: vertical;
    min-height: 80px;
}

button {
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    font-size: 0.9rem;
    margin-right: 0.5rem;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #0069d9;
}

.toggle-btn {
    background-color: #6c757d;
    margin-bottom: 0.8rem;
}

.toggle-btn:hover {
    background-color: #5a6268;
}

.icon-btn {
    background-color: transparent;
    padding: 0.4rem;
}

.icon-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.icon {
    width: 24px;
    height: 24px;
}

#conversationContainer {
    border: 1px solid #ced4da;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 400px;
}

.conversation-area {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
    background-color: #f8f9fa;
}

.input-area {
    padding: 1rem;
    background-color: white;
    border-top: 1px solid #ced4da;
    display: flex;
    align-items: center;
}

.input-area textarea {
    flex-grow: 1;
    margin-right: 1rem;
    height: 60px;
}

.action-buttons {
    display: flex;
    flex-direction: column;
}

.listenmode {
    background-color: #e9ecef;
    padding: 0.5rem;
    text-align: center;
    border-radius: 4px;
    margin-top: 1rem;
    font-weight: 600;
}

#errorMessage {
    color: #dc3545;
    font-weight: 600;
    margin-top: 1rem;
}

.bot-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.bot-list li {
    padding: 0.8rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.remove-bot-btn {
    background-color: #dc3545;
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

.remove-bot-btn:hover {
    background-color: #c82333;
}

footer {
    background-color: #343a40;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    padding: 1rem;
    font-size: 0.9rem;
}

/* Message Styles */
.message {
    margin-bottom: 1rem;
    max-width: 80%;
}

.user-message {
    margin-left: auto;
    background-color: #d1ecf1;
    padding: 0.8rem;
    border-radius: 12px 12px 0 12px;
}

.bot-message {
    margin-right: auto;
    background-color: #f8f9fa;
    padding: 0.8rem;
    border-radius: 12px 12px 12px 0;
    border-left: 4px solid #007bff;
}

.message-meta {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.2rem;
}

/* Responsive Styles */
@media (max-width: 900px) {
    main {
        grid-template-columns: 1fr;
    }
    
    .control-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    label {
        margin-bottom: 0.5rem;
    }
    
    select, input {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .input-area {
        flex-direction: column;
    }
    
    .input-area textarea {
        width: 100%;
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .action-buttons {
        flex-direction: row;
        width: 100%;
        justify-content: space-between;
    }
}