/* ==========================================================================
   VELTRON AI CHAT WIDGET (site-wide floating assistant)
   Scoped with a vac- prefix to avoid collisions with page styles.
   ========================================================================== */

.vac-root {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 9980;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

/* --- Launcher bubble --- */
.vac-bubble {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: linear-gradient(145deg, #e00000, #a30000);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55), 0 0 0 0 rgba(212, 0, 0, 0.45);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

.vac-bubble:hover {
    transform: scale(1.07);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 0 8px rgba(212, 0, 0, 0.12);
}

.vac-bubble:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

.vac-bubble.is-open {
    transform: scale(0.92);
}

@media (prefers-reduced-motion: no-preference) {
    .vac-bubble:not(.is-open) {
        animation: vac-pulse 3.4s ease-in-out infinite;
    }
}

@keyframes vac-pulse {
    0%, 100% { box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55), 0 0 0 0 rgba(212, 0, 0, 0.4); }
    50% { box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55), 0 0 0 11px rgba(212, 0, 0, 0); }
}

/* --- Hint pill --- */
.vac-hint {
    position: absolute;
    right: 74px;
    bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px 10px 16px;
    border-radius: 999px;
    background: #1a1a1a;
    border: 1px solid #2c2c2c;
    color: #eaeaea;
    font-size: 13.5px;
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    opacity: 0;
    transform: translateX(10px) scale(0.96);
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.vac-hint.is-visible {
    opacity: 1;
    transform: translateX(0) scale(1);
    pointer-events: auto;
}

.vac-hint.is-hidden {
    display: none;
}

.vac-hint-close {
    background: transparent;
    border: none;
    color: #8a8a8a;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 4px;
}

.vac-hint-close:hover { color: #fff; }

/* --- Panel --- */
.vac-panel {
    position: absolute;
    right: 0;
    bottom: 74px;
    width: 380px;
    height: min(560px, calc(100vh - 120px));
    display: flex;
    flex-direction: column;
    background: #121212;
    border: 1px solid #262626;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
    opacity: 0;
    transform: translateY(16px) scale(0.96);
    transform-origin: bottom right;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.28s ease, transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.32s;
}

.vac-panel.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    visibility: visible;
}

/* Header */
.vac-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 13px 14px;
    background: linear-gradient(180deg, #1b1b1b, #161616);
    border-bottom: 1px solid #262626;
}

.vac-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.vac-title {
    color: #f2f2f2;
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.vac-exp-tag {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9a9a9a;
    border: 1px solid #333;
    border-radius: 999px;
    padding: 2px 7px;
}

.vac-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #555;
    flex: none;
}

.vac-status-dot.is-ok { background: #2ecc71; }
.vac-status-dot.is-error { background: #e74c3c; }
.vac-status-dot.is-loading { background: #f39c12; animation: vac-blink 1s ease-in-out infinite; }

@keyframes vac-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.vac-header-right { display: flex; gap: 4px; }

.vac-icon-btn {
    background: transparent;
    border: none;
    color: #9a9a9a;
    font-size: 17px;
    line-height: 1;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.vac-icon-btn:hover {
    background: #242424;
    color: #fff;
}

/* Log */
.vac-log {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
}

.vac-msg {
    max-width: 88%;
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.45;
}

.vac-msg-user {
    align-self: flex-end;
    background: #b00000;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.vac-msg-assistant {
    align-self: flex-start;
    background: #1e1e1e;
    color: #e6e6e6;
    border: 1px solid #2a2a2a;
    border-bottom-left-radius: 4px;
}

.vac-msg-error {
    align-self: flex-start;
    background: #2a1414;
    color: #f0b0b0;
    border: 1px solid #4a1f1f;
    border-bottom-left-radius: 4px;
}

.vac-msg-text {
    white-space: pre-wrap;
    word-break: break-word;
}

.vac-msg-meta {
    margin-top: 5px;
    font-size: 10.5px;
    color: #7d7d7d;
    letter-spacing: 0.02em;
}

/* Typing indicator */
.vac-typing {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 12px 14px;
}

.vac-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #777;
    animation: vac-dot 1.2s ease-in-out infinite;
}

.vac-typing span:nth-child(2) { animation-delay: 0.15s; }
.vac-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes vac-dot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
    30% { transform: translateY(-3px); opacity: 1; }
}

/* Chips */
.vac-chips {
    padding: 0 14px 8px;
    display: flex;
    gap: 8px;
}

.vac-chip {
    background: transparent;
    border: 1px solid #333;
    color: #bdbdbd;
    font-size: 12px;
    padding: 6px 11px;
    border-radius: 999px;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.vac-chip:hover {
    border-color: #D40000;
    color: #fff;
    background: rgba(212, 0, 0, 0.08);
}

/* Form */
.vac-form {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid #262626;
    background: #151515;
    position: relative;
}

.vac-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.vac-input {
    flex: 1;
    min-width: 0;
    background: #1e1e1e;
    border: 1px solid #2e2e2e;
    border-radius: 10px;
    color: #ececec;
    font-size: 13.5px;
    padding: 10px 12px;
    outline: none;
    transition: border-color 0.15s ease;
}

.vac-input::placeholder { color: #6f6f6f; }

.vac-input:focus { border-color: #D40000; }

.vac-send {
    background: #D40000;
    border: none;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 0 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.vac-send:hover:not(:disabled) { background: #b80000; }

.vac-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Footer */
.vac-foot {
    padding: 7px 14px 9px;
    font-size: 10px;
    color: #6b6b6b;
    text-align: center;
    background: #151515;
    border-top: 1px solid #1f1f1f;
}

/* --- Responsive --- */
@media (max-width: 560px) {
    .vac-root { right: 14px; bottom: 14px; }
    .vac-panel {
        width: calc(100vw - 28px);
        height: min(520px, calc(100vh - 100px));
        bottom: 70px;
    }
    .vac-hint {
        right: auto;
        left: 0;
        bottom: 70px;
        max-width: calc(100vw - 28px);
        white-space: normal;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vac-panel,
    .vac-hint,
    .vac-bubble {
        transition: none;
    }
    .vac-bubble:not(.is-open) { animation: none; }
}
