/* wpChatbot Styles */

/* Chat Widget Container */
.wpchatbot-widget {
    position: fixed;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.wpchatbot-widget.position-bottom-right {
    bottom: 20px;
    right: 20px;
}

.wpchatbot-widget.position-bottom-left {
    bottom: 20px;
    left: 20px;
}

/* Chat Toggle Button */
.wpchatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--wpchatbot-color, #007cba);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wpchatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.wpchatbot-toggle svg {
    width: 24px;
    height: 24px;
    fill: white;
}

/* Chat Window */
.wpchatbot-window {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e1e5e9;
}

.wpchatbot-widget.position-bottom-left .wpchatbot-window {
    right: auto;
    left: 0;
}

.wpchatbot-window.active {
    display: flex;
}

/* Chat Header */
.wpchatbot-header {
    background: var(--wpchatbot-color, #007cba);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wpchatbot-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.wpchatbot-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wpchatbot-close,
.wpchatbot-clear {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
    padding: 0;
}

.wpchatbot-close {
    font-size: 20px;
}

.wpchatbot-clear svg {
    width: 16px;
    height: 16px;
}

.wpchatbot-close:hover,
.wpchatbot-clear:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Chat Messages */
.wpchatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.wpchatbot-message {
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.wpchatbot-message.user {
    flex-direction: row-reverse;
}

.wpchatbot-message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
}

.wpchatbot-message.bot .wpchatbot-message-content {
    background: white;
    border: 1px solid #e1e5e9;
    border-bottom-left-radius: 6px;
}

.wpchatbot-message.user .wpchatbot-message-content {
    background: var(--wpchatbot-color, #007cba);
    color: white;
    border-bottom-right-radius: 6px;
}

.wpchatbot-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--wpchatbot-color, #007cba);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.wpchatbot-message.user .wpchatbot-avatar {
    background: #6c757d;
}

/* Promotional Banner */
.wpchatbot-banner {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 12px 16px;
    margin: 10px 20px;
    border-radius: 8px;
    font-size: 12px;
    text-align: center;
    color: #5a3300;
}

.wpchatbot-banner a {
    color: #1e3a8a !important;
    text-decoration: none;
    font-weight: 600;
}

.wpchatbot-banner a:hover {
    color: #1e40af;
    text-decoration: underline;
}

/* Chat Input */
.wpchatbot-input-container {
    padding: 20px;
    background: white;
    border-top: 1px solid #e1e5e9;
}

.wpchatbot-input-form {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.wpchatbot-input {
    flex: 1;
    border: 1px solid #e1e5e9;
    border-radius: 5px;
    padding: 12px 16px;
    font-size: 14px;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
    min-height: 20px;
    max-height: 100px;
    line-height: 1.4;
}

.wpchatbot-input:focus {
    border-color: var(--wpchatbot-color, #007cba);
}

.wpchatbot-send {
    background: var(--wpchatbot-color, #007cba);
    color: white;
    border: none;
    border-radius: 5px;
    min-width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.wpchatbot-send:hover:not(:disabled) {
    background: var(--wpchatbot-color-dark, #005a87);
}

.wpchatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wpchatbot-send svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Loading Animation */
.wpchatbot-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 18px;
    border-bottom-left-radius: 6px;
    max-width: 80%;
}

.wpchatbot-typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #6c757d;
    animation: wpchatbot-typing-animation 1.4s infinite;
}

.wpchatbot-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.wpchatbot-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes wpchatbot-typing-animation {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    30% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Welcome Message */
.wpchatbot-welcome {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    text-align: center;
}

.wpchatbot-welcome h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.wpchatbot-welcome p {
    margin: 0;
    font-size: 12px;
    color: #6c757d;
    line-height: 1.4;
}

/* Continuation Notice */
.wpchatbot-continuation {
    background: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 16px;
    text-align: center;
    font-size: 12px;
    color: #1565c0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.wpchatbot-continuation-icon {
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wpchatbot-window {
        position: fixed !important;
        top: 5vh !important;
        left: 5vw !important;
        right: 5vw !important;
        bottom: 5vh !important;
        width: 90vw !important;
        height: 90vh !important;
        max-width: none !important;
        max-height: none !important;
        border-radius: 12px;
        z-index: 10000;
    }
    
    .wpchatbot-widget.position-bottom-left .wpchatbot-window,
    .wpchatbot-widget.position-bottom-right .wpchatbot-window {
        top: 5vh !important;
        left: 5vw !important;
        right: 5vw !important;
        bottom: 5vh !important;
    }
    
    .wpchatbot-toggle {
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 9999;
    }
    
    .wpchatbot-widget.position-bottom-left .wpchatbot-toggle {
        left: 20px;
        right: auto;
    }
    
    .wpchatbot-messages {
        padding: 15px;
    }
    
    .wpchatbot-input-container {
        padding: 15px;
    }
}

/* Error States */
.wpchatbot-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 10px 20px;
    font-size: 12px;
    text-align: center;
}

/* Accessibility */
.wpchatbot-widget * {
    box-sizing: border-box;
}

.wpchatbot-toggle:focus,
.wpchatbot-close:focus,
.wpchatbot-input:focus,
.wpchatbot-send:focus {
    outline: 2px solid var(--wpchatbot-color, #007cba);
    outline-offset: 2px;
}

/* Scrollbar Styling */
.wpchatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.wpchatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.wpchatbot-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.wpchatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Remove scrollbar arrows */
.wpchatbot-messages::-webkit-scrollbar-button {
    display: none;
}

.wpchatbot-messages::-webkit-scrollbar-corner {
    background: transparent;
} 