* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
}

.chat-container {
    background: rgba(255, 255, 255, 0.95);
    width: 90%;
    max-width: 600px;
    border-radius: 25px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transform-style: preserve-3d;
    position: relative;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
}

.chat-container:hover {
    transform: translateY(-5px) rotateX(1deg) rotateY(1deg);
}

.chat-header {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    padding: 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.chat-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    animation: header-shine 4s infinite;
}

@keyframes header-shine {
    0% { transform: rotate(45deg) translateX(-150%); }
    100% { transform: rotate(45deg) translateX(150%); }
}

.chat-header h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    position: relative;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.chat-header p {
    font-size: 1rem;
    color: #e0e7ff;
    font-weight: 300;
}

.chat-messages {
    height: 400px;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background: linear-gradient(to bottom right, #f8fafc, #f1f5f9);
}

/* Custom Scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(99, 102, 241, 0.1);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(#6366f1, #8b5cf6);
    border-radius: 10px;
}

.user-message, .bot-message {
    max-width: 80%;
    padding: 1.2rem;
    border-radius: 20px;
    margin: 0.5rem 0;
    position: relative;
    transition: transform 0.2s ease;
    transform-origin: bottom;
}

.user-message {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: white;
    align-self: flex-end;
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.3);
    clip-path: polygon(0 0, 100% 0, 100% 75%, 98% 100%, 0 100%);
}

.bot-message {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    color: #1e293b;
    align-self: flex-start;
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.1);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 2% 100%, 0 75%);
}

.user-message::before,
.bot-message::before {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    background-size: cover;
    top: -10px;
}

.user-message::before {
    right: -10px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%233b82f6"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/><circle cx="12" cy="12" r="5"/></svg>');
}

.bot-message::before {
    left: -10px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%238b5cf6"><path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"/></svg>');
}

.chat-input {
    display: flex;
    padding: 1.5rem;
    background: rgba(248, 249, 250, 0.9);
    border-top: 2px solid rgba(226, 232, 240, 0.5);
    backdrop-filter: blur(5px);
}

#user-input {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 15px;
    margin-right: 1rem;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

#user-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3), inset 0 2px 4px rgba(0,0,0,0.05);
}

#send-btn {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.4);
}

#send-btn i {
    transition: transform 0.3s ease;
}

#send-btn:hover i {
    transform: translateX(3px);
}

/* Enhanced Typing Animation */
.typing-indicator {
    display: inline-flex;
    align-items: center;
    padding: 1rem;
    background: rgba(226, 232, 240, 0.5);
    border-radius: 20px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.dot {
    width: 10px;
    height: 10px;
    margin: 0 4px;
    background: #8b5cf6;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

@keyframes typing {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Message Animation */
@keyframes messagePop {
    0% { transform: scale(0.9) translateY(10px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.user-message, .bot-message {
    animation: messagePop 0.3s ease-out;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chat-container {
        width: 95%;
        border-radius: 15px;
    }
    
    .chat-messages {
        height: 60vh;
        padding: 1rem;
    }
    
    .user-message, .bot-message {
        max-width: 90%;
    }
}

/* Floating Animation */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.chat-container {
    animation: float 4s ease-in-out infinite;
}