/* =====================================================
   NOVARIDE PREMIUM AI CHATBOT - APPLE/TESLA LEVEL DESIGN v2.0
   Ultra-Premium Glassmorphism with World-Class Polish
   ===================================================== */

/* CSS Variables for Chatbot - Premium Palette */
:root {
    /* Backgrounds */
    --chat-bg: linear-gradient(165deg, rgba(18, 18, 22, 0.98) 0%, rgba(8, 8, 12, 0.99) 100%);
    --chat-bg-solid: rgba(12, 12, 16, 0.97);
    --chat-glass: rgba(255, 255, 255, 0.035);
    --chat-glass-hover: rgba(255, 255, 255, 0.06);

    /* Borders */
    --chat-border: rgba(255, 255, 255, 0.06);
    --chat-border-subtle: rgba(255, 255, 255, 0.04);
    --chat-border-hover: rgba(255, 255, 255, 0.12);
    --chat-border-focus: rgba(16, 185, 129, 0.3);

    /* Accent Colors */
    --chat-green: #10b981;
    --chat-green-light: #34d399;
    --chat-green-dark: #059669;
    --chat-green-glow: rgba(16, 185, 129, 0.15);
    --chat-green-subtle: rgba(16, 185, 129, 0.08);

    /* Typography */
    --chat-text-primary: rgba(255, 255, 255, 0.95);
    --chat-text-secondary: rgba(255, 255, 255, 0.65);
    --chat-text-muted: rgba(255, 255, 255, 0.4);

    /* Radii */
    --chat-radius: 28px;
    --chat-radius-lg: 24px;
    --chat-radius-md: 18px;
    --chat-radius-sm: 14px;

    /* Shadows - Premium Depth */
    --chat-shadow-xl:
        0 32px 100px rgba(0, 0, 0, 0.65),
        0 16px 40px rgba(0, 0, 0, 0.35),
        0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    --chat-shadow-btn:
        0 12px 40px rgba(16, 185, 129, 0.35),
        0 4px 12px rgba(16, 185, 129, 0.25);
    --chat-shadow-message:
        0 4px 24px rgba(0, 0, 0, 0.2);

    /* Transitions */
    --chat-transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --chat-transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =====================================================
   FLOATING BUTTON - Premium Alive Feel
   ===================================================== */
.nova-chat-btn {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 90px;
    height: 90px;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--chat-transition);
    animation: nova-breathe 4s ease-in-out infinite;
}

/* Subtle breathing animation - More refined than floating */
@keyframes nova-breathe {

    0%,
    100% {
        transform: scale(1) translateY(0);
    }

    50% {
        transform: scale(1.03) translateY(-4px);
    }
}

.nova-chat-btn:hover {
    transform: scale(1.12) translateY(-6px);
    animation-play-state: paused;
}

.nova-chat-btn:active {
    transform: scale(0.95);
}

.nova-chat-btn.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.5) translateY(20px);
}

/* PNG Icon with Glow Effect */
.nova-chat-btn .nova-btn-icon {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    transition: var(--chat-transition);
    filter: drop-shadow(0 8px 24px rgba(16, 185, 129, 0.35));
}

.nova-chat-btn:hover .nova-btn-icon {
    transform: rotate(-8deg) scale(1.08);
    filter: drop-shadow(0 12px 32px rgba(16, 185, 129, 0.45));
}

