/* ============================================================
   AI.CSS — Fullscreen AI Interface with Curved Design
   ============================================================ */

/* ── Fullscreen takeover when AI view is active ── */
#ai-view.active {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    background: #000;
    animation: aiFadeIn 0.35s ease forwards;
}

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

/* ── Curved Header Bar ── */
.ai-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #0a0a0a 0%, #111 100%);
    border-bottom: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 0 0 24px 24px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.6);
    flex-shrink: 0;
    gap: 1rem;
}

/* Back Button — top left, rounded */
.ai-back-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.35);
    color: var(--gold-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    flex-shrink: 0;
}
.ai-back-btn:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--gold-primary);
    transform: translateX(-3px);
}
.ai-back-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
}

/* Title Center */
.ai-header-center {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    justify-content: center;
}
.ai-header-icon {
    display: inline-flex;
    align-items: center;
}
.ai-header-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: var(--gold-primary);
}
.ai-header-name {
    color: var(--gold-primary);
    font-family: var(--font-heading);
    font-size: 1rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Online Status Badge — top right */
.ai-status-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.ai-dot-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #25D366;
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6);
    animation: pulse-green 2s infinite;
    flex-shrink: 0;
}
@keyframes pulse-green {
    0%   { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6); }
    70%  { box-shadow: 0 0 0 8px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}
.ai-status-text {
    font-size: 0.75rem;
    color: #25D366;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ── Chat Area — fills all remaining height ── */
.ai-chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    scroll-behavior: smooth;
}

/* Custom scrollbar */
.ai-chat-area::-webkit-scrollbar { width: 4px; }
.ai-chat-area::-webkit-scrollbar-track { background: transparent; }
.ai-chat-area::-webkit-scrollbar-thumb { background: rgba(212,175,55,0.25); border-radius: 4px; }

/* Message Bubbles */
.ai-msg {
    max-width: 78%;
    padding: 0.9rem 1.3rem;
    font-size: 0.95rem;
    line-height: 1.65;
    border-radius: 18px;
    word-break: break-word;
}
.ai-msg.system {
    align-self: flex-start;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(212,175,55,0.2);
    border-bottom-left-radius: 4px;
    color: var(--text-primary);
}
.ai-msg.user {
    align-self: flex-end;
    background: rgba(212,175,55,0.12);
    border: 1px solid rgba(212,175,55,0.3);
    border-bottom-right-radius: 4px;
    color: var(--gold-primary);
}

/* ── Curved Pill Input Bar at Bottom ── */
.ai-input-wrap {
    padding: 1rem 1.5rem 1.5rem;
    flex-shrink: 0;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ai-input-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(15, 15, 15, 0.95);
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 50px;
    padding: 8px 8px 8px 22px;
    width: 100%;
    max-width: 600px; /* Reduced width */
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.ai-input-pill:focus-within {
    border-color: rgba(212, 175, 55, 0.7);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.08);
}

.ai-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.95rem;
    min-width: 0;
}
.ai-input::placeholder {
    color: rgba(255,255,255,0.3);
}

/* Send Button — round gold circle */
.ai-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gold-primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.25s ease;
}
.ai-send-btn:hover {
    background: #c9a227;
    transform: scale(1.08);
    box-shadow: 0 4px 14px rgba(212,175,55,0.35);
}
.ai-send-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: #000;
}

/* ── Mobile Adjustments ── */
@media (max-width: 768px) {
    .ai-header {
        padding: 0.85rem 1rem;
        border-radius: 0 0 18px 18px;
    }
    .ai-header-name {
        font-size: 0.82rem;
        letter-spacing: 1px;
    }
    .ai-back-btn {
        width: 38px;
        height: 38px;
    }
    .ai-chat-area {
        padding: 1.25rem 1rem 0.75rem;
        gap: 1rem;
    }
    .ai-msg {
        max-width: 90%;
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
    }
    .ai-input-wrap {
        padding: 0.75rem 1rem 1rem;
    }
    .ai-input-pill {
        padding: 6px 6px 6px 16px;
    }
    .ai-input {
        font-size: 0.9rem;
    }
    .ai-send-btn {
        width: 36px;
        height: 36px;
    }
    .ai-send-btn svg {
        width: 16px;
        height: 16px;
    }
}
