:root {
    --bg-color: #0d0006;
    --neon-pink: #ff0f7b;
    --neon-purple: #f89b29;
    /* Fallback */
    --neon-purple-real: #9b00e8;
    --glass-bg: rgba(20, 0, 10, 0.45);
    --glass-border: rgba(255, 15, 123, 0.3);
    --text-primary: #ffe6f0;
    --text-muted: #b38da0;
}

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

body {
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at 15% 50%, rgba(255, 15, 123, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(155, 0, 232, 0.15), transparent 25%);
    min-height: 100vh;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.app-container {
    width: 100%;
    max-width: 900px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
}

/* Glassmorphism */
.glass-header {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 32px 0 rgba(255, 15, 123, 0.1);
}

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

.logo i {
    color: var(--neon-pink);
    font-size: 1.5rem;
    filter: drop-shadow(0 0 8px var(--neon-pink));
}

.logo h1 {
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 1px;
    background: linear-gradient(90deg, var(--neon-pink), var(--neon-purple-real));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.pulse {
    width: 8px;
    height: 8px;
    background-color: var(--neon-pink);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--neon-pink);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 15, 123, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(255, 15, 123, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 15, 123, 0);
    }
}

/* Kinetic Border Wrapper */
.kinetic-wrapper {
    position: relative;
    flex: 1;
    border-radius: 20px;
    padding: 2px;
    /* Border thickness */
    overflow: hidden;
    display: flex;
}

.kinetic-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(transparent,
            rgba(255, 15, 123, 0.1),
            var(--neon-pink),
            var(--neon-purple-real),
            transparent 30%);
    animation: rotate 4s linear infinite;
    z-index: 0;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

.chat-container.glass-panel {
    background: rgba(13, 0, 7, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
    z-index: 1;
    overflow: hidden;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    scroll-behavior: smooth;
}

.chat-history::-webkit-scrollbar {
    width: 6px;
}

.chat-history::-webkit-scrollbar-thumb {
    background: rgba(255, 15, 123, 0.3);
    border-radius: 3px;
}

/* Messages */
.message {
    display: flex;
    gap: 12px;
    animation: fadeIn 0.4s ease forwards;
    opacity: 0;
    transform: translateY(10px);
    max-width: 85%;
}

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

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

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

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.message.bot .avatar {
    color: var(--neon-pink);
    box-shadow: 0 0 10px rgba(255, 15, 123, 0.2);
}

.message.user .avatar {
    color: var(--text-primary);
}

.bubble {
    padding: 1rem 1.2rem;
    border-radius: 16px;
    font-size: 1rem;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
}

.message.bot .bubble {
    background: rgba(255, 15, 123, 0.1);
    border: 1px solid rgba(255, 15, 123, 0.2);
    border-top-left-radius: 4px;
    color: #fce8f2;
}

.message.user .bubble {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top-right-radius: 4px;
    color: var(--text-primary);
}

/* Input Area */
.input-area {
    padding: 1.5rem 2rem;
    border-top: 1px solid rgba(255, 15, 123, 0.15);
    background: rgba(0, 0, 0, 0.2);
}

.glass-input-wrapper {
    display: flex;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 0.5rem 0.5rem 0.5rem 1.5rem;
    transition: all 0.3s ease;
}

.glass-input-wrapper:focus-within {
    border-color: var(--neon-pink);
    box-shadow: 0 0 15px rgba(255, 15, 123, 0.2);
    background: rgba(255, 255, 255, 0.06);
}

input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
}

input::placeholder {
    color: rgba(255, 230, 240, 0.3);
}

.glow-button {
    background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple-real));
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(255, 15, 123, 0.4);
}

.glow-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(255, 15, 123, 0.6);
}

.glow-button:active {
    transform: scale(0.95);
}

/* Typing Indicator */
.typing {
    display: flex;
    gap: 4px;
    padding: 0.5rem 0;
}

.typing span {
    width: 6px;
    height: 6px;
    background: var(--neon-pink);
    border-radius: 50%;
    animation: typing 1s infinite alternate;
}

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

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

@keyframes typing {
    0% {
        transform: translateY(0);
        opacity: 0.5;
    }

    100% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: 1rem;
    }

    .chat-history {
        padding: 1rem;
    }

    .message {
        max-width: 95%;
    }
}