/* Premium Tooltip */
.nova-chat-btn::before {
    content: 'Parlez à Nova ✨';
    position: absolute;
    right: calc(100% + 16px);
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #fff;
    padding: 12px 18px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(8px);
    transition: var(--chat-transition);
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.nova-chat-btn:hover::before {
    opacity: 1;
    transform: translateX(0);
}

/* =====================================================
   CHAT WINDOW - Ultra Premium Glassmorphism
   ===================================================== */
.nova-chat-window {
    position: fixed;
    bottom: 120px;
    right: 32px;
    width: 400px;
    max-width: calc(100vw - 48px);
    height: 620px;
    max-height: calc(100vh - 160px);
    background: var(--chat-bg);
    backdrop-filter: blur(60px) saturate(180%);
    -webkit-backdrop-filter: blur(60px) saturate(180%);
    border: 1px solid var(--chat-border);
    border-radius: var(--chat-radius);
    box-shadow: var(--chat-shadow-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(24px) scale(0.96);
    transition: var(--chat-transition);
}

.nova-chat-window::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.15) 20%,
            rgba(255, 255, 255, 0.15) 80%,
            transparent 100%);
    pointer-events: none;
}

.nova-chat-window.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* =====================================================
   CHAT HEADER - Apple-Level Premium Design
   World-Class Glassmorphism & Refined Aesthetics
   ===================================================== */
.nova-chat-header {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 20px 24px;
    background: linear-gradient(180deg,
            rgba(20, 20, 24, 0.98) 0%,
            rgba(16, 18, 22, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    overflow: hidden;
}

/* Subtle top highlight line */
.nova-chat-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(16, 185, 129, 0.4) 50%,
            transparent 100%);
}

/* Premium Avatar Container */
.nova-chat-avatar {
    width: 90px;
    height: 90px;
    background: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.nova-chat-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    position: relative;
    z-index: 1;
    transition: opacity 0.15s ease-out;
}

/* Info Section - Premium Typography */
.nova-chat-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nova-chat-name {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.02em;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
}

/* Premium AI Badge with shine effect */
.nova-chat-name .ai-badge {
    font-size: 10px;
    font-weight: 600;
    background: linear-gradient(135deg,
            rgba(16, 185, 129, 0.25) 0%,
            rgba(16, 185, 129, 0.15) 100%);
    color: #34d399;
    padding: 4px 12px;
    border-radius: 100px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border: 1px solid rgba(16, 185, 129, 0.2);
    position: relative;
    overflow: hidden;
}

/* Shine animation on badge */
.nova-chat-name .ai-badge::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.2) 50%,
            transparent 100%);
    animation: badge-shine 3s ease-in-out infinite;
}

@keyframes badge-shine {

    0%,
    100% {
        left: -100%;
    }

    50% {
        left: 100%;
    }
}

/* Status with live indicator */
.nova-chat-status {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.01em;
}

/* Live status dot */
.nova-chat-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: status-pulse 2s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

@keyframes status-pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(0.9);
    }
}

/* Close Button - Minimal & Elegant */
.nova-chat-close {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.4);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.nova-chat-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    transform: scale(1.1);
}

.nova-chat-close:active {
    transform: scale(0.95);
}

.nova-chat-close svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

/* =====================================================
   MESSAGES AREA - Refined & Spacious
   ===================================================== */
.nova-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    scroll-behavior: smooth;
}

/* Premium Scrollbar */
.nova-chat-messages::-webkit-scrollbar {
    width: 5px;
}

.nova-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.nova-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

.nova-chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Message Bubbles - Premium */
.nova-message {
    max-width: 82%;
    animation: message-slide-in 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes message-slide-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.nova-message.bot {
    align-self: flex-start;
}

.nova-message.user {
    align-self: flex-end;
}

.nova-message-content {
    padding: 16px 20px;
    border-radius: var(--chat-radius-md);
    font-size: 14.5px;
    line-height: 1.65;
    position: relative;
    letter-spacing: 0.01em;
}

/* Bot Message - Refined Glass */
.nova-message.bot .nova-message-content {
    background: var(--chat-glass);
    border: 1px solid var(--chat-border);
    color: var(--chat-text-primary);
    border-bottom-left-radius: 6px;
    box-shadow: var(--chat-shadow-message);
}

/* User Message - Premium Gradient */
.nova-message.user .nova-message-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #000;
    font-weight: 500;
    border-bottom-right-radius: 6px;
    box-shadow:
        0 6px 24px rgba(16, 185, 129, 0.35),
        0 2px 8px rgba(16, 185, 129, 0.2);
}

