/* Brinxx Chat - Magic e-Verse Style */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --pink-primary: #e9347d;
    --pink-dark: #c12563;
    --pink-light: #ffb3d9;
    --black: #000;
    --white: #fff;
    --gray-100: #f9fafb;
    --gray-200: #e5e7eb;
    --gray-700: #374151;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--pink-primary) 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.chat-container {
    background: var(--white);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 500px;
    height: 85vh;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.chat-header {
    background: linear-gradient(135deg, var(--pink-primary), var(--pink-dark));
    color: var(--white);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar {
    width: 55px;
    height: 55px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: bold;
    color: var(--pink-primary);
}

.header-info h1 {
    font-size: 1.3rem;
    margin-bottom: 4px;
    font-weight: 700;
}

.status {
    font-size: 0.85rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
}

.back-link {
    margin-left: auto;
    color: var(--white);
    text-decoration: none;
    font-size: 1.5rem;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.back-link:hover { opacity: 1; }

/* Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--gray-100);
}

.message {
    margin-bottom: 16px;
    display: flex;
    gap: 10px;
}

.message.user { flex-direction: row-reverse; }

.message-avatar {
    width: 36px;
    height: 36px;
    background: var(--pink-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

.message.user .message-avatar { background: #667eea; }

.message-bubble {
    max-width: 80%;
    padding: 14px 18px;
    border-radius: 18px;
    line-height: 1.5;
}

.message.bot .message-bubble {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-bottom-left-radius: 4px;
}

.message.user .message-bubble {
    background: linear-gradient(135deg, var(--pink-primary), var(--pink-dark));
    color: var(--white);
    border-bottom-right-radius: 4px;
}

.message-time {
    font-size: 0.7rem;
    opacity: 0.6;
    margin-top: 6px;
}

/* Typing indicator */
.typing {
    display: none;
    padding: 10px 20px;
    align-items: center;
    gap: 10px;
}

.typing.show { display: flex; }

.typing-dots {
    display: flex;
    gap: 5px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #98a2b3;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-8px); opacity: 1; }
}

/* Input */
.chat-input {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 12px;
    background: var(--white);
}

.chat-input input {
    flex: 1;
    border: 2px solid var(--gray-200);
    border-radius: 24px;
    padding: 14px 20px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.chat-input input:focus { border-color: var(--pink-primary); }

.chat-input button {
    background: linear-gradient(135deg, var(--pink-primary), var(--pink-dark));
    border: none;
    color: var(--white);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chat-input button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(233, 52, 125, 0.4);
}

.chat-input button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.chat-input button svg {
    width: 22px;
    height: 22px;
}

/* Footer */
.powered-by {
    text-align: center;
    padding: 10px;
    font-size: 0.75rem;
    color: #9ca3af;
    background: var(--gray-100);
}

.powered-by a {
    color: var(--pink-primary);
    text-decoration: none;
}

/* Responsive */
@media (max-width: 480px) {
    body { padding: 0; }
    .chat-container {
        border-radius: 0;
        height: 100vh;
        max-height: none;
    }
}
