/* ============================================================================
   Enterprise Scanner - Live Chat Widget
   Professional chat interface for Fortune 500 prospects
   ============================================================================ */

:root {
    --chat-primary: #0f172a;
    --chat-accent: #fbbf24;
    --chat-bg: #ffffff;
    --chat-border: #e2e8f0;
    --chat-text: #1e293b;
    --chat-text-light: #64748b;
    --chat-online: #10b981;
    --chat-shadow: rgba(0, 0, 0, 0.1);
}

/* Chat Widget Button */
.chat-widget-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--chat-primary) 0%, #1e293b 100%);
    border-radius: 50%;
    box-shadow: 0 4px 12px var(--chat-shadow), 0 0 0 0 rgba(251, 191, 36, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 12px var(--chat-shadow), 0 0 0 0 rgba(251, 191, 36, 0.4);
    }
    50% {
        box-shadow: 0 4px 12px var(--chat-shadow), 0 0 0 8px rgba(251, 191, 36, 0);
    }
}

.chat-widget-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(251, 191, 36, 0.3);
}

.chat-widget-button i {
    font-size: 28px;
    color: var(--chat-accent);
}

.chat-widget-button .chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

/* Chat Window */
.chat-widget-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 550px;
    background: var(--chat-bg);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-widget-window.active {
    display: flex;
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, var(--chat-primary) 0%, #1e293b 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--chat-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
    color: var(--chat-primary);
    position: relative;
}

.chat-avatar::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: var(--chat-online);
    border: 2px solid white;
    border-radius: 50%;
}

.chat-header-text h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-header-text p {
    margin: 0;
    font-size: 13px;
    opacity: 0.9;
}

.chat-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.chat-close:hover {
    opacity: 1;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.chat-message {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.bot {
    align-self: flex-start;
}

.chat-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--chat-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--chat-primary);
    flex-shrink: 0;
}

.chat-message.user .chat-message-avatar {
    background: var(--chat-primary);
    color: var(--chat-accent);
}

.chat-message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.chat-message.user .chat-message-content {
    background: var(--chat-primary);
    color: white;
}

.chat-message-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.chat-message-time {
    font-size: 11px;
    color: var(--chat-text-light);
    margin-top: 4px;
    opacity: 0.7;
}

.chat-message.user .chat-message-time {
    color: white;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--chat-text-light);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Quick Actions */
.chat-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.chat-quick-action {
    background: white;
    border: 1px solid var(--chat-border);
    color: var(--chat-primary);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-quick-action:hover {
    background: var(--chat-primary);
    color: white;
    border-color: var(--chat-primary);
}

/* Chat Input */
.chat-input-wrapper {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid var(--chat-border);
}

.chat-input-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input {
    flex: 1;
    border: 1px solid var(--chat-border);
    border-radius: 24px;
    padding: 12px 18px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: var(--chat-accent);
}

.chat-send-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--chat-accent);
    border: none;
    color: var(--chat-primary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chat-send-button:hover {
    background: #f59e0b;
    transform: scale(1.05);
}

.chat-send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Business Hours Notice */
.chat-business-hours {
    background: #fef3c7;
    border: 1px solid #fde68a;
    color: #92400e;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-business-hours i {
    color: #f59e0b;
}

/* Lead Capture Form */
.chat-lead-form {
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
}

.chat-lead-form h5 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--chat-primary);
}

.chat-form-group {
    margin-bottom: 12px;
}

.chat-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--chat-text);
    margin-bottom: 4px;
}

.chat-form-group input,
.chat-form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--chat-border);
    border-radius: 6px;
    font-size: 13px;
    outline: none;
}

.chat-form-group input:focus,
.chat-form-group select:focus {
    border-color: var(--chat-accent);
}

.chat-form-submit {
    width: 100%;
    padding: 12px;
    background: var(--chat-accent);
    color: var(--chat-primary);
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-form-submit:hover {
    background: #f59e0b;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chat-widget-window {
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
    
    .chat-widget-button {
        bottom: 20px;
        right: 20px;
    }
}

/* Success Message */
.chat-success-message {
    background: #d1fae5;
    border: 1px solid #6ee7b7;
    color: #065f46;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
    margin: 10px 0;
}

.chat-success-message i {
    color: #10b981;
    margin-right: 6px;
}