.nova-message-time {
    font-size: 11px;
    color: var(--chat-text-muted);
    margin-top: 8px;
    display: block;
    font-weight: 400;
}

.nova-message.user .nova-message-time {
    text-align: right;
}

/* Typing Indicator - Premium */
.nova-typing {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 16px 20px;
    background: var(--chat-glass);
    border: 1px solid var(--chat-border);
    border-radius: var(--chat-radius-md);
    border-bottom-left-radius: 6px;
    width: fit-content;
}

.nova-typing span {
    width: 9px;
    height: 9px;
    background: linear-gradient(135deg, var(--chat-green) 0%, var(--chat-green-dark) 100%);
    border-radius: 50%;
    animation: typing-wave 1.6s ease-in-out infinite;
}

.nova-typing span:nth-child(2) {
    animation-delay: 0.15s;
}

.nova-typing span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes typing-wave {

    0%,
    60%,
    100% {
        transform: translateY(0) scale(1);
        opacity: 0.35;
    }

    30% {
        transform: translateY(-8px) scale(1.1);
        opacity: 1;
    }
}

/* =====================================================
   INPUT AREA - Premium & Polished
   ===================================================== */
.nova-chat-input-area {
    padding: 20px 26px 24px;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.25) 100%);
    border-top: 1px solid var(--chat-border-subtle);
}

.nova-chat-input-wrapper {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--chat-border);
    border-radius: var(--chat-radius-md);
    padding: 6px 6px 6px 20px;
    transition: var(--chat-transition-fast);
}

.nova-chat-input-wrapper:focus-within {
    border-color: var(--chat-border-focus);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.08);
}

/* Character Counter - Top Right of Input Area */
.nova-char-counter {
    display: block;
    text-align: right;
    font-size: 11px;
    color: var(--chat-text-muted);
    padding: 0 4px 6px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    transition: color 0.25s ease;
}

.nova-char-counter.warning {
    color: #f87171;
}

.nova-chat-input {
    flex: 1;
    background: transparent !important;
    border: none !important;
    color: var(--chat-text-primary);
    font-size: 15px;
    outline: none !important;
    padding: 12px 0;
    font-family: inherit;
    box-shadow: none !important;
    font-weight: 400;
}

.nova-chat-input::placeholder {
    color: var(--chat-text-muted);
}

/* Send Button - Premium Glow */
.nova-chat-send {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    border-radius: var(--chat-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    transition: var(--chat-transition);
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.nova-chat-send:hover {
    transform: scale(1.06);
    box-shadow: var(--chat-shadow-btn);
}

.nova-chat-send:active {
    transform: scale(0.95);
}

.nova-chat-send svg {
    width: 22px;
    height: 22px;
}

/* =====================================================
   QUICK ACTIONS - Ultra Premium World-Class Design
   Luxurious Grid with Animated Gradient Borders
   ===================================================== */
.nova-quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 18px;
    padding: 4px;
}

/* Premium Quick Action Button */
.nova-quick-btn {
    position: relative;
    background: linear-gradient(145deg,
            rgba(255, 255, 255, 0.06) 0%,
            rgba(255, 255, 255, 0.02) 50%,
            rgba(16, 185, 129, 0.04) 100%);
    border: none;
    color: var(--chat-text-secondary);
    padding: 14px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    overflow: hidden;
    isolation: isolate;
    letter-spacing: 0.02em;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    word-break: break-word;
    line-height: 1.3;
}

/* Animated Gradient Border */
.nova-quick-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 1.5px;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.15) 0%,
            rgba(16, 185, 129, 0.3) 25%,
            rgba(255, 255, 255, 0.08) 50%,
            rgba(16, 185, 129, 0.25) 75%,
            rgba(255, 255, 255, 0.12) 100%);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    background-size: 200% 200%;
    animation: gradient-shift 4s ease-in-out infinite;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

