/*
 * Nexus AI Bot Frontend Styles v5.3.6
 * FIXED - select field styling added to match input/textarea
 */

:root {
    --nexus-primary: #2563eb;
    --nexus-text: #ffffff;
    --nexus-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    --nexus-window-bg: #ffffff;
    --nexus-messages-bg: #f9fafb;
    --nexus-bot-bubble-bg: #eef2f7;
    --nexus-bot-bubble-text: #2c3e50;
    --nexus-border-color: #e5e7eb;
}

/* ==========================================================================
   1. Main Container & Toggle Button
   ========================================================================== */
#nexus-ai-bot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
    font-family: var(--nexus-font);
}

#nexus-ai-bot-toggle {
    width: 64px;
    height: 64px;
    background: var(--nexus-primary);
    background-image: linear-gradient(135deg, var(--nexus-primary) 0%, color-mix(in srgb, var(--nexus-primary) 70%, black) 100%);
    color: var(--nexus-text);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    overflow: hidden;
}

#nexus-ai-bot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}

#nexus-ai-bot-toggle svg {
    position: absolute;
    transition: opacity 0.3s ease, transform 0.3s ease;
    width: 28px;
    height: 28px;
}

#nexus-ai-bot-toggle .icon-close { 
    opacity: 0; 
    transform: rotate(-90deg) scale(0.8); 
}

#nexus-ai-bot-toggle.is-open .icon-chat { 
    opacity: 0; 
    transform: rotate(90deg) scale(0.8); 
}

#nexus-ai-bot-toggle.is-open .icon-close { 
    opacity: 1; 
    transform: rotate(0deg) scale(1); 
}


/* ==========================================================================
   Typing Indicator Animation
   ========================================================================== */

.nexus-typing-indicator {
    animation: nexusTypingSlideIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes nexusTypingSlideIn {
    0% { 
        opacity: 0; 
        transform: translateX(-30px) translateY(20px) scale(0.8); 
    }
    50% {
        opacity: 0.5;
        transform: translateX(-10px) translateY(10px) scale(0.9);
    }
    100% { 
        opacity: 1; 
        transform: translateX(0) translateY(0) scale(1); 
    }
}

.nexus-typing-indicator .nexus-ai-bot-message-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.nexus-typing-indicator .nexus-ai-bot-message-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: nexusShimmer 2s infinite;
}

@keyframes nexusShimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.nexus-typing-indicator .dot {
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, #64748b 0%, #94a3b8 100%);
    flex-shrink: 0;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
    animation: nexusTypingBounce 1.4s infinite ease-in-out;
}

.nexus-typing-indicator .dot:nth-child(1) { animation-delay: 0s; }
.nexus-typing-indicator .dot:nth-child(2) { animation-delay: 0.2s; }
.nexus-typing-indicator .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes nexusTypingBounce {
    0%, 60%, 100% { 
        transform: translateY(0) scale(1); 
        opacity: 0.6; 
    }
    30% { 
        transform: translateY(-10px) scale(1.2); 
        opacity: 1; 
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
    }
}


/* ==========================================================================
   2. Chat Window
   ========================================================================== */
#nexus-ai-bot-window {
    position: absolute;
    bottom: 90px;
    right: 0;
    width: 400px;
    height: 75vh;
    max-height: 650px;
    background: var(--nexus-window-bg);
    border-radius: 16px;
    box-shadow: 0 12px 50px -12px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--nexus-border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
    transform: scale(0.9) translateY(20px);
    pointer-events: none;
}

#nexus-ai-bot-window.is-open {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

/* ==========================================================================
   3. Header
   ========================================================================== */
#nexus-ai-bot-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: var(--nexus-window-bg);
    border-bottom: 1px solid var(--nexus-border-color);
    flex-shrink: 0;
}

.nexus-ai-bot-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--nexus-primary);
    color: var(--nexus-text);
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
}

.nexus-ai-bot-info { 
    flex-grow: 1; 
}

.nexus-ai-bot-info h3 { 
    margin: 0; 
    font-size: 16px; 
    font-weight: 600; 
    color: #1a202c; 
}

.nexus-ai-bot-info span { 
    font-size: 13px; 
    color: #718096; 
    display: flex; 
    align-items: center; 
}

