/* ==========================================================================
   NOVA AI CHATBOT - PROACTIVE AI SYSTEMS
   Enterprise Cyber/Fintech Conversational AI Widget
   ========================================================================== */

:root {
    --nova-primary: #00f0ff;
    --nova-secondary: #7928ca;
    --nova-accent: #00ff88;
    --nova-bg-dark: #090c1f;
    --nova-card-bg: rgba(13, 18, 43, 0.96);
    --nova-glass-border: rgba(0, 240, 255, 0.25);
    --nova-text-main: #ffffff;
    --nova-text-sub: #94a3b8;
    --nova-user-bubble: linear-gradient(135deg, #0070f3, #7928ca);
    --nova-bot-bubble: rgba(22, 29, 66, 0.9);
    --nova-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(0, 240, 255, 0.15);
}

/* Floating Launcher Widget */
.nova-widget-container {
    position: fixed;
    bottom: 25px;
    right: 30px;
    z-index: 99999;
    font-family: 'Outfit', sans-serif;
}

.nova-launcher-btn {
    position: relative;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00f0ff 0%, #32248e 60%, #7928ca 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 30px rgba(0, 240, 255, 0.4), 0 0 20px rgba(121, 40, 202, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 26px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    outline: none;
    user-select: none;
}

.nova-launcher-btn:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 40px rgba(0, 240, 255, 0.6), 0 0 30px rgba(121, 40, 202, 0.6);
}

/* Pulse Rings */
.nova-launcher-ring {
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 50%;
    border: 2px solid rgba(0, 240, 255, 0.6);
    animation: novaPulseRing 2.2s infinite ease-out;
    pointer-events: none;
}

.nova-launcher-ring:nth-child(2) {
    animation-delay: 0.8s;
}

@keyframes novaPulseRing {
    0% {
        transform: scale(0.95);
        opacity: 0.9;
    }
    50% {
        opacity: 0.4;
    }
    100% {
        transform: scale(1.45);
        opacity: 0;
    }
}

/* Launcher Badge & Callout Tooltip */
.nova-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    background: #00ff88;
    color: #050b14;
    font-size: 11px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #090c1f;
    box-shadow: 0 0 10px #00ff88;
}

.nova-callout-bubble {
    position: absolute;
    right: 80px;
    top: 50%;
    transform: translateY(-50%) scale(0.9);
    background: rgba(13, 18, 43, 0.95);
    border: 1px solid rgba(0, 240, 255, 0.35);
    padding: 10px 16px;
    border-radius: 20px;
    white-space: nowrap;
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 240, 255, 0.2);
    backdrop-filter: blur(10px);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nova-callout-bubble::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px 0 6px 6px;
    border-style: solid;
    border-color: transparent transparent transparent rgba(0, 240, 255, 0.35);
}

.nova-callout-bubble.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) scale(1);
    pointer-events: auto;
}

.nova-callout-bubble .sparkle-icon {
    color: #00f0ff;
    animation: novaRotateSparkle 3s linear infinite;
}

@keyframes novaRotateSparkle {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Chat Window Modal */
.nova-chat-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 420px;
    height: 640px;
    max-height: calc(100vh - 120px);
    background: var(--nova-card-bg);
    border: 1px solid var(--nova-glass-border);
    border-radius: 24px;
    box-shadow: var(--nova-shadow);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(30px) scale(0.92);
    transform-origin: bottom right;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 99999;
}

.nova-chat-window.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Chat Header */
.nova-header {
    background: linear-gradient(135deg, rgba(22, 29, 66, 0.95), rgba(9, 12, 31, 0.98));
    border-bottom: 1px solid rgba(0, 240, 255, 0.2);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.nova-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #00f0ff, #7928ca, #00ff88);
}

.nova-avatar-wrap {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00f0ff, #7928ca);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
}

.nova-avatar-pulse {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 12px;
    height: 12px;
    background: #00ff88;
    border-radius: 50%;
    border: 2px solid #090c1f;
    box-shadow: 0 0 8px #00ff88;
}

.nova-header-info {
    flex: 1;
    margin-left: 12px;
}