@keyframes gradient-shift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* Inner Shine Effect */
.nova-quick-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.08) 50%,
            transparent 100%);
    transition: left 0.6s ease;
    z-index: -1;
}

/* Hover State - Premium Experience */
.nova-quick-btn:hover {
    background: linear-gradient(145deg,
            rgba(16, 185, 129, 0.12) 0%,
            rgba(16, 185, 129, 0.06) 50%,
            rgba(16, 185, 129, 0.15) 100%);
    color: var(--chat-green-light);
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        0 8px 32px rgba(16, 185, 129, 0.25),
        0 4px 12px rgba(16, 185, 129, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.nova-quick-btn:hover::before {
    opacity: 1;
    background: linear-gradient(135deg,
            rgba(16, 185, 129, 0.5) 0%,
            rgba(52, 211, 153, 0.4) 25%,
            rgba(16, 185, 129, 0.6) 50%,
            rgba(5, 150, 105, 0.5) 75%,
            rgba(16, 185, 129, 0.45) 100%);
    animation: gradient-shift 2s ease-in-out infinite;
}

.nova-quick-btn:hover::after {
    left: 100%;
}

/* Active/Click State */
.nova-quick-btn:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow:
        0 4px 16px rgba(16, 185, 129, 0.2),
        0 2px 8px rgba(16, 185, 129, 0.1);
}

/* Focus State for Accessibility */
.nova-quick-btn:focus {
    outline: none;
    box-shadow:
        0 0 0 3px rgba(16, 185, 129, 0.2),
        0 8px 32px rgba(16, 185, 129, 0.2);
}

/* Staggered Animation on Load */
.nova-quick-btn:nth-child(1) {
    animation: btn-fade-in 0.5s 0.1s both;
}

.nova-quick-btn:nth-child(2) {
    animation: btn-fade-in 0.5s 0.2s both;
}

.nova-quick-btn:nth-child(3) {
    animation: btn-fade-in 0.5s 0.3s both;
}

.nova-quick-btn:nth-child(4) {
    animation: btn-fade-in 0.5s 0.4s both;
}

@keyframes btn-fade-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Premium Icon Support (if icons are added) */
.nova-quick-btn svg,
.nova-quick-btn .btn-icon {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.nova-quick-btn:hover svg,
.nova-quick-btn:hover .btn-icon {
    opacity: 1;
    transform: scale(1.1);
}

/* Human Escalation - Premium WhatsApp Style */
.nova-human-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px;
    margin-top: 14px;
    background: rgba(37, 211, 102, 0.06);
    border: 1px solid rgba(37, 211, 102, 0.15);
    border-radius: var(--chat-radius-sm);
    color: rgba(37, 211, 102, 0.8);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--chat-transition-fast);
}

.nova-human-btn:hover {
    background: rgba(37, 211, 102, 0.12);
    border-color: rgba(37, 211, 102, 0.35);
    color: #25d366;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(37, 211, 102, 0.15);
}

.nova-human-btn svg {
    width: 20px;
    height: 20px;
}

/* =====================================================
   WELCOME MESSAGE - Premium Styling
   ===================================================== */
.nova-welcome {
    text-align: center;
    padding: 24px;
}