.nexus-ai-bot-info span::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #48bb78;
    border-radius: 50%;
    margin-right: 6px;
    animation: nexusPulse 2s infinite;
}

@keyframes nexusPulse { 
    0%, 100% { box-shadow: 0 0 0 0 rgba(72, 187, 120, 0.4); } 
    70% { box-shadow: 0 0 0 6px rgba(72, 187, 120, 0); } 
}

#nexus-ai-bot-clear {
    background: none;
    border: none;
    color: #a0aec0;
    font-size: 22px;
    cursor: pointer;
    transition: color .2s, transform 0.3s;
    padding: 8px;
}

#nexus-ai-bot-clear:hover { 
    color: #4a5568; 
    transform: rotate(180deg);
}

/* ==========================================================================
   4. Messages Area
   ========================================================================== */
#nexus-ai-bot-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 24px 20px;
    background-color: var(--nexus-messages-bg);
    background-image: radial-gradient(circle, #e5e7eb 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Custom Scrollbar */
#nexus-ai-bot-messages::-webkit-scrollbar { 
    width: 6px; 
}

#nexus-ai-bot-messages::-webkit-scrollbar-track { 
    background: transparent; 
}

#nexus-ai-bot-messages::-webkit-scrollbar-thumb { 
    background-color: #cbd5e0; 
    border-radius: 6px; 
    transition: background-color 0.2s;
}

#nexus-ai-bot-messages::-webkit-scrollbar-thumb:hover { 
    background-color: #a0aec0; 
}

/* Message Base Styles */
.nexus-ai-bot-message {
    display: flex;
    margin-bottom: 2px;
    opacity: 0;
    transform: translateY(30px) scale(0.9);
}

