/* Chat Page Styles */
.chat-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 800px;
    margin: 0 auto;
    background: var(--background);
}

/* Header */
.chat-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--surface-solid);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.back-button {
    color: var(--primary-light);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.05);
}

.chat-header-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.header-avatar {
    position: relative;
    width: 48px;
    height: 48px;
}

.header-avatar img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--primary);
}

.online-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #10b981;
    border-radius: 50%;
    border: 2px solid var(--surface-solid);
}

.header-info {
    flex: 1;
}

.header-name {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.verified {
    background: var(--primary);
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.header-status {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Messages */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    display: flex;
    gap: 12px;
    max-width: 85%;
    animation: messageIn 0.3s ease-out;
}

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

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

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

.message-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
}

.message-avatar img {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 50%;
}

.message.user .message-avatar {
    display: none;
}

.message-content {
    padding: 14px 18px;
    border-radius: 20px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.message.bot .message-content {
    background: var(--surface-solid);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom-left-radius: 4px;
}

.message.user .message-content {
    background: var(--gradient-1);
    border-bottom-right-radius: 4px;
}

.message-content p {
    margin: 0;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 14px 18px;
    background: var(--surface-solid);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    border-bottom-left-radius: 4px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    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; }
.typing-indicator span:nth-child(3) { animation-delay: 0; }

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

/* Input */
.chat-input-container {
    padding: 16px 20px 24px;
    background: var(--surface-solid);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-input-wrapper {
    display: flex;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 8px;
}

#chat-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 1rem;
    padding: 8px 12px;
    font-family: inherit;
}

#chat-input::placeholder {
    color: var(--text-muted);
}

.send-button {
    background: var(--gradient-1);
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.send-button:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

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

.chat-disclaimer {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 12px;
    opacity: 0.7;
}

/* Mobile */
@media (max-width: 480px) {
    .chat-header {
        padding: 12px 16px;
    }

    .header-avatar {
        width: 40px;
        height: 40px;
    }

    .header-avatar img {
        width: 40px;
        height: 40px;
    }

    .chat-messages {
        padding: 16px;
    }

    .message {
        max-width: 90%;
    }

    .message-content {
        padding: 12px 14px;
        font-size: 0.9rem;
    }

    .chat-input-container {
        padding: 12px 16px 20px;
    }

    .send-button {
        padding: 10px 18px;
    }
}