.nova-welcome-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--chat-text-primary);
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.nova-welcome-subtitle {
    font-size: 14px;
    color: var(--chat-text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

/* =====================================================
   MARKDOWN SUPPORT - Premium Typography
   ===================================================== */
.nova-message-content strong {
    font-weight: 700;
    color: var(--chat-green-light);
}

.nova-message-content em {
    font-style: italic;
    color: var(--chat-text-secondary);
}

.nova-message-content a {
    color: var(--chat-green);
    text-decoration: none;
    border-bottom: 1px solid rgba(16, 185, 129, 0.3);
    transition: var(--chat-transition-fast);
}

.nova-message-content a:hover {
    border-bottom-color: var(--chat-green);
}

.nova-message-content ul,
.nova-message-content ol {
    margin: 10px 0;
    padding-left: 22px;
}

.nova-message-content li {
    margin: 6px 0;
}

.nova-message-content code {
    background: rgba(255, 255, 255, 0.08);
    padding: 3px 8px;
    border-radius: 6px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 13px;
}

/* =====================================================
   MOBILE RESPONSIVE - Full Premium Experience
   ===================================================== */
@media (max-width: 500px) {
    .nova-chat-btn {
        bottom: 24px;
        /* Aligned with scroll arrow on left */
        right: 20px;
        width: 70px;
        height: 70px;
        transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    /* ─────────────────────────────────────────
       DYNAMIC POSITIONING - Apple-Level Smart Layout
       When sticky CTA is visible, chatbot moves up
       ───────────────────────────────────────── */
    .nova-chat-btn.cta-visible {
        bottom: 90px;
        /* Raised above sticky CTA button */
    }

    /* When inside hero sections, move chatbot above spec cards */
    .nova-chat-btn.in-hero {
        bottom: 110px;
    }

    .nova-chat-btn .nova-btn-icon {
        width: 70px;
        height: 70px;
    }

    .nova-chat-btn::before {
        display: none;
    }

    .nova-chat-window {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        border: none;
    }

    .nova-chat-window.active {
        border-radius: 0;
    }

    .nova-chat-header {
        padding: 18px 20px;
        padding-top: max(18px, env(safe-area-inset-top));
    }

    .nova-chat-messages {
        padding: 20px;
    }

    .nova-chat-input-area {
        padding: 16px 20px;
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }

    .nova-message {
        max-width: 88%;
    }

    /* Quick Actions - Mobile Optimization */
    .nova-quick-actions {
        gap: 10px;
        margin-top: 14px;
    }

    .nova-quick-btn {
        padding: 12px 10px;
        font-size: 11.5px;
        border-radius: 14px;
    }

    .nova-quick-btn:hover {
        transform: translateY(-2px) scale(1.01);
    }
}

/* =====================================================
   REDUCED MOTION - Accessibility
   ===================================================== */
@media (prefers-reduced-motion: reduce) {

    .nova-chat-btn,
    .nova-chat-window,
    .nova-message,
    .nova-typing span,
    .nova-quick-btn,
    .nova-quick-btn::before,
    .nova-quick-btn::after {
        animation: none;
        transition: opacity 0.2s ease;
    }
}

/* =====================================================
   TYPEWRITER EFFECT - ChatGPT Style
   ===================================================== */
.typewriter-cursor {
    display: inline;
    color: var(--chat-green);
    animation: cursor-blink 0.8s ease-in-out infinite;
    font-weight: 300;
    margin-left: 1px;
}

@keyframes cursor-blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

/* =====================================================
   PULSE ANIMATION - For Frustration Escalation
   ===================================================== */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.03);
    }

    100% {
        transform: scale(1);
    }
}

.nova-human-btn.pulse-highlight {
    animation: pulse 0.6s ease-in-out 3;
    box-shadow: 0 0 20px rgba(37, 211, 102, 0.4) !important;
}

/* =====================================================
   PROACTIVE MESSAGES - ULTRA PREMIUM APPLE/TESLA LEVEL
   World-Class Glassmorphism with Cinematic Animations
   ===================================================== */

/* Proactive Bubble Container */
.nova-proactive-bubble {
    position: fixed;
    bottom: 130px;
    right: 100px;
    max-width: 340px;
    z-index: 99999;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) translateX(20px) scale(0.85);
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nova-proactive-bubble.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) translateX(0) scale(1);
}