/* User Message Animation - Slide from RIGHT */
.nexus-ai-bot-user-message {
    animation: nexusUserMessageIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes nexusUserMessageIn { 
    0% { 
        opacity: 0; 
        transform: translateX(40px) translateY(20px) scale(0.85); 
    }
    60% {
        transform: translateX(-5px) translateY(0) scale(1.02);
    }
    100% { 
        opacity: 1; 
        transform: translateX(0) translateY(0) scale(1); 
    } 
}

/* Bot Message Animation - Slide from LEFT */
.nexus-ai-bot-bot-message {
    animation: nexusBotMessageIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes nexusBotMessageIn { 
    0% { 
        opacity: 0; 
        transform: translateX(-40px) translateY(20px) scale(0.85); 
    }
    60% {
        transform: translateX(5px) translateY(0) scale(1.02);
    }
    100% { 
        opacity: 1; 
        transform: translateX(0) translateY(0) scale(1); 
    } 
}

.nexus-ai-bot-message + .nexus-ai-bot-message { 
    margin-top: 2px; 
}

.nexus-ai-bot-user-message + .nexus-ai-bot-user-message,
.nexus-ai-bot-bot-message + .nexus-ai-bot-bot-message { 
    margin-top: 4px; 
}

.nexus-ai-bot-user-message a { 
    color: white; 
}

.nexus-ai-bot-message-content {
    max-width: 85%;
    padding: 12px 18px;
    border-radius: 20px;
    font-size: 15px;
    line-height: 1.6;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

/* Shine effect on new messages */
.nexus-ai-bot-message-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: nexusMessageShine 1.5s ease-out;
    pointer-events: none;
}

@keyframes nexusMessageShine {
    0% { left: -100%; }
    60% { left: 100%; }
    100% { left: 100%; }
}

.nexus-ai-bot-message-content:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.nexus-ai-bot-message-content a { 
    color: var(--nexus-primary); 
    text-decoration: underline;
    transition: opacity 0.2s;
}

.nexus-ai-bot-message-content a:hover {
    opacity: 0.8;
}

/* Bot Messages */
.nexus-ai-bot-bot-message { 
    justify-content: flex-start; 
}

.nexus-ai-bot-bot-message .nexus-ai-bot-message-content {
    background: var(--nexus-bot-bubble-bg);
    color: var(--nexus-bot-bubble-text);
    border-bottom-left-radius: 5px;
}

/* User Messages */
.nexus-ai-bot-user-message { 
    justify-content: flex-end; 
}

.nexus-ai-bot-user-message .nexus-ai-bot-message-content {
    background: var(--nexus-primary);
    color: var(--nexus-text);
    border-bottom-right-radius: 5px;
}

/* ==========================================================================
   5. Quick Replies & Input Area
   ========================================================================== */
#nexus-ai-bot-quick-replies {
    padding: 8px 15px 15px;
    background: var(--nexus-window-bg);
    border-top: 1px solid var(--nexus-border-color);
}

.nexus-quick-reply {
    display: inline-block;
    padding: 8px 16px;
    margin: 5px 5px 0 0;
    border: 1px solid color-mix(in srgb, var(--nexus-primary) 30%, transparent);
    color: var(--nexus-primary);
    background: color-mix(in srgb, var(--nexus-primary) 5%, transparent);
    border-radius: 18px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0;
    transform: translateY(10px) scale(0.9);
    animation: nexusQuickReplyIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.nexus-quick-reply:nth-child(1) { animation-delay: 0.1s; }
.nexus-quick-reply:nth-child(2) { animation-delay: 0.2s; }
.nexus-quick-reply:nth-child(3) { animation-delay: 0.3s; }
.nexus-quick-reply:nth-child(4) { animation-delay: 0.4s; }

@keyframes nexusQuickReplyIn { 
    0% { 
        opacity: 0; 
        transform: translateY(15px) scale(0.8);
    }
    100% { 
        opacity: 1; 
        transform: translateY(0) scale(1);
    } 
}

.nexus-quick-reply:hover {
    background: var(--nexus-primary);
    color: var(--nexus-text);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.nexus-quick-reply:active {
    transform: translateY(-1px) scale(1);
}

#nexus-ai-bot-input-container {
    display: flex;
    align-items: flex-end;
    padding: 12px;
    background: var(--nexus-window-bg);
    border-top: 1px solid var(--nexus-border-color);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#nexus-ai-bot-input-container:focus-within {
    border-top-color: var(--nexus-primary);
    box-shadow: 0 -2px 10px rgba(37, 99, 235, 0.1);
}

#nexus-ai-bot-input {
    flex-grow: 1;
    border: none;
    padding: 12px;
    font-size: 15px;
    outline: none;
    resize: none;
    background: transparent;
    max-height: 120px;
    line-height: 1.5;
    transition: transform 0.2s ease;
}

#nexus-ai-bot-send {
    width: 44px;
    height: 44px;
    background: var(--nexus-primary);
    color: var(--nexus-text);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

#nexus-ai-bot-send:hover:not(:disabled) { 
    filter: brightness(1.15); 
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

#nexus-ai-bot-send:active:not(:disabled) {
    transform: scale(0.9) rotate(0deg);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

/* Sending animation for send button */
#nexus-ai-bot-send.sending {
    animation: nexusSendPulse 0.6s ease-out;
}

@keyframes nexusSendPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2) rotate(20deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* Disabled State for Send Button */
#nexus-ai-bot-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(50%);
    background: #9ca3af;
    transform: scale(0.95);
}

#nexus-ai-bot-send:disabled svg {
    opacity: 0.5;
}

#nexus-ai-bot-toggle svg, 
#nexus-ai-bot-send svg { 
    width: 24px; 
    height: 24px;
    transition: transform 0.3s ease;
}

#nexus-ai-bot-send:hover:not(:disabled) svg {
    transform: translateX(2px);
}

/* ==========================================================================
   6. Mobile Responsive Design
   ========================================================================== */
@media (max-width: 500px) {
    #nexus-ai-bot-container { 
        bottom: 0; 
        right: 0; 
        width: 100%; 
        height: 100%; 
        pointer-events: none; 
    }
    
    #nexus-ai-bot-toggle { 
        position: fixed; 
        bottom: 20px; 
        right: 20px; 
        pointer-events: auto; 
    }
    
    #nexus-ai-bot-window {
        position: fixed;
        top: 0;
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        border: none;
        box-shadow: none;
        transform: translateY(105%);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }
    
    #nexus-ai-bot-window.is-open { 
        transform: translateY(0); 
    }
    
    #nexus-ai-bot-header { 
        padding-top: calc(env(safe-area-inset-top) + 16px); 
    }
    
    #nexus-ai-bot-input-container { 
        padding-bottom: calc(env(safe-area-inset-bottom) + 12px); 
    }
}

