/* ========================================================
   AI Chat Assistant Styles
   ======================================================== */
#sm-ai-chat-container {
    position: relative;
    z-index: 99999;
}

/* Proactive Nudge Toast Bubble */
.sm-ai-nudge {
    position: fixed;
    bottom: 86px;
    right: 24px;
    z-index: 99997;
    max-width: 320px;
    background: #ffffff;
    border: 1.5px solid #0284c7;
    border-radius: 16px;
    box-shadow: 0 12px 35px rgba(2, 132, 199, 0.22), 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 12px 14px;
    cursor: pointer;
    animation: smNudgeSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: all 0.2s ease;
}

.sm-ai-nudge:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(2, 132, 199, 0.3);
    border-color: #0369a1;
}

@keyframes smNudgeSlideIn {
    0% {
        opacity: 0;
        transform: translateY(14px) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.sm-ai-nudge-close {
    position: absolute;
    top: 6px;
    right: 8px;
    background: transparent;
    border: none;
    font-size: 16px;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 50%;
    transition: all 0.15s ease;
}

.sm-ai-nudge-close:hover {
    color: #0f172a;
    background: #f1f5f9;
}

.sm-ai-nudge-content {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.sm-ai-nudge-avatar {
    position: relative;
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #0e5c7a 0%, #127399 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.sm-ai-nudge-online {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 9px;
    height: 9px;
    background: #22c55e;
    border: 2px solid #ffffff;
    border-radius: 50%;
}

.sm-ai-nudge-body {
    flex: 1;
    padding-right: 14px;
}

.sm-ai-nudge-author {
    font-size: 0.72rem;
    font-weight: 700;
    color: #127399;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.sm-ai-nudge-text {
    font-size: 0.82rem;
    color: #1e293b;
    line-height: 1.4;
    margin-bottom: 6px;
}

.sm-ai-nudge-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    border-top: 1px dashed #e2e8f0;
    padding-top: 6px;
    margin-top: 4px;
}

.sm-ai-nudge-cta {
    font-size: 0.74rem;
    font-weight: 700;
    color: #0284c7;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sm-ai-nudge-cta:hover {
    color: #0369a1;
}

@media (max-width: 576px) {
    .sm-ai-nudge {
        bottom: 82px;
        right: 16px;
        left: 16px;
        max-width: none;
    }
}

@media (max-width: 768px) {
    .sm-ai-trigger-btn {
        bottom: 12px !important;
        right: 12px !important;
        padding: 3px !important;
        border-radius: 50% !important;
        box-shadow: 0 4px 14px rgba(18, 115, 153, 0.4) !important;
    }
    .sm-ai-trigger-icon {
        width: 36px !important;
        height: 36px !important;
        font-size: 0.85rem !important;
    }
    .sm-ai-trigger-label {
        display: none !important;
    }
}

body:has(.navbar-mobile .navbar-collapse.show) #sm-ai-chat-container,
.navbar-mobile .navbar-collapse.show ~ #sm-ai-chat-container {
    display: none !important;
    visibility: hidden !important;
}

/* Launcher Button */
.sm-ai-trigger-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99998;
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #0e5c7a 0%, #127399 100%);
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50px;
    padding: 6px 14px 6px 6px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(18, 115, 153, 0.35), 0 2px 6px rgba(0, 0, 0, 0.12);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sm-ai-trigger-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 30px rgba(18, 115, 153, 0.48), 0 4px 10px rgba(0, 0, 0, 0.18);
    color: #ffffff;
}

.sm-ai-trigger-icon {
    width: 40px;
    height: 40px;
    background: #ffffff;
    color: #127399;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sm-ai-trigger-label {
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sm-ai-sparkle-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px #4ade80;
    animation: smPulseDot 2s infinite ease-in-out;
}

@keyframes smPulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