/* Main Bubble Card - Luxury Glassmorphism */
.nova-proactive-card {
    position: relative;
    background: linear-gradient(165deg,
            rgba(18, 18, 24, 0.92) 0%,
            rgba(12, 12, 18, 0.96) 50%,
            rgba(8, 8, 14, 0.98) 100%);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    padding: 22px 26px;
    border-radius: 24px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animated Gradient Border - Premium Effect */
.nova-proactive-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    padding: 1.5px;
    background: linear-gradient(135deg,
            rgba(16, 185, 129, 0.6) 0%,
            rgba(52, 211, 153, 0.4) 20%,
            rgba(255, 255, 255, 0.15) 40%,
            rgba(16, 185, 129, 0.5) 60%,
            rgba(5, 150, 105, 0.6) 80%,
            rgba(16, 185, 129, 0.4) 100%);
    background-size: 300% 300%;
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: proactive-border-flow 4s ease-in-out infinite;
}

@keyframes proactive-border-flow {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* Top Shine Effect */
.nova-proactive-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.08) 0%,
            rgba(255, 255, 255, 0.02) 50%,
            transparent 100%);
    border-radius: 24px 24px 0 0;
    pointer-events: none;
}

/* Hover State - Premium Lift */
.nova-proactive-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow:
        0 20px 60px rgba(16, 185, 129, 0.25),
        0 8px 25px rgba(0, 0, 0, 0.4),
        0 0 80px rgba(16, 185, 129, 0.15);
}

.nova-proactive-card:hover::before {
    animation: proactive-border-flow 2s ease-in-out infinite;
}

/* Bubble Content - Flexbox Layout for Header Alignment */
.nova-proactive-content {
    position: relative;
    z-index: 2;
}

/* Header Row - Avatar + Title aligned */
.nova-proactive-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

/* Nova Avatar in Bubble - Flexbox Alignment */
.nova-proactive-avatar {
    width: 64px;
    height: 64px;
    min-width: 64px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
}

@keyframes avatar-pulse {

    0%,
    100% {
        box-shadow: none;
        transform: scale(1);
    }

    50% {
        box-shadow: none;
        transform: scale(1.02);
    }
}

.nova-proactive-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Message Text - Luxury Typography */
.nova-proactive-title {
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.nova-proactive-subtitle {
    font-size: 13px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.55);
    margin: 0;
    line-height: 1.45;
    clear: both;
    padding-top: 4px;
}

/* CTA Arrow - Premium Touch */
.nova-proactive-cta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.nova-proactive-cta-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--chat-green);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.nova-proactive-cta-arrow {
    width: 16px;
    height: 16px;
    color: var(--chat-green);
    transition: transform 0.3s ease;
}

.nova-proactive-card:hover .nova-proactive-cta-arrow {
    transform: translateX(4px);
}

/* Close Button - Ultra Minimal */
.nova-proactive-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
    z-index: 10;
}

.nova-proactive-card:hover .nova-proactive-close {
    opacity: 1;
    transform: scale(1);
}

.nova-proactive-close:hover {
    background: rgba(239, 68, 68, 0.2);
}

.nova-proactive-close svg {
    width: 12px;
    height: 12px;
    stroke: rgba(255, 255, 255, 0.5);
    stroke-width: 2.5;
}

.nova-proactive-close:hover svg {
    stroke: #f87171;
}

/* Pointer Arrow to Chat Button */
.nova-proactive-pointer {
    position: absolute;
    bottom: 20px;
    right: -12px;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg,
            rgba(12, 12, 18, 0.96) 0%,
            rgba(8, 8, 14, 0.98) 100%);
    transform: rotate(45deg);
    border-right: 1.5px solid rgba(16, 185, 129, 0.5);
    border-top: 1.5px solid rgba(16, 185, 129, 0.5);
    z-index: 1;
}

