/* AI Assistant styles — semantic tokens only */

.ai-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
    max-width: 760px;
}

.ai-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.ai-period-badge {
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--color-surface-secondary, #f9fafb);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
}

/* Not configured state */
.ai-unconfigured {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    text-align: center;
    color: var(--color-text-secondary);
}

.ai-unconfigured-icon {
    color: var(--color-text-tertiary);
}

.ai-unconfigured h2 {
    margin: 0;
    color: var(--color-text-primary);
    font-size: 20px;
}

.ai-unconfigured p {
    margin: 0;
    max-width: 360px;
    line-height: 1.6;
}

/* Chat layout */
.ai-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 0;
}

.ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Welcome */
.ai-welcome {
    padding: 24px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai-welcome-text {
    font-size: 16px;
    color: var(--color-text-primary);
    line-height: 1.6;
    margin: 0;
}

.ai-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ai-suggestion-chip {
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    font-size: 13px;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.ai-suggestion-chip:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

/* Messages */
.ai-message-wrap {
    display: flex;
}

.ai-message-wrap.user {
    justify-content: flex-end;
}

.ai-message-wrap.assistant {
    justify-content: flex-start;
}

.ai-message-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.ai-message-wrap.user .ai-message-bubble {
    background: var(--color-accent);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.ai-message-wrap.assistant .ai-message-bubble {
    background: var(--color-surface-secondary, #f9fafb);
    border: 1px solid var(--color-border);
    color: var(--color-text-primary);
    border-bottom-left-radius: 4px;
}

/* Thinking indicator */
.ai-thinking {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 18px;
}

.thinking-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-text-tertiary);
    animation: pulse 1.2s ease-in-out infinite;
}

.thinking-dot:nth-child(2) { animation-delay: 0.2s; }
.thinking-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes pulse {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1); }
}

/* Input area */
.ai-input-area {
    border-top: 1px solid var(--color-border);
    padding-top: 16px;
    flex-shrink: 0;
}

.ai-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    color: var(--color-text-primary);
    background: var(--color-surface);
    line-height: 1.5;
}

.ai-textarea:focus {
    outline: none;
    border-color: var(--color-accent);
}

.ai-input-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.ai-input-hint {
    font-size: 12px;
    color: var(--color-text-tertiary);
}

/* Planning Coach panel */
.coach-panel {
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--color-surface);
    margin-top: 24px;
}

.coach-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    width: 100%;
    text-align: left;
    background: var(--color-surface-secondary, #f9fafb);
    border: none;
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.coach-panel.collapsed .coach-toggle {
    border-bottom: none;
}

.coach-content {
    display: flex;
    flex-direction: column;
}

.coach-messages {
    max-height: 300px;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.coach-msg {
    display: flex;
}

.coach-msg.user { justify-content: flex-end; }
.coach-msg.assistant { justify-content: flex-start; }

.coach-msg-bubble {
    max-width: 80%;
    padding: 9px 13px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.coach-msg.user .coach-msg-bubble {
    background: var(--color-accent);
    color: #fff;
}

.coach-msg.assistant .coach-msg-bubble {
    background: var(--color-surface-secondary, #f9fafb);
    border: 1px solid var(--color-border);
    color: var(--color-text-primary);
}

.coach-thinking {
    color: var(--color-text-tertiary);
    font-style: italic;
}

.coach-input-row {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--color-border);
}

.coach-textarea {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    resize: none;
    background: var(--color-surface);
    color: var(--color-text-primary);
}

.coach-send {
    align-self: flex-end;
    font-size: 13px;
    padding: 8px 16px;
}

.coach-disabled {
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 16px;
    font-size: 13px;
    color: var(--color-text-secondary);
    background: var(--color-surface-secondary, #f9fafb);
    margin-top: 24px;
}

.coach-disabled p { margin: 0; }
.coach-disabled a { color: var(--color-accent); }