/* Chat Window Panel */
.sm-ai-window {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 390px;
    height: 640px;
    max-height: calc(100vh - 20px);
    background: #ffffff;
    border: 1px solid rgba(18, 115, 153, 0.2);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.22), 0 4px 12px rgba(0, 0, 0, 0.08);
    z-index: 99999;
    animation: smSlideUpFade 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes smSlideUpFade {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header */
.sm-ai-header {
    background: linear-gradient(135deg, #0e5c7a 0%, #127399 100%);
    color: #ffffff;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.sm-ai-avatar {
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    font-size: 1.1rem;
    color: #ffffff;
}

.sm-ai-online-status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background: #22c55e;
    border: 2px solid #127399;
    border-radius: 50%;
}

.sm-ai-title {
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: #ffffff;
    line-height: 1.25;
}

.sm-ai-subtitle {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.85);
    display: block;
    line-height: 1.25;
}

.sm-ai-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sm-ai-action-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    width: 30px;
    height: 30px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.sm-ai-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* ========================================================
   Mode Switcher Bar (Chat vs 3D Avatar)
   ======================================================== */
.sm-ai-mode-bar {
    display: flex;
    gap: 6px;
    padding: 4px 10px;
    background: #0b1322;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.sm-ai-mode-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 5px 8px;
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.sm-ai-mode-tab:hover {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.18);
}

.sm-ai-mode-tab.active {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    border-color: #38bdf8;
    box-shadow: 0 2px 10px rgba(2, 132, 199, 0.38);
}

.sm-ai-badge-live {
    display: inline-block;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: 5px;
    letter-spacing: 0.5px;
    animation: smBadgeLivePulse 1.6s ease-in-out infinite;
}

@keyframes smBadgeLivePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.75; transform: scale(0.92); }
}

/* ========================================================
   3D Avatar Container & Stage
   ======================================================== */
.sm-ai-avatar-container {
    display: flex;
    flex-direction: column;
    background: #090e1a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    flex-shrink: 0;
    animation: smAvatarSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sm-ai-window.mode-avatar .sm-ai-avatar-container {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

@keyframes smAvatarSlideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.sm-ai-avatar-canvas-wrap {
    position: relative;
    width: 100%;
    min-height: 70px;
    flex: 1 1 0px;
    background: radial-gradient(circle at 50% 35%, #1e293b 0%, #070b13 100%);
    overflow: hidden;
}

#sm-ai-avatar-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
}

#sm-ai-avatar-canvas:active {
    cursor: grabbing;
}

/* ========================================================
   Photorealistic Digital Human Holographic Stage
   ======================================================== */
.sm-ai-avatar-canvas-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.15;
    pointer-events: none;
}

.sm-ai-dh-stage {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    z-index: 2;
    overflow: hidden;
    perspective: 700px;
    background: radial-gradient(circle at 50% 45%, rgba(30, 41, 59, 0.75) 0%, rgba(7, 11, 19, 0.96) 100%);
}

.sm-ai-dh-figure {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.12s cubic-bezier(0.16, 1, 0.3, 1);
    transform-style: preserve-3d;
    animation: smDhIdleBreath 4.5s ease-in-out infinite alternate;
}

@keyframes smDhIdleBreath {
    0% { transform: translateY(0px) scale(1); }
    100% { transform: translateY(-3px) scale(1.012); }
}

.sm-ai-dh-img {
    height: 95%;
    max-height: 250px;
    width: auto;
    max-width: 92%;
    object-fit: contain;
    border-radius: 16px;
    filter: drop-shadow(0 0 16px rgba(0, 240, 255, 0.35)) drop-shadow(0 6px 20px rgba(0, 0, 0, 0.6));
    user-select: none;
    -webkit-user-drag: none;
}

.sm-ai-dh-mouth-overlay {
    position: absolute;
    inset: 0;
    margin: auto;
    height: 95%;
    max-height: 250px;
    width: auto;
    max-width: 92%;
    object-fit: contain;
    border-radius: 16px;
    opacity: 0;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    transition: opacity 0.04s ease-out;
}

.sm-ai-dh-mouth-overlay.active {
    opacity: 1;
}

/* Speaking State on Figure: Subtle neon cyan/magenta glow rim, zero shaking/vibration */
.sm-ai-dh-figure.speaking .sm-ai-dh-img {
    filter: drop-shadow(0 0 22px rgba(0, 240, 255, 0.6)) drop-shadow(0 0 32px rgba(168, 85, 247, 0.35)) drop-shadow(0 8px 24px rgba(0, 0, 0, 0.7));
}