/* Chat Button Glow when Proactive Active */
.nova-chat-btn.has-proactive {
    animation: nova-glow-pulse 2s ease-in-out infinite;
}

@keyframes nova-glow-pulse {

    0%,
    100% {
        filter: drop-shadow(0 8px 24px rgba(16, 185, 129, 0.35));
    }

    50% {
        filter: drop-shadow(0 8px 40px rgba(16, 185, 129, 0.6)) drop-shadow(0 0 20px rgba(16, 185, 129, 0.4));
    }
}

/* Notification Dot on Chat Button */
.nova-chat-btn .nova-notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: 2.5px solid rgba(12, 12, 16, 0.95);
    border-radius: 50%;
    opacity: 0;
    transform: scale(0);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10;
}

.nova-chat-btn.has-proactive .nova-notification-dot {
    opacity: 1;
    transform: scale(1);
}

/* Subtle ambient shadow - refined elegance */
.nova-proactive-card {
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.35),
        0 4px 12px rgba(0, 0, 0, 0.2);
}

/* =====================================================
   PROACTIVE MOBILE RESPONSIVE
   ===================================================== */
@media (max-width: 500px) {
    .nova-proactive-bubble {
        bottom: 100px;
        /* Dynamic: above chat button when CTA not visible */
        right: 16px;
        left: 16px;
        max-width: none;
        transition: bottom 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    /* Dynamic positioning when CTA is visible */
    .nova-proactive-bubble.cta-visible {
        bottom: 165px;
        /* Raised when sticky CTA appears */
    }

    .nova-proactive-card {
        padding: 18px 20px;
        border-radius: 20px;
    }

    /* CRITICAL FIX: Make close button ALWAYS visible on mobile (no hover on touch) */
    .nova-proactive-close {
        opacity: 1 !important;
        transform: scale(1) !important;
        background: rgba(255, 255, 255, 0.12);
        width: 28px;
        height: 28px;
    }

    .nova-proactive-close svg {
        width: 14px;
        height: 14px;
        stroke: rgba(255, 255, 255, 0.7);
    }

    .nova-proactive-avatar {
        width: 56px;
        height: 56px;
        min-width: 56px;
    }

    .nova-proactive-title {
        font-size: 14px;
    }

    .nova-proactive-subtitle {
        font-size: 12px;
    }

    .nova-proactive-pointer {
        right: 45px;
    }

    .nova-chat-btn.has-proactive .nova-notification-dot {
        top: 4px;
        right: 4px;
        width: 12px;
        height: 12px;
    }
}

/* =====================================================
   SMART QUICK REPLIES - APPLE-LEVEL PREMIUM v1.0
   Horizontal Scrollable Carousel with Icons
   ===================================================== */

/* Container - Full width with horizontal scroll */
.nova-smart-replies {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 16px 0 8px;
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Inner scrollable area */
.nova-smart-replies-inner {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px 2px 12px;
    margin: -4px -2px -12px;
}

.nova-smart-replies-inner::-webkit-scrollbar {
    display: none;
}

/* Individual Smart Reply Button - Ultra Premium Pill Style */
.nova-smart-reply-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;

    /* Premium Glassmorphism Background */
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.08) 0%,
            rgba(255, 255, 255, 0.03) 50%,
            rgba(16, 185, 129, 0.06) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);

    /* Sleek Pill Shape */
    border: none;
    border-radius: 100px;

    /* Typography */
    font-size: 13px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', sans-serif;
    letter-spacing: 0.01em;
    color: rgba(255, 255, 255, 0.85);
    white-space: nowrap;

    /* Interaction */
    cursor: pointer;
    scroll-snap-align: start;
    isolation: isolate;
    position: relative;
    overflow: hidden;

    /* Smooth Premium Transitions */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    /* Staggered Entry Animation */
    animation: smartReplySlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
    transform: translateX(20px) scale(0.9);
}