/* ==========================================================================
   7. Inline Contact Form Styles - FIXED opacity & animation issues
   ========================================================================== */

/* Form container */
.nexus-ai-bot-form-container {
    display: flex;
    justify-content: flex-start;
    width: 100%;
    margin-bottom: 8px;
    opacity: 1 !important;
    animation: nexusBotMessageIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards !important;
}

.nexus-ai-bot-form-container .nexus-ai-bot-message-content {
    background: transparent;
    padding: 0;
    box-shadow: none;
    max-width: 100%;
    width: 100%;
    overflow: visible;
}

.nexus-ai-bot-form-container .nexus-ai-bot-message-content::after {
    display: none;
}

#nexus-ai-bot-contact-form {
    background: var(--nexus-window-bg);
    padding: 20px;
    border: 1px solid var(--nexus-border-color);
    border-radius: 12px;
    animation: nexusFormSlideIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    width: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    opacity: 1;
}

@keyframes nexusFormSlideIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9) rotateX(10deg);
    }
    60% {
        transform: translateY(-5px) scale(1.02) rotateX(0deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotateX(0deg);
    }
}

#nexus-ai-bot-contact-form h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1a202c;
    text-align: center;
}

#nexus-ai-bot-contact-form label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 5px;
    margin-top: 8px;
}

#nexus-ai-bot-contact-form label:first-of-type {
    margin-top: 0;
}

/* ==========================================================================
   7a. Base styles — input, textarea, AND select share identical appearance
   ========================================================================== */

#nexus-ai-bot-contact-form input,
#nexus-ai-bot-contact-form textarea,
#nexus-ai-bot-contact-form select {
    width: 100%;
    padding: 12px;
    margin-bottom: 8px;
    border: 1px solid var(--nexus-border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--nexus-font);
    box-sizing: border-box;
    color: #1a202c;
    background: #ffffff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    opacity: 0;
    transform: translateX(-20px);
    animation: nexusFormFieldIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: var(--nexus-field-delay, 0.1s);
}

/* ==========================================================================
   7b. Stagger delays — works for input, textarea, AND select via shared class
   ========================================================================== */

/* Legacy fallbacks (kept for safety) */
#nexus-ai-bot-contact-form input:nth-child(1),
#nexus-ai-bot-contact-form input:first-of-type  { --nexus-field-delay: 0.15s; }
#nexus-ai-bot-contact-form input:nth-child(2)   { --nexus-field-delay: 0.25s; }
#nexus-ai-bot-contact-form input:nth-child(3)   { --nexus-field-delay: 0.35s; }
#nexus-ai-bot-contact-form textarea             { --nexus-field-delay: 0.30s; }

/* Primary stagger via .nexus-form-field class assigned by JS */
#nexus-ai-bot-contact-form .nexus-form-field:nth-child(1) { --nexus-field-delay: 0.10s; }
#nexus-ai-bot-contact-form .nexus-form-field:nth-child(2) { --nexus-field-delay: 0.20s; }
#nexus-ai-bot-contact-form .nexus-form-field:nth-child(3) { --nexus-field-delay: 0.30s; }
#nexus-ai-bot-contact-form .nexus-form-field:nth-child(4) { --nexus-field-delay: 0.40s; }
#nexus-ai-bot-contact-form .nexus-form-field:nth-child(5) { --nexus-field-delay: 0.50s; }
#nexus-ai-bot-contact-form .nexus-form-field:nth-child(6) { --nexus-field-delay: 0.60s; }
#nexus-ai-bot-contact-form .nexus-form-field:nth-child(7) { --nexus-field-delay: 0.70s; }

@keyframes nexusFormFieldIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==========================================================================
   7c. Focus state — shared by input, textarea, select
   ========================================================================== */

#nexus-ai-bot-contact-form input:focus,
#nexus-ai-bot-contact-form textarea:focus,
#nexus-ai-bot-contact-form select:focus {
    outline: none;
    border-color: var(--nexus-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--nexus-primary) 20%, transparent);
    transform: scale(1.01);
}