/* Floating Status Badge */
.sm-ai-avatar-badge {
    position: absolute;
    top: 8px;
    left: 10px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 3px 8px;
    font-size: 0.66rem;
    font-weight: 600;
    color: #cbd5e1;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    pointer-events: none;
    z-index: 5;
}

.sm-ai-avatar-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: smLiveDotGlow 1.8s ease-in-out infinite;
}

@keyframes smLiveDotGlow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

/* Floating Persona Picker */
.sm-ai-avatar-persona-picker {
    position: absolute;
    top: 8px;
    right: 10px;
    display: flex;
    gap: 2px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 2px;
    z-index: 5;
}

.sm-ai-persona-btn {
    background: transparent;
    border: none;
    border-radius: 12px;
    padding: 4px 10px;
    min-height: 28px;
    font-size: 0.68rem;
    font-weight: 600;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.sm-ai-persona-btn * {
    pointer-events: none;
}

.sm-ai-persona-thumb {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(56, 189, 248, 0.5);
    flex-shrink: 0;
}

.sm-ai-persona-btn:hover {
    color: #f1f5f9;
}

.sm-ai-persona-btn.active {
    background: #0284c7;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.4);
}

/* Audio Visualizer Waves */
.sm-ai-avatar-waves {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 16px;
    padding: 2px 8px;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    border-radius: 10px;
    opacity: 0.35;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 5;
}

.sm-ai-avatar-waves.speaking {
    opacity: 1;
}

.sm-wave-bar {
    width: 3px;
    height: 4px;
    background: #38bdf8;
    border-radius: 2px;
    transition: height 0.08s ease;
}

.sm-ai-avatar-waves.speaking .sm-wave-bar:nth-child(1) { animation: smWaveAnim 0.45s infinite alternate ease-in-out; }
.sm-ai-avatar-waves.speaking .sm-wave-bar:nth-child(2) { animation: smWaveAnim 0.35s infinite alternate ease-in-out 0.1s; }
.sm-ai-avatar-waves.speaking .sm-wave-bar:nth-child(3) { animation: smWaveAnim 0.5s infinite alternate ease-in-out 0.2s; }
.sm-ai-avatar-waves.speaking .sm-wave-bar:nth-child(4) { animation: smWaveAnim 0.4s infinite alternate ease-in-out 0.15s; }
.sm-ai-avatar-waves.speaking .sm-wave-bar:nth-child(5) { animation: smWaveAnim 0.48s infinite alternate ease-in-out 0.05s; }

@keyframes smWaveAnim {
    0% { height: 4px; background: #38bdf8; }
    100% { height: 16px; background: #60a5fa; }
}

/* Captions / Subtitles */
.sm-ai-avatar-caption {
    padding: 5px 10px;
    background: rgba(15, 23, 42, 0.96);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: #f1f5f9;
    font-size: 0.75rem;
    line-height: 1.35;
    min-height: 34px;
    max-height: 50px;
    overflow-y: auto;
    flex-shrink: 0;
}

.sm-ai-caption-speaker {
    margin-top: 2px;
    flex-shrink: 0;
    font-size: 0.76rem;
}

.sm-ai-caption-text-wrap {
    flex: 1;
    font-weight: 500;
    color: #e2e8f0;
}

/* Voice & Stop Control Bar */
.sm-ai-avatar-controls {
    padding: 5px 10px;
    background: #0b1220;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.sm-ai-avatar-mic-btn {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    border: none;
    border-radius: 999px;
    padding: 5px 18px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.38);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sm-ai-avatar-mic-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.5);
    background: linear-gradient(135deg, #0369a1 0%, #0284c7 100%);
}

.sm-ai-avatar-mic-btn.listening {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 0 22px rgba(239, 68, 68, 0.65);
    animation: smMicPulse 1.2s infinite;
}

@keyframes smMicPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}

.sm-ai-avatar-stop-btn {
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sm-ai-avatar-stop-btn:hover {
    background: rgba(239, 68, 68, 0.35);
    color: #ffffff;
}

/* Avatar Prompt Chips (Clean 4-column grid: NO cut-offs) */
.sm-ai-avatar-chips {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 5px 8px 6px;
    background: #080d17;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0 !important;
    box-sizing: border-box;
    margin-bottom: 0;
}

.sm-ai-avatar-chip {
    width: 100%;
    min-width: 0;
    text-align: center;
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 7px;
    padding: 5px 2px;
    font-size: 0.67rem;
    letter-spacing: -0.2px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

.sm-ai-avatar-chip:hover {
    background: rgba(2, 132, 199, 0.25);
    color: #38bdf8;
    border-color: rgba(2, 132, 199, 0.45);
}

/* Hide chat messages scroll area and typing while in 3D Avatar mode so bottom quick bar and input never hide */
.sm-ai-window.mode-avatar #sm-ai-messages {
    display: none !important;
}

.sm-ai-window.mode-avatar #sm-ai-typing {
    display: none !important;
}

.sm-ai-window.mode-avatar .sm-ai-disclaimer {
    display: none !important;
}

.sm-ai-window.mode-avatar .sm-ai-quick-bar {
    padding: 4px 8px;
}

.sm-ai-window.mode-avatar .sm-ai-input-form {
    padding: 6px 12px 6px;
}

/* Chat Body */
.sm-ai-body {
    flex: 1;
    position: relative;
    overflow-y: auto;
    padding: 16px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sm-ai-msg {
    display: flex;
    flex-direction: column;
    max-width: 88%;
    animation: smMsgFadeIn 0.25s ease-out;
}

@keyframes smMsgFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.sm-ai-msg-bot {
    align-self: flex-start;
}

.sm-ai-msg-user {
    align-self: flex-end;
}

.sm-ai-bubble {
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 0.88rem;
    line-height: 1.55;
    word-break: break-word;
}

.sm-ai-msg-bot .sm-ai-bubble {
    background: #ffffff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.sm-ai-msg-user .sm-ai-bubble {
    background: linear-gradient(135deg, #127399 0%, #0d5470 100%);
    color: #ffffff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(18, 115, 153, 0.25);
}

.sm-ai-bubble p {
    margin-bottom: 8px;
}

.sm-ai-bubble p:last-child {
    margin-bottom: 0;
}

.sm-ai-bubble ul, .sm-ai-bubble ol {
    padding-left: 18px;
    margin-bottom: 8px;
}

.sm-ai-bubble li {
    margin-bottom: 4px;
}

.sm-ai-bubble h3, .sm-ai-bubble h4, .sm-ai-bubble h5 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
}

.sm-ai-bubble a {
    color: #0284c7;
    font-weight: 600;
    text-decoration: underline;
}

/* Bot Message Action Toolbar (TTS + Email Estimate) */
.sm-ai-bubble-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px dashed #e2e8f0;
}

.sm-ai-bubble-tool-btn {
    background: transparent;
    border: 1px solid transparent;
    color: #64748b;
    font-size: 0.74rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.sm-ai-bubble-tool-btn:hover {
    color: #0284c7;
    background: #f0f9ff;
    border-color: #bae6fd;
}

.sm-ai-bubble-tool-btn.active {
    color: #0284c7;
    background: #e0f2fe;
    border-color: #7dd3fc;
    animation: smPulseTts 1.2s infinite ease-in-out;
}

@keyframes smPulseTts {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.04); }
}

