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

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --user-msg-bg: #6366f1;
    --ai-msg-bg: #334155;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --shadow: rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
    position: relative;
}

.container {
    width: 100%;
    max-width: 900px;
    height: 90vh;
    background: var(--bg-dark);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(10px);
}

/* Animated Background */
.animated-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    opacity: 0.1;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    animation: float 20s infinite ease-in-out;
}

.bg-circle:nth-child(1) {
    width: 300px;
    height: 300px;
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.bg-circle:nth-child(2) {
    width: 200px;
    height: 200px;
    top: 50%;
    right: -50px;
    animation-delay: 5s;
}

.bg-circle:nth-child(3) {
    width: 250px;
    height: 250px;
    bottom: -50px;
    left: 20%;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(30px, -30px) rotate(120deg);
    }
    66% {
        transform: translate(-20px, 20px) rotate(240deg);
    }
}

/* Header */
.chat-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 20px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
    position: relative;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    animation: pulse 2s infinite;
}

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

.logo h1 {
    color: white;
    font-size: 24px;
    font-weight: 600;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success-color);
    border-radius: 50%;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.status-text {
    color: white;
    font-size: 14px;
    font-weight: 500;
}

/* Chat Container */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.chat-container::-webkit-scrollbar {
    width: 8px;
}

.chat-container::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

.chat-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Welcome Message */
.welcome-message {
    text-align: center;
    padding: 40px 20px;
    animation: fadeInUp 0.6s ease-out;
}

.welcome-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.welcome-message h2 {
    color: var(--text-primary);
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: 600;
}

.welcome-message p {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Message Bubbles */
.message {
    display: flex;
    margin-bottom: 20px;
    animation: fadeInUp 0.4s ease-out;
    max-width: 75%;
    word-wrap: break-word;
}

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

.message.user {
    align-self: flex-end;
    margin-left: auto;
}

.message.ai {
    align-self: flex-start;
}

.message-content {
    padding: 16px 20px;
    border-radius: 20px;
    position: relative;
    box-shadow: 0 4px 12px var(--shadow);
    line-height: 1.6;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.message.user .message-content {
    background: linear-gradient(135deg, var(--user-msg-bg), var(--primary-dark));
    color: white;
    border-bottom-right-radius: 4px;
}

.message.ai .message-content {
    background: var(--ai-msg-bg);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.message-text {
    font-size: 15px;
    white-space: pre-wrap;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 8px;
    display: block;
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    padding: 16px 20px;
    background: var(--ai-msg-bg);
    border-radius: 20px;
    border-bottom-left-radius: 4px;
    margin-bottom: 20px;
    max-width: 75px;
    align-self: flex-start;
    box-shadow: 0 4px 12px var(--shadow);
}

.typing-indicator.active {
    display: flex;
    gap: 6px;
    animation: fadeInUp 0.4s ease-out;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Input Container */
.input-container {
    padding: 20px 30px;
    background: var(--bg-card);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 10;
}

.input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    background: var(--bg-dark);
    border-radius: 24px;
    padding: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

textarea#userInput {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    resize: none;
    max-height: 120px;
    overflow-y: auto;
    outline: none;
    padding: 8px;
}

textarea#userInput::placeholder {
    color: var(--text-secondary);
}

.send-btn {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.send-btn:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.send-btn:active {
    transform: scale(0.95);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.char-counter {
    text-align: right;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Error Message */
.error-message {
    background: var(--error-color);
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    margin: 10px 30px;
    text-align: center;
    animation: shake 0.5s ease-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        height: 100vh;
        border-radius: 0;
    }
    
    .chat-header {
        padding: 15px 20px;
    }
    
    .logo h1 {
        font-size: 20px;
    }
    
    .message {
        max-width: 85%;
    }
    
    .chat-container {
        padding: 20px;
    }
    
    .input-container {
        padding: 15px 20px;
    }
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

.chat-footer {
    width: 100%;
    padding: 14px 0;
    margin-top: 20px;

    display: flex;
    justify-content: center;
    align-items: center;

    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;

    color: #ffffff;
    text-align: center;

    background: transparent;

    /* Glow effect */
    text-shadow:
        0 0 5px rgba(255, 255, 255, 0.6),
        0 0 10px rgba(120, 200, 255, 0.6),
        0 0 20px rgba(120, 200, 255, 0.5),
        0 0 30px rgba(120, 200, 255, 0.4);

    animation: footerGlow 3s ease-in-out infinite alternate;
}

.chat-footer strong {
    margin-left: 6px;
    color: #ffffff;
    font-weight: 600;
}

/* Glow animation */
@keyframes footerGlow {
    0% {
        text-shadow:
            0 0 4px rgba(255, 255, 255, 0.5),
            0 0 8px rgba(120, 200, 255, 0.5),
            0 0 16px rgba(120, 200, 255, 0.4),
            0 0 24px rgba(120, 200, 255, 0.3);
    }
    100% {
        text-shadow:
            0 0 6px rgba(255, 255, 255, 0.9),
            0 0 14px rgba(120, 200, 255, 0.9),
            0 0 26px rgba(120, 200, 255, 0.7),
            0 0 40px rgba(120, 200, 255, 0.6);
    }
}





