/**
 * Notetaker Chat UI Styles
 * Chat interface for asking questions about meeting transcripts
 */

.notetaker-chat {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 400px;
    max-height: 600px;
    background: var(--bg-secondary, #1a1a1a);
    border-radius: 12px;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Header */
.notetaker-chat .chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-tertiary, #222);
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

.notetaker-chat .chat-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #fff);
}

.notetaker-chat .chat-status {
    font-size: 11px;
    color: var(--text-secondary, #888);
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* Suggestions */
.notetaker-chat .chat-suggestions {
    padding: 8px 12px;
    background: var(--bg-tertiary, #222);
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

.notetaker-chat .suggestions-label {
    font-size: 11px;
    color: var(--text-secondary, #888);
    margin-right: 8px;
}

.notetaker-chat .suggestions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.notetaker-chat .suggestion-btn {
    padding: 4px 10px;
    font-size: 12px;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 14px;
    color: #60a5fa;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notetaker-chat .suggestion-btn:hover {
    background: rgba(59, 130, 246, 0.25);
    border-color: rgba(59, 130, 246, 0.5);
}

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

.notetaker-chat .chat-message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    animation: messageSlideIn 0.2s ease;
}

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

.notetaker-chat .chat-message.user {
    align-self: flex-end;
    background: #3b82f6;
    color: white;
    border-bottom-right-radius: 4px;
}

.notetaker-chat .chat-message.assistant {
    align-self: flex-start;
    background: var(--bg-tertiary, #2a2a2a);
    color: var(--text-primary, #fff);
    border-bottom-left-radius: 4px;
}

.notetaker-chat .chat-message.error {
    align-self: center;
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.notetaker-chat .message-content {
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

.notetaker-chat .message-content code {
    background: rgba(0, 0, 0, 0.3);
    padding: 1px 4px;
    border-radius: 3px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 13px;
}

.notetaker-chat .message-content blockquote {
    margin: 8px 0;
    padding: 8px 12px;
    border-left: 3px solid rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0 4px 4px 0;
    font-style: italic;
}

.notetaker-chat .message-content ul {
    margin: 8px 0;
    padding-left: 20px;
}

.notetaker-chat .message-content li {
    margin: 4px 0;
}

.notetaker-chat .message-time {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
    text-align: right;
}

.notetaker-chat .chat-message.assistant .message-time {
    text-align: left;
}

/* Input Area */
.notetaker-chat .chat-input-area {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: var(--bg-tertiary, #222);
    border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

.notetaker-chat .chat-input {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-secondary, #1a1a1a);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 8px;
    color: var(--text-primary, #fff);
    font-size: 14px;
    resize: none;
    outline: none;
    transition: border-color 0.2s ease;
}

.notetaker-chat .chat-input:focus {
    border-color: #3b82f6;
}

.notetaker-chat .chat-input::placeholder {
    color: var(--text-secondary, #666);
}

.notetaker-chat .chat-send-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: #3b82f6;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.notetaker-chat .chat-send-btn:hover:not(:disabled) {
    background: #2563eb;
    transform: scale(1.05);
}

.notetaker-chat .chat-send-btn:disabled {
    background: var(--bg-tertiary, #333);
    color: var(--text-secondary, #666);
    cursor: not-allowed;
}

/* Loading State */
.notetaker-chat .chat-send-btn.loading {
    pointer-events: none;
}

.notetaker-chat .chat-send-btn.loading svg {
    animation: spin 1s linear infinite;
}

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

/* Typing Indicator */
.notetaker-chat .typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    align-self: flex-start;
}

.notetaker-chat .typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--text-secondary, #666);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* Scrollbar */
.notetaker-chat .chat-messages::-webkit-scrollbar {
    width: 6px;
}

.notetaker-chat .chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.notetaker-chat .chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.notetaker-chat .chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Light Mode Support */
@media (prefers-color-scheme: light) {
    .notetaker-chat {
        background: #fff;
        border-color: #e5e7eb;
    }

    .notetaker-chat .chat-header {
        background: #f9fafb;
        border-color: #e5e7eb;
    }

    .notetaker-chat .chat-header h4 {
        color: #111827;
    }

    .notetaker-chat .chat-status {
        color: #6b7280;
        background: #f3f4f6;
    }

    .notetaker-chat .chat-suggestions {
        background: #f9fafb;
        border-color: #e5e7eb;
    }

    .notetaker-chat .chat-message.assistant {
        background: #f3f4f6;
        color: #111827;
    }

    .notetaker-chat .message-time {
        color: rgba(0, 0, 0, 0.4);
    }

    .notetaker-chat .chat-input-area {
        background: #f9fafb;
        border-color: #e5e7eb;
    }

    .notetaker-chat .chat-input {
        background: #fff;
        border-color: #e5e7eb;
        color: #111827;
    }

    .notetaker-chat .chat-input::placeholder {
        color: #9ca3af;
    }
}

/* Responsive */
@media (max-width: 480px) {
    .notetaker-chat {
        min-height: 300px;
        border-radius: 0;
    }

    .notetaker-chat .chat-message {
        max-width: 90%;
    }

    .notetaker-chat .suggestion-btn {
        font-size: 11px;
        padding: 3px 8px;
    }
}
