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

:root {
    --bg-dark: #ffeef2;
    --bg-mid: #ffd1dc;
    --bg-light: #ffb6c1;
    --primary: #f8a5c2;
    --secondary: #ff9ff3;
    --accent: #f368e0;
    --text-main: #2d3436;
    --text-muted: #636e72;
    --glass-bg: rgba(255, 255, 255, 0.5);
    --glass-border: rgba(255, 255, 255, 0.8);
}

body {
    font-family: 'Outfit', sans-serif;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--bg-dark), var(--bg-mid), var(--bg-light));
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: var(--text-main);
    overflow: hidden;
}

/* Extravagant Background Animations */
@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.background-animation {
    position: absolute;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: -1;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 10s infinite ease-in-out alternate;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #ff9a9e, #fecfef);
    top: -10%;
    left: -10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, #fbc2eb, #a6c1ee);
    bottom: -20%;
    right: -10%;
    animation-duration: 12s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #fdfbfb, #ebedee);
    top: 40%;
    left: 40%;
    animation-duration: 15s;
}

@keyframes float {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-30px) scale(1.1); }
}

/* Chat Container Glassmorphism */
.chat-container {
    width: 90%;
    max-width: 450px;
    height: 85vh;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    animation: dropIn 1s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

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

/* Header */
.chat-header {
    display: flex;
    align-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--glass-border);
    position: relative;
    z-index: 10;
}

.avatar-container {
    position: relative;
    width: 50px;
    height: 50px;
    margin-right: 15px;
}

.avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
    background: rgba(255,255,255,0.1);
    animation: avatarPulse 3s infinite;
}

.avatar-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--accent);
    border-radius: 50%;
    filter: blur(15px);
    opacity: 0.6;
    animation: glowPulse 3s infinite;
}

@keyframes avatarPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(243, 104, 224, 0.6); }
    70% { transform: scale(1); box-shadow: 0 0 0 15px rgba(243, 104, 224, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(243, 104, 224, 0); }
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.2); }
}

.header-info h1 {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: 1px;
    background: linear-gradient(to right, #2d3436, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 3px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #00e676;
    border-radius: 50%;
    box-shadow: 0 0 8px #00e676;
    animation: blink 2s infinite;
}

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

.options-btn {
    margin-left: auto;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.3s;
}

.options-btn:hover {
    color: var(--accent);
}

/* Chat Box */
.chat-box {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scroll-behavior: smooth;
}

.chat-box::-webkit-scrollbar {
    width: 6px;
}
.chat-box::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* Messages */
.message {
    max-width: 80%;
    padding: 14px 18px;
    border-radius: 20px;
    font-size: 0.95rem;
    line-height: 1.4;
    position: relative;
    animation: slideUpFade 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0;
    transform: translateY(20px);
}

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

.message.bot {
    align-self: flex-start;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7));
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-bottom-left-radius: 5px;
    box-shadow: 0 5px 15px rgba(248, 165, 194, 0.2);
    color: var(--text-main);
}

.message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #ff9a9e, #fecfef);
    border-bottom-right-radius: 5px;
    color: #2d3436;
    box-shadow: 0 5px 15px rgba(254, 207, 239, 0.4);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    width: fit-content;
    border-bottom-left-radius: 5px;
    align-self: flex-start;
    animation: slideUpFade 0.3s forwards;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background-color: var(--accent);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

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

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Input Area */
.chat-input-area {
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--glass-border);
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 5px 5px 5px 20px;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.2);
}

.input-wrapper:focus-within {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.2), inset 0 2px 5px rgba(0,0,0,0.2);
}

.input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-size: 1rem;
    font-family: 'Outfit', sans-serif;
}

.input-wrapper input::placeholder {
    color: rgba(45, 52, 54, 0.5);
}

.send-btn {
    background: linear-gradient(135deg, var(--accent), var(--primary));
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
}

.send-btn i {
    font-size: 1.1rem;
    margin-right: 2px;
    margin-top: 2px;
}

.send-btn:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 0 20px rgba(243, 104, 224, 0.4);
}

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