/* Staggered Animation Keyframes */
@keyframes smartReplySlideIn {
    0% {
        opacity: 0;
        transform: translateX(20px) scale(0.9);
    }

    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* Animated Gradient Border */
.nova-smart-reply-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 100px;
    padding: 1.2px;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.2) 0%,
            rgba(16, 185, 129, 0.35) 30%,
            rgba(255, 255, 255, 0.1) 60%,
            rgba(16, 185, 129, 0.3) 100%);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    background-size: 200% 200%;
    animation: smartReplyBorderShift 4s ease-in-out infinite;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

@keyframes smartReplyBorderShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* Inner Shimmer Effect on Hover */
.nova-smart-reply-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.12) 50%,
            transparent 100%);
    transition: left 0.6s ease;
    z-index: -1;
}

/* Icon Styling */
.nova-smart-reply-btn .reply-icon {
    font-size: 16px;
    line-height: 1;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Text Styling */
.nova-smart-reply-btn .reply-text {
    font-weight: 500;
    transition: color 0.3s ease;
}

/* ═══ HOVER STATE - PREMIUM EXPERIENCE ═══ */
.nova-smart-reply-btn:hover {
    background: linear-gradient(135deg,
            rgba(16, 185, 129, 0.15) 0%,
            rgba(16, 185, 129, 0.08) 50%,
            rgba(16, 185, 129, 0.18) 100%);
    color: #34d399;
    transform: translateY(-3px) scale(1.03);
    box-shadow:
        0 10px 36px rgba(16, 185, 129, 0.3),
        0 4px 14px rgba(16, 185, 129, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.nova-smart-reply-btn:hover::before {
    opacity: 1;
    background: linear-gradient(135deg,
            rgba(16, 185, 129, 0.6) 0%,
            rgba(52, 211, 153, 0.5) 30%,
            rgba(16, 185, 129, 0.7) 60%,
            rgba(5, 150, 105, 0.55) 100%);
    animation: smartReplyBorderShift 2s ease-in-out infinite;
}

.nova-smart-reply-btn:hover::after {
    left: 100%;
}

.nova-smart-reply-btn:hover .reply-icon {
    transform: scale(1.15) rotate(-5deg);
}

.nova-smart-reply-btn:hover .reply-text {
    color: #6ee7b7;
}

/* ═══ ACTIVE/CLICK STATE ═══ */
.nova-smart-reply-btn:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow:
        0 4px 16px rgba(16, 185, 129, 0.25),
        0 2px 8px rgba(16, 185, 129, 0.15);
    transition-duration: 0.1s;
}

/* ═══ FOCUS STATE - ACCESSIBILITY ═══ */
.nova-smart-reply-btn:focus {
    outline: none;
    box-shadow:
        0 0 0 3px rgba(16, 185, 129, 0.25),
        0 8px 32px rgba(16, 185, 129, 0.2);
}

/* ═══ MOBILE OPTIMIZATIONS ═══ */
@media (max-width: 480px) {
    .nova-smart-replies-inner {
        gap: 8px;
        padding: 4px 0 10px;
    }

    .nova-smart-reply-btn {
        padding: 10px 16px;
        font-size: 12px;
    }

    .nova-smart-reply-btn .reply-icon {
        font-size: 14px;
    }
}

/* =====================================================
   REDUCED MOTION - Proactive Accessibility
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
    .nova-proactive-bubble {
        transition: opacity 0.3s ease;
        transform: none;
    }

    .nova-proactive-bubble.active {
        transform: none;
    }

    .nova-proactive-card::before,
    .nova-proactive-avatar,
    .nova-chat-btn.has-proactive,
    .nova-chat-btn.has-proactive .nova-notification-dot,
    .nova-proactive-particle {
        animation: none;
    }

    /* Smart Replies - Reduced Motion */
    .nova-smart-reply-btn {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .nova-smart-reply-btn::before,
    .nova-smart-reply-btn::after {
        animation: none;
    }
}