/* ==========================================================================
   7d. Select-specific overrides
   Removes native OS chrome and adds a custom chevron arrow
   ========================================================================== */

#nexus-ai-bot-contact-form select {
    /* Strip native OS dropdown styling */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    /* Custom chevron via inline SVG background */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;

    /* Prevent text from overlapping the arrow */
    padding-right: 38px;

    cursor: pointer;
}

/* Arrow turns primary colour on focus */
#nexus-ai-bot-contact-form select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* Placeholder option rendered in muted grey */
#nexus-ai-bot-contact-form select option[value=""] {
    color: #9ca3af;
}

/* Real options in normal text colour */
#nexus-ai-bot-contact-form select option {
    color: #1a202c;
    background: #ffffff;
}

/* ==========================================================================
   7e. Textarea-specific
   ========================================================================== */

#nexus-ai-bot-contact-form textarea {
    resize: vertical;
    min-height: 80px;
}

/* ==========================================================================
   7f. Submit button
   ========================================================================== */

#nexus-ai-bot-contact-form button[type="submit"] {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: var(--nexus-primary);
    color: var(--nexus-text);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin-top: 8px;
    opacity: 0;
    animation: nexusFormFieldIn 0.4s 0.80s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

#nexus-ai-bot-contact-form button[type="submit"]:hover {
    filter: brightness(1.1);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
}

#nexus-ai-bot-contact-form button[type="submit"]:active {
    transform: translateY(0) scale(1);
}

#nexus-ai-bot-contact-form button[type="submit"]:disabled {
    opacity: 0.7;
    cursor: wait;
}

.nexus-form-success {
    background-color: #f0fff4;
    color: #2f855a;
    border: 1px solid #9ae6b4;
    padding: 20px;
    border-radius: 12px;
    animation: nexusSuccessPulse 0.6s ease;
}

@keyframes nexusSuccessPulse {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.05); }
    50% { transform: scale(0.98); }
    75% { transform: scale(1.02); }
}

/* ==========================================================================
   8a. Form Submission Confirmation Card
   ========================================================================== */

.nexus-confirm-card {
    background: var(--nexus-window-bg) !important;
    padding: 0 !important;
    border: 1px solid var(--nexus-border-color) !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    max-width: 90% !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08) !important;
    animation: nexusFormSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards !important;
}

.nexus-confirm-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: color-mix(in srgb, var(--nexus-primary) 10%, #f0f9ff);
    border-bottom: 1px solid color-mix(in srgb, var(--nexus-primary) 20%, transparent);
    font-weight: 600;
    font-size: 13px;
    color: var(--nexus-primary);
}

.nexus-confirm-header svg {
    stroke: var(--nexus-primary);
    flex-shrink: 0;
}

.nexus-confirm-row {
    display: flex;
    flex-direction: column;
    padding: 10px 16px;
    border-bottom: 1px solid var(--nexus-border-color);
    gap: 2px;
}

.nexus-confirm-row:last-child {
    border-bottom: none;
}

.nexus-confirm-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
}

.nexus-confirm-value {
    font-size: 14px;
    color: #1a202c;
    word-break: break-word;
}

/* ==========================================================================
   8b. Mobile Close Button Styles
   ========================================================================== */

.nexus-mobile-close-btn {
    display: none;
    background: none;
    border: none;
    color: currentColor;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    position: relative;
    z-index: 10;
}

.nexus-mobile-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.nexus-mobile-close-btn:active {
    transform: scale(0.95);
}

.nexus-mobile-close-btn svg {
    display: block;
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}

@media (max-width: 768px) {
    .nexus-mobile-close-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    #nexus-ai-bot-header {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .nexus-ai-bot-info {
        flex: 1;
    }

    #nexus-ai-bot-window {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        border-radius: 0;
        z-index: 999999;
    }

    #nexus-ai-bot-container.open #nexus-ai-bot-toggle {
        display: none;
    }
}

@media (max-width: 480px) {
    .nexus-mobile-close-btn {
        padding: 12px;
    }

    .nexus-mobile-close-btn svg {
        width: 18px;
        height: 18px;
    }
}