.nova-bot-name {
    margin: 0;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nova-bot-name span.ai-tag {
    background: rgba(0, 240, 255, 0.15);
    color: #00f0ff;
    border: 1px solid rgba(0, 240, 255, 0.3);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.nova-bot-status {
    margin: 0;
    color: #94a3b8;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nova-bot-status i {
    font-size: 8px;
    color: #00ff88;
    animation: novaBlink 1.5s infinite;
}

@keyframes novaBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.nova-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nova-action-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.nova-action-btn:hover {
    background: rgba(0, 240, 255, 0.2);
    color: #00f0ff;
    border-color: rgba(0, 240, 255, 0.4);
    transform: translateY(-1px);
}

/* Chat Body / Message Stream */
.nova-chat-body {
    flex: 1;
    padding: 20px 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
    background: radial-gradient(circle at top right, rgba(0, 240, 255, 0.05), transparent 60%),
                radial-gradient(circle at bottom left, rgba(121, 40, 202, 0.06), transparent 60%);
}

.nova-chat-body::-webkit-scrollbar {
    width: 5px;
}
.nova-chat-body::-webkit-scrollbar-track {
    background: transparent;
}
.nova-chat-body::-webkit-scrollbar-thumb {
    background: rgba(0, 240, 255, 0.2);
    border-radius: 10px;
}

/* Message Rows */
.nova-msg-row {
    display: flex;
    gap: 10px;
    max-width: 90%;
    animation: novaMsgFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes novaMsgFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.nova-msg-row.bot {
    align-self: flex-start;
}

.nova-msg-row.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.nova-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00f0ff, #7928ca);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 4px;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.nova-msg-avatar.user-avatar {
    background: linear-gradient(135deg, #38ef7d, #11998e);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.nova-msg-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nova-msg-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 13.5px;
    line-height: 1.55;
    word-break: break-word;
    position: relative;
}

.nova-msg-row.bot .nova-msg-bubble {
    background: var(--nova-bot-bubble);
    border: 1px solid rgba(0, 240, 255, 0.15);
    color: #e2e8f0;
    border-top-left-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.nova-msg-row.user .nova-msg-bubble {
    background: var(--nova-user-bubble);
    color: #ffffff;
    border-top-right-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 112, 243, 0.3);
}

.nova-msg-time {
    font-size: 10px;
    color: #64748b;
    align-self: flex-start;
    padding: 0 4px;
}

.nova-msg-row.user .nova-msg-time {
    align-self: flex-end;
}

/* Rich Elements in Bot Messages */
.nova-msg-bubble strong {
    color: #00f0ff;
    font-weight: 600;
}

.nova-msg-bubble ul {
    margin: 8px 0 4px 0;
    padding-left: 18px;
}

.nova-msg-bubble li {
    margin-bottom: 5px;
}

/* Feature Cards inside Chat */
.nova-rich-card {
    margin-top: 10px;
    background: rgba(9, 12, 31, 0.85);
    border: 1px solid rgba(0, 240, 255, 0.25);
    border-radius: 12px;
    padding: 10px 14px;
}

.nova-rich-card h6 {
    color: #00f0ff;
    font-size: 13px;
    margin: 0 0 6px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nova-rich-card p {
    font-size: 12px;
    color: #cbd5e1;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.nova-card-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(90deg, #00f0ff, #7928ca);
    color: #fff !important;
    font-size: 11px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.nova-card-btn:hover {
    opacity: 0.9;
    color: #fff;
}

/* Quick Action Suggestion Chips */
.nova-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.nova-chip {
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid rgba(0, 240, 255, 0.25);
    color: #00f0ff;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 11.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.nova-chip:hover {
    background: rgba(0, 240, 255, 0.2);
    border-color: #00f0ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 240, 255, 0.25);
}

/* Typing Indicator Animation */
.nova-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: var(--nova-bot-bubble);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 18px;
    border-top-left-radius: 4px;
    width: fit-content;
}

.nova-typing-dot {
    width: 6px;
    height: 6px;
    background: #00f0ff;
    border-radius: 50%;
    animation: novaDotBounce 1.4s infinite ease-in-out;
}

.nova-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
    background: #7928ca;
}

.nova-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
    background: #00ff88;
}

@keyframes novaDotBounce {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    40% {
        transform: translateY(-6px);
        opacity: 1;
        box-shadow: 0 0 8px #00f0ff;
    }
}

/* Chat Footer & Input Bar */
.nova-footer {
    padding: 12px 16px;
    background: linear-gradient(180deg, rgba(13, 18, 43, 0.9), rgba(9, 12, 31, 0.98));
    border-top: 1px solid rgba(0, 240, 255, 0.15);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nova-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(22, 29, 66, 0.75);
    border: 1px solid rgba(0, 240, 255, 0.25);
    border-radius: 24px;
    padding: 4px 6px 4px 14px;
    transition: all 0.3s ease;
}

.nova-input-row:focus-within {
    border-color: #00f0ff;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
    background: rgba(22, 29, 66, 0.95);
}

.nova-input-field {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-family: inherit;
    font-size: 13.5px;
}

.nova-input-field::placeholder {
    color: #64748b;
}

.nova-voice-btn,
.nova-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    outline: none;
}

.nova-voice-btn {
    background: transparent;
    color: #94a3b8;
    font-size: 14px;
}

.nova-voice-btn:hover {
    color: #00f0ff;
    background: rgba(0, 240, 255, 0.1);
}

.nova-voice-btn.listening {
    color: #ff0055;
    animation: novaVoicePulse 1s infinite;
}

@keyframes novaVoicePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.nova-send-btn {
    background: linear-gradient(135deg, #00f0ff, #7928ca);
    color: #ffffff;
    font-size: 14px;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

.nova-send-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.7);
}

.nova-footer-credit {
    text-align: center;
    font-size: 10px;
    color: #475569;
}

.nova-footer-credit a {
    color: #00f0ff;
    text-decoration: none;
}

/* Quick Lead Submission Modal Alert */
.nova-lead-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(0, 255, 136, 0.15);
    border: 1px solid rgba(0, 255, 136, 0.4);
    border-radius: 12px;
    color: #00ff88;
    font-size: 12px;
    font-weight: 600;
    margin-top: 6px;
}

/* Responsive Styles */
@media (max-width: 576px) {
    .nova-widget-container {
        bottom: 20px;
        right: 15px;
    }

    .nova-chat-window {
        right: 10px;
        left: 10px;
        bottom: 85px;
        width: auto;
        height: calc(100vh - 110px);
        border-radius: 20px;
    }

    .nova-callout-bubble {
        display: none;
    }
}
