* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 2.5rem;
}

header p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

.chat-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    height: 600px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #fafafa;
}

.message {
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 10px;
    max-width: 80%;
    word-wrap: break-word;
}

.message p {
    margin: 6px 0;
}

.message .plain-text {
    white-space: pre-wrap;
}

.message h1,
.message h2,
.message h3,
.message h4 {
    margin: 10px 0 6px;
    font-size: 1.05rem;
}

.message ul,
.message ol {
    margin: 6px 0 6px 20px;
    padding: 0;
}

.message li {
    margin: 4px 0;
}

.user-message {
    background: #3498db;
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 5px;
}

.bot-message {
    background: white;
    color: #2c3e50;
    border: 1px solid #e1e8ed;
    border-bottom-left-radius: 5px;
}

.message a {
    color: #3498db;
    text-decoration: underline;
    transition: color 0.3s;
}

.message a:hover {
    color: #2980b9;
    text-decoration: none;
}

.user-message a {
    color: #ecf0f1;
}

.user-message a:hover {
    color: white;
}

.prompt-form {
    padding: 20px;
    background: white;
    border-top: 1px solid #e1e8ed;
}

.voice-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    border-top: 1px solid #e1e8ed;
    background: #f3f8fc;
}

.voice-status-wrap {
    min-width: 0;
}

.voice-status {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 999px;
    background: #e1edf7;
    color: #20435c;
    font-size: 14px;
    font-weight: 600;
}

.voice-actions {
    display: flex;
    gap: 10px;
}

.voice-btn {
    padding: 12px 18px;
    border: none;
    border-radius: 999px;
    background: #0f766e;
    color: white;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
}

.voice-btn.secondary {
    background: #5b6b79;
}

.voice-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.input-group {
    display: flex;
    gap: 10px;
}

#prompt-input {
    flex: 1;
    padding: 15px;
    border: 2px solid #e1e8ed;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

#prompt-input:focus {
    border-color: #3498db;
}

#submit-btn {
    padding: 15px 30px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s;
}

#submit-btn:hover {
    background: #2980b9;
}

#submit-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .message {
        max-width: 95%;
    }
    
    .input-group {
        flex-direction: column;
    }

    .voice-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .voice-actions {
        flex-direction: column;
    }
    
    #submit-btn {
        align-self: stretch;
    }
}
