/* ============================================
   HSEPro Dual AI Widget - Complete Styles
   ============================================ */

/* --- SALES AI: Floating Button (BOTTOM-LEFT) --- */
.sales-ai-widget {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.sales-ai-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

.sales-ai-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}

.sales-ai-pulse {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.3);
    animation: sales-ai-pulse 2s infinite;
}

@keyframes sales-ai-pulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* Sales AI tooltip */
.sales-ai-tooltip {
    position: absolute;
    left: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: #1e293b;
    color: white;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.sales-ai-toggle:hover .sales-ai-tooltip {
    opacity: 1;
}

/* Sales AI Chat Window (bottom-left, opens upward) */
.sales-ai-chat-window {
    position: fixed;
    bottom: 100px;
    left: 24px;
    width: 400px;
    height: 600px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    z-index: 9998;
    display: none;
}

.sales-ai-chat-window iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* --- SAFE AI: "Ask SAFE AI" Button in Header --- */
.safe-ai-header-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 15px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.safe-ai-header-btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
}

.safe-ai-header-btn svg {
    width: 18px;
    height: 18px;
}

/* --- SAFE AI: Slide-Out Panel (Right-to-Left) --- */
.safe-ai-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.safe-ai-overlay.active {
    opacity: 1;
    visibility: visible;
}

.safe-ai-panel {
    position: fixed;
    top: 0;
    right: -450px;
    width: 420px;
    max-width: 90vw;
    height: 100vh;
    background: white;
    z-index: 10001;
    box-shadow: -4px 0 30px rgba(0, 0, 0, 0.15);
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.safe-ai-panel.active {
    right: 0;
}

.safe-ai-panel-header {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.safe-ai-panel-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.safe-ai-panel-close {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.safe-ai-panel-close:hover {
    background: rgba(255,255,255,0.3);
}

.safe-ai-panel-body {
    flex: 1;
    overflow: hidden;
}

.safe-ai-panel-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* --- SAFE AI: Pulse animation on header button --- */
.safe-ai-btn-pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    margin-right: 4px;
    animation: safe-ai-btn-pulse-anim 2s infinite;
}

@keyframes safe-ai-btn-pulse-anim {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* --- Mobile Responsiveness --- */
@media (max-width: 480px) {
    .sales-ai-chat-window {
        width: 100vw;
        height: 100vh;
        bottom: 0;
        left: 0;
        border-radius: 0;
    }

    .safe-ai-panel {
        width: 100vw;
        max-width: 100vw;
        right: -100vw;
    }

    .safe-ai-header-btn span.btn-text {
        display: none;
    }

    .safe-ai-header-btn {
        padding: 10px 14px;
        border-radius: 50%;
        width: 42px;
        height: 42px;
        justify-content: center;
    }
}