/* Chat Styles */
.platform-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem 0.5rem 0 0;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 0.5rem;
    overflow: hidden;
}

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

.chat-message {
    animation: messageSlideIn var(--transition-normal);
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.message-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.message-author {
    font-weight: 600;
    color: var(--primary-color);
}

.message-badge {
    background: var(--accent-color);
    color: white;
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-weight: 600;
    text-transform: uppercase;
}

.message-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.message-content {
    color: var(--text-secondary);
    line-height: 1.5;
    word-wrap: break-word;
}

.system-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(99, 102, 241, 0.1);
    border-left: 3px solid var(--primary-color);
    border-radius: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.own-message {
    align-self: flex-end;
    max-width: 80%;
}

.own-message .message-content {
    background: var(--primary-color);
    color: white;
    padding: 0.75rem;
    border-radius: 0.5rem 0.5rem 0 0.5rem;
}

.mention {
    color: var(--accent-color);
    font-weight: 600;
}

.emote {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    vertical-align: middle;
    margin: 0 0.125rem;
}

.chat-input-container {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

#chatInput {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: var(--transition-fast);
}

#chatInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.btn-send {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-send:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.btn-voice {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-voice:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--accent-color);
}

.btn-voice.recording {
    background: var(--error-color);
    color: white;
    animation: recordPulse 1.5s infinite;
}

@keyframes recordPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
}

/* Memory Panel */
.memory-panel {
    margin-top: 1rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
}

.memory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.memory-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.memory-content {
    max-height: 150px;
    overflow-y: auto;
    padding: 0.75rem;
}

.memory-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
    font-size: 0.8125rem;
    animation: memoryFadeIn var(--transition-normal);
}

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

.memory-time {
    color: var(--text-muted);
    white-space: nowrap;
    font-family: 'Courier New', monospace;
}

.memory-text {
    color: var(--text-secondary);
    flex: 1;
}

/* Chat Loading State */
.chat-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-muted);
}

.chat-loading::after {
    content: '';
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.75rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

.typing-indicator span {
    width: 0.375rem;
    height: 0.375rem;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

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

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

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-0.5rem);
    }
}