/* General Styles */
:root {
    --primary-color: #4a90e2;
    --primary-dark: #2a6fc9;
    --secondary-color: #50c5b7;
    --accent-color: #f8f9fa;
    --text-color: #333;
    --light-text: #6c757d;
    --danger-color: #e74c3c;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --border-radius: 12px;
    --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f5f7fa;
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* Chat Container */
.chat-container {
    width: 100%;
    max-width: 500px;
    height: 700px;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
}

.chat-header h2 {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 1.5rem;
}

.chat-header p {
    font-weight: 300;
    font-size: 0.9rem;
    opacity: 0.9;
}

.bot-avatar {
    width: 60px;
    height: 60px;
    background-color: white;
    border-radius: 50%;
    margin: 0 auto 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.bot-avatar i {
    font-size: 28px;
    color: var(--primary-color);
}

.avatar-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(74, 144, 226, 0.3) 0%, rgba(74, 144, 226, 0) 70%);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.05); opacity: 0.4; }
    100% { transform: scale(1); opacity: 0.7; }
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: var(--accent-color);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    animation: fadeIn 0.3s ease-out;
}

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

.bot-message {
    background-color: white;
    color: var(--text-color);
    align-self: flex-start;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-top-left-radius: 5px;
}

.user-message {
    background-color: var(--primary-color);
    color: white;
    align-self: flex-end;
    border-top-right-radius: 5px;
}

.message-content {
    word-wrap: break-word;
}

/* Typing Animation */
.typing-animation {
    display: flex;
    align-items: center;
    height: 20px;
}

.typing-animation span {
    width: 8px;
    height: 8px;
    margin: 0 2px;
    background-color: var(--light-text);
    border-radius: 50%;
    display: inline-block;
    opacity: 0.4;
}

.typing-animation span:nth-child(1) {
    animation: typing 1s infinite;
}

.typing-animation span:nth-child(2) {
    animation: typing 1s infinite 0.2s;
}

.typing-animation span:nth-child(3) {
    animation: typing 1s infinite 0.4s;
}

@keyframes typing {
    0% { opacity: 0.4; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-3px); }
    100% { opacity: 0.4; transform: translateY(0); }
}

/* Chat Input */
.chat-input {
    display: flex;
    padding: 15px;
    background-color: white;
    border-top: 1px solid #e9ecef;
}

.chat-input input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #e9ecef;
    border-radius: 30px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
    margin-right: 10px;
}

.chat-input input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

.chat-input button {
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
}

.chat-input button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.chat-input button:active {
    transform: translateY(0);
}

.voice-btn {
    margin-right: 10px;
    background-color: #f1f3f5 !important;
    color: var(--light-text) !important;
}

.voice-btn:hover {
    background-color: #e9ecef !important;
}

.voice-btn.listening {
    animation: pulse-record 1.5s infinite;
    background-color: var(--danger-color) !important;
    color: white !important;
}

@keyframes pulse-record {
    0% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(231, 76, 60, 0); }
    100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsive */
@media (max-width: 600px) {
    .chat-container {
        height: 90vh;
    }
    
    .message {
        max-width: 90%;
    }
}