/* ===== INPUT AREA & FOOTER =====
 * GetAdvice v5.7 — Glow line above input, enhanced focus states, disabled state.
 * File: css/input.css
 */

#input-area {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: flex-end;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    padding-bottom: var(--space-md);
    /* safe-bottom is provided by .footer-note below; adding it here
       would double the safe-area inset on notched iPhones. */
    background: rgba(5, 2, 8, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    transition: padding-bottom 0.15s var(--ease-out);
}

/* ── v5.1: Glow line above input area ── */
#input-area::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(124, 92, 252, 0.2), rgba(224, 64, 251, 0.15), transparent);
    opacity: 0.6;
}

/* When keyboard is open, reduce bottom padding */
body.keyboard-open #input-area {
    padding-bottom: var(--space-md);
}

#input {
    flex: 1;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-2xl);
    font-size: var(--font-size-input); /* 16px prevents iOS zoom */
    font-family: inherit;
    outline: none;
    resize: none;
    max-height: var(--max-input-height, 120px);
    line-height: 1.4;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
    -webkit-appearance: none;
}

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

#input:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── v5.1: Enhanced focus glow ── */
#input:focus {
    border-color: rgba(124, 92, 252, 0.5);
    box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.12), 0 0 20px rgba(124, 92, 252, 0.08);
    background: rgba(255, 255, 255, 0.06);
}

#send-btn {
    position: relative;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s var(--ease-out);
    box-shadow: 0 4px 16px var(--accent-glow);
}

/* ── v5.1: Glow halo on send button ── */
#send-btn::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: transparent;
    box-shadow: 0 0 16px var(--accent-glow);
    opacity: 0;
    transition: opacity 0.2s var(--ease-out);
    pointer-events: none;
}

#send-btn:hover::after { opacity: 1; }

#send-btn:hover { transform: scale(1.05); box-shadow: 0 6px 24px var(--accent-glow); }
#send-btn:active { transform: scale(0.92); }
#send-btn:focus-visible {
    outline: 2px solid var(--accent-light, #a78bfa);
    outline-offset: 2px;
}
#send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
#send-btn:disabled::after { display: none; }

#send-btn svg { width: 20px; height: 20px; fill: white; }

/* ── Footer disclaimer ── */
.footer-note {
    text-align: center;
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    padding: var(--space-xs) var(--space-lg) var(--space-sm);
    padding-bottom: calc(var(--space-sm) + var(--safe-bottom));
    background: rgba(5, 2, 8, 0.92);
    flex-shrink: 0;
    z-index: 10;
}

body.keyboard-open .footer-note {
    display: none;
}

/* ===== INLINE FEEDBACK PROMPT =====
 * GetAdvice v5.10 — Non-blocking feedback after AI responses.
 * Appears below the AI message bubble, fades in/out.
 */

/* ===== PERSONA BAR =====
 * GetAdvice v5.11 — Horizontal pill selector below header.
 */

.persona-bar {
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: rgba(15, 10, 26, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.persona-bar::-webkit-scrollbar { display: none; }

.persona-pill {
    flex-shrink: 0;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.persona-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}
.persona-pill.active {
    background: var(--accent, #7c5cfc);
    border-color: var(--accent, #7c5cfc);
    color: white;
    font-weight: 600;
}
.persona-pill.locked {
    opacity: 0.5;
    cursor: default;
}
.persona-pill.locked:hover {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
}

.feedback-inline {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    margin: var(--space-xs) 0 var(--space-md);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
    flex-wrap: wrap;
}

.feedback-inline.feedback-visible {
    opacity: 1;
    transform: translateY(0);
}

.feedback-inline.feedback-fade-out {
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}

.feedback-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.feedback-btn {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 4px 10px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.15s var(--ease-out);
    line-height: 1;
}

.feedback-btn:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-glow);
    transform: scale(1.1);
}

.feedback-btn.selected {
    background: rgba(124, 92, 252, 0.15);
    border-color: var(--accent);
    transform: scale(1.15);
}

.feedback-btn.dimmed {
    opacity: 0.35;
    transform: scale(0.95);
}

.feedback-note-wrap {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    width: 100%;
    margin-top: var(--space-xs);
    animation: feedbackNoteIn 0.2s var(--ease-out);
}

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

.feedback-note {
    flex: 1;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: var(--radius-lg);
    font-size: var(--font-size-sm);
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition-fast);
}

.feedback-note:focus {
    border-color: rgba(124, 92, 252, 0.4);
}

.feedback-note::placeholder {
    color: var(--text-muted);
}

.feedback-submit {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 6px 14px;
    font-size: var(--font-size-sm);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s var(--ease-out);
    white-space: nowrap;
}

.feedback-submit:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px var(--accent-glow);
}

.feedback-thanks {
    font-size: var(--font-size-sm);
    color: var(--accent-light);
    animation: feedbackNoteIn 0.3s var(--ease-out);
}