/* In-Chat Interactive Portfolio Cards */
.sm-ai-portfolio-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 8px 0;
}

.sm-ai-portfolio-card {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.sm-ai-portfolio-card:hover {
    border-color: #0284c7;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(2, 132, 199, 0.12);
}

.sm-ai-portfolio-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.sm-ai-portfolio-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, #0e5c7a, #127399);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.sm-ai-portfolio-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.sm-ai-portfolio-desc {
    font-size: 0.78rem;
    color: #475569;
    line-height: 1.4;
    margin-bottom: 8px;
}

.sm-ai-portfolio-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 10px;
}

.sm-ai-portfolio-badge {
    font-size: 0.68rem;
    background: #f1f5f9;
    color: #334155;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 600;
}

.sm-ai-portfolio-actions {
    display: flex;
    gap: 6px;
}

.sm-ai-portfolio-btn {
    flex: 1;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 6px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.sm-ai-portfolio-btn.primary {
    background: #127399;
    color: #ffffff;
    border: 1px solid #127399;
}

.sm-ai-portfolio-btn.primary:hover {
    background: #0e5c7a;
    color: #ffffff;
}

.sm-ai-portfolio-btn.secondary {
    background: #f8fafc;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.sm-ai-portfolio-btn.secondary:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* In-Chat Interactive Calendar Booking Card */
.sm-ai-booking-card {
    background: linear-gradient(145deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1.5px solid #7dd3fc;
    border-radius: 14px;
    padding: 14px;
    margin: 8px 0;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.08);
}

.sm-ai-booking-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.sm-ai-booking-header i {
    font-size: 1.1rem;
    color: #0284c7;
}

.sm-ai-booking-header h6 {
    font-size: 0.88rem;
    font-weight: 700;
    color: #0369a1;
    margin: 0;
}

.sm-ai-booking-body {
    font-size: 0.8rem;
    color: #334155;
    line-height: 1.45;
    margin-bottom: 10px;
}

.sm-ai-booking-slots {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-bottom: 12px;
}

.sm-ai-booking-slot-btn {
    background: #ffffff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 6px 8px;
    font-size: 0.74rem;
    font-weight: 600;
    color: #0284c7;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
}

.sm-ai-booking-slot-btn:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
}

/* "Email Me This Estimate" Inline Prompt */
.sm-ai-email-estimate-box {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    margin-top: 8px;
    animation: smNudgeSlideIn 0.25s ease;
}

.sm-ai-email-estimate-box input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.82rem;
    margin-bottom: 8px;
    outline: none;
    box-sizing: border-box;
}

