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

body {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #eef2f7;
    font-family: Arial, sans-serif;
}

.chat-container {
    width: 420px;
    height: 600px;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.chat-header {
    background: linear-gradient(135deg, #4f46e5, #3b82f6);
    color: white;
    padding: 18px;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
}

.chat-box {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f5f5f5;
    scroll-behavior: smooth;
}

.message {
    max-width: 80%;
    padding: 12px 14px;
    margin-bottom: 12px;
    border-radius: 16px;
    line-height: 1.4;
    word-wrap: break-word;
    animation: fadeIn 0.3s ease;
}

.user-message {
    background: #3b82f6;
    color: white;
    margin-left: auto;
}

.bot-message {
    background: #e5e7eb;
    color: black;
    border: 1px solid #ddd;
}

.input-area {
    display: flex;
    padding: 10px;
    background: white;
    border-top: 1px solid #ddd;
}

input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 10px;
    outline: none;
}

button {
    margin-left: 10px;
    padding: 12px 18px;
    border: none;
    background: #3b82f6;
    color: white;
    border-radius: 10px;
    cursor: pointer;
}

.time {
    font-size: 11px;
    margin-top: 5px;
    opacity: 0.7;
    text-align: right;
}

.message {
    max-width: 80%;
    padding: 12px 14px;
    margin-bottom: 12px;
    border-radius: 16px;
    font-size: 16px;
    line-height: 1.4;
    word-wrap: break-word;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

#theme-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 18px;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.3s;
}

#theme-toggle:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.3);
}

.dark-mode {
    background: #111827;
}

.dark-mode .chat-container {
    background: #1f2937;
    color: white;
}

.dark-mode .chat-box {
    background: #111827;
}

.dark-mode .bot-message {
    background: #1f2937;
    color: white;
    border: none;
}

.dark-mode input {
    background: #1f2937;
    color: white;
    border: 1px solid #555;
}

.dark-mode .input-area {
    background: #1f2937;
}

#clear-chat {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 10px 14px;
    border-radius: 10%;
    color: white;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    margin-left: 8px;
    transition: 0.3s;
}

#clear-chat:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.3);
}

@media (max-width: 680px) {
    .chat-container {
        width: 95%;
        height: 95vh;
        border-radius: 12px;
    }

    .chat-header {
        font-size: 18px;
        padding: 14px;
    }

    .message {
        font-size: 14px;
    }

    input {
        font-size: 14px;
    }

    button {
        font-size: 14px;
    }
}

#mic-btn {
    margin-left: 8px;
    padding: 12px;
    border: none;
    background: #10b981;
    color: white;
    cursor: pointer;
    transition: 0.3s;
}

#mic-btn:hover {
    transform: scale(1.05);
}