:root {
    --primary: #004d40;
    --secondary: #25d366;
    --bg-color: #ffffff;
    --text-color: #2d3443;
    --glass-bg: #f3f4f6;
    --glass-border: rgba(45, 52, 67, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* Decorative background blobs */
.blob {
    display: none;
    position: absolute;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.6;
    animation: float 10s ease-in-out infinite alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 40vw;
    height: 40vw;
    background: linear-gradient(to right, var(--primary), #00695c);
    border-radius: 50%;
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 35vw;
    height: 35vw;
    background: linear-gradient(to right, var(--secondary), #128c7e);
    border-radius: 50%;
    animation-delay: -5s;
}

@keyframes float {
    0% {
        transform: translateY(0) scale(1);
    }

    100% {
        transform: translateY(-20px) scale(1.05);
    }
}

.container {
    width: 90%;
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
}

header {
    text-align: center;
    margin-bottom: 2rem;
    animation: slideDown 0.8s ease-out forwards;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

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

h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-color), #4b5563);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 15px rgba(45, 52, 67, 0.1);
    letter-spacing: -1px;
}

p.subtitle {
    font-size: 1.2rem;
    font-weight: 300;
    color: #64748b;
    max-width: 600px;
    margin: 0 auto;
}

.chat-container {
    width: 100%;
    max-width: 1000px;
    height: 75vh;
    min-height: 400px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(45, 52, 67, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: fadeIn 1s ease-out 0.3s forwards;
    opacity: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.chat-header {
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(45, 52, 67, 0.02);
}

.agent-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    box-shadow: 0 0 20px rgba(37, 211, 102, 0.4);
    position: relative;
}

.agent-avatar::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background-color: #10b981;
    border-radius: 50%;
    border: 2px solid var(--bg-color);
}

.agent-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.agent-info span {
    font-size: 0.85rem;
    color: #10b981;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    max-width: 80%;
    padding: 1rem 1.2rem;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    opacity: 0;
    transform-origin: bottom left;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
    }

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

.message.bot {
    background: #f8fafc;
    border: 1px solid var(--glass-border);
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}

.message.user {
    background: linear-gradient(135deg, var(--primary), #00695c);
    color: white;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
    transform-origin: bottom right;
}

.chat-input-area {
    padding: 1.2rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 0.8rem;
    background: rgba(255, 255, 255, 0.5);
}

.chat-input-area input {
    flex: 1;
    background: #e5e7eb;
    border: 1px solid #86efac;
    box-shadow: 0 2px 10px rgba(37, 211, 102, 0.15);
    padding: 1rem 1.5rem;
    border-radius: 99px;
    color: var(--text-color);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
}

.chat-input-area input:focus {
    background: #ffffff;
    border-color: var(--secondary);
    box-shadow: 0 0 15px rgba(37, 211, 102, 0.15);
}

.chat-input-area input::placeholder {
    color: #64748b;
}

.send-btn {
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.3);
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.5);
}

.send-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
    margin-left: 2px;
    /* optical alignment */
}

/* Typing indicator */
.typing {
    display: flex;
    gap: 4px;
    padding: 1rem 1.2rem;
    background: #f8fafc;
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    width: fit-content;
    display: none;
}

.typing .dot {
    width: 6px;
    height: 6px;
    background-color: #94a3b8;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing .dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing .dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typingBounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
    }

    .container {
        width: 95%;
    }

    .chat-container {
        height: 80vh;
    }
}