.sm-ai-email-estimate-box input:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

/* Streaming Typewriter Cursor */
.sm-ai-streaming-cursor::after {
    content: " ▋";
    color: #0284c7;
    font-weight: 700;
    animation: smCursorBlink 0.7s infinite ease-in-out;
}

@keyframes smCursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Suggestion Chips */
.sm-ai-chips-wrap {
    margin-top: 4px;
}

.sm-ai-chips-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #94a3b8;
    margin-bottom: 8px;
}

.sm-ai-chips-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sm-ai-chip {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.82rem;
    color: #334155;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.sm-ai-chip:hover {
    background: #e0f2fe;
    border-color: #7dd3fc;
    color: #0369a1;
    transform: translateX(3px);
}

/* Typing Indicator */
.sm-ai-typing-indicator {
    padding: 6px 16px;
    background: #f8fafc;
    display: flex;
    align-items: center;
}

.sm-ai-typing-bubble {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 6px 10px;
    display: inline-flex;
    gap: 4px;
}

.sm-ai-dot {
    width: 6px;
    height: 6px;
    background: #127399;
    border-radius: 50%;
    animation: smBouncingDot 1.4s infinite ease-in-out both;
}

.sm-ai-dot:nth-child(1) { animation-delay: -0.32s; }
.sm-ai-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes smBouncingDot {
    0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
    40% { transform: scale(1); opacity: 1; }
}

/* Quick Bar */
.sm-ai-quick-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    overflow-x: auto;
    white-space: nowrap;
    flex-shrink: 0 !important;
}

.sm-ai-bar-btn {
    font-size: 0.74rem;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 4px 10px;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.sm-ai-bar-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
    text-decoration: none;
}

/* Input Form */
.sm-ai-input-form {
    padding: 10px 14px 8px;
    background: #ffffff;
    flex-shrink: 0;
}

.sm-ai-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 25px;
    padding: 4px 6px 4px 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sm-ai-input-wrap:focus-within {
    border-color: #127399;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(18, 115, 153, 0.15);
}

.sm-ai-input-field {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.88rem;
    color: #0f172a;
    outline: none;
    padding: 6px 0;
}

.sm-ai-input-field::placeholder {
    color: #94a3b8;
    font-size: 0.82rem;
}

.sm-ai-mic-btn {
    width: 32px;
    height: 32px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    transition: all 0.2s ease;
    margin-right: 6px;
    flex-shrink: 0;
}

