/* ==================== AI ASSISTANT PAGE ==================== */
.ai-wrapper {
    max-width: 780px;
    margin: 0 auto;
    padding: 32px 24px 100px;
    min-height: 100vh;
}

/* Avatar */
.ai-avatar-section {
    text-align: center;
    padding: 40px 20px 24px;
}

.ai-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    box-shadow: 0 12px 32px rgba(46,125,50,0.35);
    position: relative;
    transition: transform 0.3s;
}

.ai-avatar.listening {
    animation: avatarPulse 1.4s ease infinite;
}

@keyframes avatarPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 12px 32px rgba(46,125,50,0.35); }
    50% { transform: scale(1.06); box-shadow: 0 12px 48px rgba(46,125,50,0.6); }
}

.ai-avatar.speaking {
    animation: avatarBob 0.6s ease infinite;
}

@keyframes avatarBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.ai-avatar::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px solid rgba(46,125,50,0.3);
    opacity: 0;
}

.ai-avatar.listening::before {
    opacity: 1;
    animation: ringExpand 1.4s ease infinite;
}

@keyframes ringExpand {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.3); opacity: 0; }
}

.ai-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-top: 20px;
}

.ai-tagline {
    font-size: 14px;
    color: var(--text-light);
    margin-top: 4px;
}

/* Greeting bubble */
.ai-greeting {
    max-width: 560px;
    margin: 0 auto 24px;
    padding: 18px 24px;
    background: white;
    border-radius: 20px;
    border-bottom-left-radius: 6px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    text-align: center;
    font-size: 16px;
    color: var(--text);
    line-height: 1.5;
    position: relative;
}

.ai-greeting::before {
    content: '💬';
    position: absolute;
    top: -12px;
    left: 24px;
    width: 30px;
    height: 30px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: var(--shadow-sm);
}

/* Conversation log */
.ai-conversation {
    max-width: 640px;
    margin: 0 auto 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 80px;
}

.ai-msg {
    padding: 14px 18px;
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.5;
    max-width: 85%;
    animation: aiMsgIn 0.4s ease;
}

@keyframes aiMsgIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.ai-msg.user {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.ai-msg.ai {
    align-self: flex-start;
    background: white;
    color: var(--text);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow-sm);
}

.ai-msg.detected {
    align-self: center;
    background: #FFF8E1;
    border: 1px solid #FFE082;
    color: #E65100;
    font-size: 13px;
    padding: 8px 16px;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.ai-msg .detected-tag {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(230,81,0,0.15);
    border-radius: 4px;
    font-size: 11px;
    margin-right: 4px;
}

/* Microphone */
.ai-mic-section {
    text-align: center;
    margin-top: 32px;
}

.ai-mic-btn {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    font-size: 40px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 12px 32px rgba(46,125,50,0.4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.ai-mic-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 16px 40px rgba(46,125,50,0.5);
}

.ai-mic-btn.recording {
    background: linear-gradient(135deg, #E53935 0%, #C62828 100%);
    animation: micPulse 1.2s ease infinite;
}

@keyframes micPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(229,57,53,0.5), 0 12px 32px rgba(229,57,53,0.4); }
    50% { box-shadow: 0 0 0 20px rgba(229,57,53,0), 0 12px 32px rgba(229,57,53,0.4); }
}

.ai-mic-hint {
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-light);
}

.ai-mic-hint strong { color: var(--text); }

/* Example chips */
.ai-examples {
    max-width: 680px;
    margin: 32px auto 0;
    text-align: center;
}

.ai-examples h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.example-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.example-chip {
    padding: 10px 18px;
    background: white;
    border: 1.5px solid var(--border);
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.example-chip:hover {
    border-color: var(--primary);
    background: #F1F8E9;
    color: var(--primary);
    transform: translateY(-2px);
}

.example-chip .flag {
    font-size: 16px;
}

/* Guided journey */
.ai-journey-mini {
    max-width: 680px;
    margin: 40px auto 0;
    padding: 24px;
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.ai-journey-mini h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    text-align: center;
}

.journey-mini-flow {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    align-items: center;
}

.journey-mini-node {
    padding: 8px 14px;
    background: var(--bg-alt);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-light);
}

.journey-mini-node.active {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

.journey-mini-arrow {
    color: var(--text-lighter);
    font-size: 12px;
}

/* Not supported warning */
.ai-warning {
    max-width: 640px;
    margin: 20px auto 0;
    padding: 14px 20px;
    background: #FFF8E1;
    border: 1px solid #FFE082;
    border-radius: 12px;
    font-size: 13px;
    color: #E65100;
    text-align: center;
    line-height: 1.5;
}

@media (max-width: 600px) {
    .ai-avatar { width: 96px; height: 96px; font-size: 44px; }
    .ai-name { font-size: 20px; }
    .ai-greeting { font-size: 14.5px; padding: 16px 20px; }
    .ai-mic-btn { width: 84px; height: 84px; font-size: 34px; }
    .ai-msg { font-size: 14px; }
    .example-chip { font-size: 12.5px; padding: 8px 14px; }
}