/* css/sales-assistant.css */

/* Toggle Button (Floating) */
.sales-assistant-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.sales-assistant-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.sales-assistant-toggle-icon {
    font-size: 24px;
    color: white;
}

/* Widget Container */
.sales-assistant-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 400px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 40px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    transform: translateY(100%);
    opacity: 0;
    transition: all 0.3s ease;
    overflow: hidden;
}

.sales-assistant-widget.open {
    transform: translateY(0);
    opacity: 1;
}

.sales-assistant-widget.minimized {
    height: 60px;
}

/* Header */
.sales-assistant-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 16px 16px 0 0;
}

.sales-assistant-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sales-assistant-icon {
    font-size: 20px;
}

.sales-assistant-title-text {
    font-weight: 600;
    font-size: 16px;
}

.sales-assistant-actions {
    display: flex;
    gap: 8px;
}

.sales-assistant-btn-minimize,
.sales-assistant-btn-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.sales-assistant-btn-minimize:hover,
.sales-assistant-btn-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sales-assistant-btn-minimize span,
.sales-assistant-btn-close span {
    font-size: 18px;
    line-height: 1;
}

/* Body */
.sales-assistant-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sales-assistant-widget.minimized .sales-assistant-body {
    display: none;
}

/* Messages Container */
.sales-assistant-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #f8f9fa;
}

.sales-assistant-message {
    display: flex;
    flex-direction: column;
    gap: 4px;
    animation: fadeIn 0.3s ease;
}

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

.sales-assistant-message-user {
    align-items: flex-end;
}

.sales-assistant-message-assistant {
    align-items: flex-start;
}

.sales-assistant-message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    word-wrap: break-word;
    line-height: 1.5;
}

.sales-assistant-message-user .sales-assistant-message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.sales-assistant-message-assistant .sales-assistant-message-content {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
}

.sales-assistant-message-content a {
    color: #667eea;
    text-decoration: underline;
}

.sales-assistant-message-time {
    font-size: 11px;
    color: #999;
    padding: 0 4px;
}

.sales-assistant-typing-dots {
    display: inline-flex;
    gap: 4px;
}

.sales-assistant-typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    animation: typing 1.4s infinite;
}

.sales-assistant-typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.sales-assistant-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Input Container */
.sales-assistant-input-container {
    padding: 16px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 8px;
}

.sales-assistant-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.sales-assistant-input:focus {
    border-color: #667eea;
}

.sales-assistant-btn-send {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s;
}

.sales-assistant-btn-send:hover {
    transform: scale(1.05);
}

.sales-assistant-btn-send:active {
    transform: scale(0.95);
}

/* Quick Actions */
.sales-assistant-quick-actions {
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sales-assistant-quick-action {
    padding: 8px 16px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.sales-assistant-quick-action:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Recommendations */
.sales-assistant-recommendation {
    margin-top: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.sales-assistant-recommendation-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.sales-assistant-recommendation-details {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.sales-assistant-recommendation-link {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 12px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 12px;
    transition: background 0.2s;
}

.sales-assistant-recommendation-link:hover {
    background: #5568d3;
}

/* Responsive */
@media (max-width: 768px) {
    .sales-assistant-widget {
        width: calc(100vw - 20px);
        height: calc(100vh - 20px);
        max-height: calc(100vh - 20px);
        bottom: 10px;
        right: 10px;
    }
    
    .sales-assistant-toggle {
        bottom: 10px;
        right: 10px;
    }
}

/* Scrollbar Styling */
.sales-assistant-messages::-webkit-scrollbar {
    width: 6px;
}

.sales-assistant-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sales-assistant-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.sales-assistant-messages::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Notifications Container */
.sales-assistant-notifications {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
}

.sales-assistant-notification {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    animation: slideInRight 0.3s ease;
    transition: all 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.sales-assistant-notification-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.sales-assistant-notification-content {
    flex: 1;
}

.sales-assistant-notification-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: #333;
}

.sales-assistant-notification-message {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.sales-assistant-notification-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.2s;
}

.sales-assistant-notification-close:hover {
    color: #333;
}

.sales-assistant-notification-opportunity {
    border-left: 4px solid #667eea;
    cursor: pointer;
}

.sales-assistant-notification-opportunity:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.2);
}

/* Opportunity Banner */
.sales-assistant-opportunity-banner {
    position: fixed;
    bottom: 100px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 9997;
    max-width: 400px;
    animation: slideInUp 0.3s ease;
    transition: opacity 0.3s ease;
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.sales-assistant-opportunity-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sales-assistant-opportunity-banner-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.sales-assistant-opportunity-banner-text {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
}

.sales-assistant-opportunity-banner-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.sales-assistant-opportunity-banner-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

@media (max-width: 768px) {
    .sales-assistant-notifications {
        right: 10px;
        top: 10px;
        max-width: calc(100vw - 20px);
    }
    
    .sales-assistant-notification {
        min-width: auto;
        max-width: 100%;
    }
    
    .sales-assistant-opportunity-banner {
        bottom: 80px;
        right: 10px;
        max-width: calc(100vw - 20px);
    }
}
