/* TENT AI features (assistant bubble, trip planner, visa checklist). Uses the theme's --tv-* variables. */

.tvai { position: fixed; bottom: 22px; inset-inline-start: 22px; z-index: 1060; font-family: inherit; }
.tvai-fab {
    width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer;
    background: var(--tv-gradient-brand, #B07214); color: var(--tv-on-gold, #0E2439);
    box-shadow: var(--tv-shadow-brand, 0 12px 28px rgba(148, 96, 16,.28));
    display: grid; place-items: center; transition: transform .2s ease;
}
.tvai-fab:hover { transform: translateY(-2px) scale(1.04); }
.tvai.is-open .tvai-fab { transform: scale(.92); }

.tvai-panel {
    position: absolute; bottom: 72px; inset-inline-start: 0;
    width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 120px));
    display: flex; flex-direction: column; overflow: hidden;
    background: var(--tv-card-bg, #fff); color: var(--tv-card-text, #0E2439);
    border: 1px solid var(--tv-border, #DCE3EC); border-radius: 18px;
    box-shadow: var(--tv-shadow-lg, 0 24px 60px rgba(14, 36, 57,.16));
}
.tvai-panel[hidden] { display: none; }
.tvai-head {
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    padding: 14px 16px; background: var(--tv-gradient-page, #0E2439); color: #fff;
}
.tvai-head strong { display: block; font-size: 15px; }
.tvai-head small { display: block; opacity: .75; font-size: 12px; }
.tvai-head-actions { display: flex; gap: 4px; }
.tvai-head-actions button {
    background: rgba(255,255,255,.1); color: #fff; border: 0; width: 32px; height: 32px;
    border-radius: 8px; cursor: pointer; font-size: 18px; line-height: 1;
}
.tvai-head-actions button:hover { background: rgba(255,255,255,.2); }

.tvai-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.tvai-msg { max-width: 88%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.6; word-wrap: break-word; }
.tvai-bot { align-self: flex-start; background: var(--tv-section-bg, #F1F5F9); color: var(--tv-card-text, #0E2439); border-start-start-radius: 4px; }
.tvai-user { align-self: flex-end; background: var(--tv-primary, #B07214); color: var(--tv-on-gold, #0E2439); border-start-end-radius: 4px; }
.tvai-err { background: #fdecea; color: #8a1c13; }
.tvai-msg a { color: var(--tv-primary-dark, #946010); font-weight: 700; text-decoration: underline; }
.tvai-wait { opacity: .8; }
.tvai-dots { display: inline-flex; gap: 3px; vertical-align: middle; }
.tvai-dots i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .4; animation: tvai-b 1s infinite; }
.tvai-dots i:nth-child(2) { animation-delay: .15s; } .tvai-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes tvai-b { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: .9; transform: translateY(-3px); } }

.tvai-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tvai-chips[hidden] { display: none; }
.tvai-chips button {
    border: 1px solid var(--tv-border, #DCE3EC); background: transparent; color: var(--tv-card-text, #0E2439);
    border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer;
}
.tvai-chips button:hover { border-color: var(--tv-primary, #B07214); color: var(--tv-primary-dark, #946010); }

.tvai-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--tv-border, #DCE3EC); }
.tvai-form textarea {
    flex: 1; resize: none; border: 1px solid var(--tv-border, #DCE3EC); border-radius: 12px; padding: 9px 12px;
    font: inherit; font-size: 14px; background: var(--tv-surface-2, #F7F9FC); color: var(--tv-card-text, #0E2439); max-height: 120px;
}
.tvai-form textarea:focus { outline: none; border-color: var(--tv-primary, #B07214); box-shadow: var(--tv-shadow-focus); }
.tvai-form button {
    width: 42px; border: 0; border-radius: 12px; cursor: pointer;
    background: var(--tv-primary, #B07214); color: var(--tv-on-gold, #0E2439);
}
.tvai-form button:disabled { opacity: .5; cursor: wait; }
[dir=rtl] .tvai-form button svg { transform: scaleX(-1); }
.tvai-note { margin: 0; padding: 0 12px 10px; font-size: 11px; color: var(--tv-card-muted, #536579); text-align: center; }

@media (max-width: 575px) {
    .tvai { bottom: 14px; inset-inline-start: 14px; }
    .tvai-panel { position: fixed; inset: auto 8px 84px 8px; width: auto; height: calc(100vh - 110px); }
}

/* Trip planner + visa checklist */
.tvai-card { background: var(--tv-card-bg, #fff); color: var(--tv-card-text, #0E2439); border: 1px solid var(--tv-border, #DCE3EC); border-radius: 18px; padding: 24px; box-shadow: var(--tv-shadow, none); }
.tvai-plan-days { display: grid; gap: 14px; }
.tvai-day { border-inline-start: 3px solid var(--tv-primary, #B07214); padding: 4px 0 4px 16px; }
[dir=rtl] .tvai-day { padding: 4px 16px 4px 0; }
.tvai-day h5 { margin: 0 0 6px; font-size: 16px; }
.tvai-day p { margin: 0 0 4px; color: var(--tv-card-muted, #536579); font-size: 14px; }
.tvai-day b { color: var(--tv-card-text, #0E2439); }
.tvai-price { font-size: 26px; font-weight: 800; color: var(--tv-primary-dark, #946010); }
.tvai-muted { color: var(--tv-card-muted, #536579); }
.tvai-list { padding-inline-start: 18px; margin: 0; }
.tvai-list li { margin-bottom: 6px; }
.tvai-loading { display: none; align-items: center; gap: 10px; color: var(--tv-card-muted, #536579); }
.tvai-loading.is-on { display: flex; }
.tvai-spin { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--tv-border, #DCE3EC); border-top-color: var(--tv-primary, #B07214); animation: tvai-s .8s linear infinite; }
@keyframes tvai-s { to { transform: rotate(360deg); } }
@media print { .tvai, .site-header, .site-footer, .tvai-noprint { display: none !important; } }