.sm-ai-mic-btn:hover {
    background: #e2e8f0;
    color: #127399;
    transform: scale(1.05);
}

.sm-ai-mic-btn.recording {
    background: #ef4444 !important;
    color: #ffffff !important;
    border-color: #dc2626 !important;
    animation: smPulseMic 1.2s infinite;
}

@keyframes smPulseMic {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
        transform: scale(1.08);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
        transform: scale(1);
    }
}

.sm-ai-send-btn {
    width: 34px;
    height: 34px;
    background: #127399;
    border: none;
    color: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.sm-ai-send-btn:hover {
    background: #0e5c7a;
    transform: scale(1.05);
}

.sm-ai-send-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
}

/* ========================================================
   Interactive In-Chat Lead Capture Form Card
   ======================================================== */
.sm-ai-lead-card {
    background: #ffffff;
    border: 1.5px solid #127399;
    border-radius: 14px;
    padding: 14px 16px;
    margin-top: 8px;
    box-shadow: 0 6px 20px rgba(18, 115, 153, 0.15);
    animation: smMsgFadeIn 0.3s ease-out;
}

.sm-ai-lead-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #e2e8f0;
}

.sm-ai-lead-header h6 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
}

.sm-ai-lead-field {
    margin-bottom: 8px;
}

.sm-ai-lead-field input,
.sm-ai-lead-field select {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.82rem;
    color: #1e293b;
    outline: none;
    background: #f8fafc;
    transition: all 0.2s ease;
}

.sm-ai-lead-field input:focus,
.sm-ai-lead-field select:focus {
    border-color: #127399;
    background: #ffffff;
    box-shadow: 0 0 0 2px rgba(18, 115, 153, 0.15);
}

.sm-ai-lead-submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #127399 0%, #0d5470 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.sm-ai-lead-submit-btn:hover {
    background: #0e5c7a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(18, 115, 153, 0.25);
}

.sm-ai-lead-submit-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

.sm-ai-lead-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 12px;
    color: #166534;
    font-size: 0.82rem;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

/* ========================================================
   Interactive Project Cost Estimator Wizard Card
   ======================================================== */
.sm-ai-wizard-card {
    background: #ffffff;
    border: 1.5px solid #0284c7;
    border-radius: 14px;
    padding: 14px 16px;
    margin-top: 8px;
    box-shadow: 0 8px 25px rgba(2, 132, 199, 0.18);
    animation: smMsgFadeIn 0.3s ease-out;
}

.sm-ai-wizard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #e2e8f0;
}

.sm-ai-wizard-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
}

.sm-ai-wizard-step-tag {
    font-size: 0.7rem;
    font-weight: 700;
    background: #e0f2fe;
    color: #0369a1;
    padding: 2px 8px;
    border-radius: 12px;
}

.sm-ai-wizard-q {
    font-size: 0.84rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
}

.sm-ai-wizard-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.sm-ai-wizard-opt-btn {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.82rem;
    color: #1e293b;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sm-ai-wizard-opt-btn:hover {
    background: #e0f2fe;
    border-color: #38bdf8;
    color: #0369a1;
    transform: translateX(3px);
}

.sm-ai-wizard-result {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1px solid #86efac;
    border-radius: 12px;
    padding: 14px;
    text-align: center;
    margin-top: 6px;
}

.sm-ai-wizard-price-tag {
    font-size: 1.35rem;
    font-weight: 800;
    color: #15803d;
    margin: 4px 0;
}

.sm-ai-wizard-meta {
    font-size: 0.76rem;
    color: #475569;
    margin-bottom: 12px;
}

.sm-ai-disclaimer {
    text-align: center;
    font-size: 0.65rem;
    color: #94a3b8;
    margin-top: 6px;
}

/* Mobile Responsiveness */
@media (max-width: 576px) {
    .sm-ai-window {
        bottom: 0;
        right: 0;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
        border: none;
    }
    
    .sm-ai-trigger-btn {
        bottom: 12px !important;
        right: 12px !important;
        padding: 3px !important;
        border-radius: 50% !important;
    }
    
    .sm-ai-trigger-icon {
        width: 36px !important;
        height: 36px !important;
        font-size: 0.85rem !important;
    }
}
