/* WIUC AI Chatbot - Frontend Styles */

:root {
    --wiuc-primary: #0066cc;
    --wiuc-secondary: #ffffff;
    --wiuc-bg: #f5f5f5;
    --wiuc-text: #333333;
    --wiuc-border: #e0e0e0;
}

.wiuc-chatbot-widget {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.wiuc-chatbot-widget.bottom-right {
    bottom: 20px;
    right: 20px;
}

.wiuc-chatbot-widget.bottom-left {
    bottom: 20px;
    left: 20px;
}

.wiuc-chatbot-widget.top-right {
    top: 20px;
    right: 20px;
}

.wiuc-chatbot-widget.top-left {
    top: 20px;
    left: 20px;
}

/* Chat Button */
.wiuc-chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--wiuc-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
}

.wiuc-chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.wiuc-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Chat Window */
.wiuc-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.wiuc-chat-window.active {
    display: flex;
}

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

/* Header */
.wiuc-chat-header {
    background: var(--wiuc-primary);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wiuc-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wiuc-bot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wiuc-bot-name {
    font-weight: 600;
    font-size: 16px;
}

.wiuc-bot-status {
    font-size: 12px;
    opacity: 0.8;
}

.wiuc-close-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

.wiuc-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Messages Container */
.wiuc-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--wiuc-bg);
}

.wiuc-message {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease;
}

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

.wiuc-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--wiuc-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wiuc-message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 75%;
    line-height: 1.5;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.wiuc-user-message {
    flex-direction: row-reverse;
}

.wiuc-user-message .wiuc-message-avatar {
    background: #666;
}

.wiuc-user-message .wiuc-message-content {
    background: var(--wiuc-primary);
    color: white;
}

/* Quick Replies */
.wiuc-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.wiuc-quick-reply-btn {
    background: white;
    border: 1px solid var(--wiuc-border);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.wiuc-quick-reply-btn:hover {
    background: var(--wiuc-primary);
    color: white;
    border-color: var(--wiuc-primary);
}

/* Typing Indicator */
.wiuc-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 20px;
    background: var(--wiuc-bg);
}

.wiuc-typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    animation: typing 1.4s infinite;
}

.wiuc-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.wiuc-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.3;
    }
    30% {
        opacity: 1;
    }
}

/* Input Area */
.wiuc-input-area {
    border-top: 1px solid var(--wiuc-border);
    padding: 16px;
    background: white;
}

.wiuc-input-container {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

#wiucMessageInput {
    flex: 1;
    border: 1px solid var(--wiuc-border);
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    resize: none;
    max-height: 100px;
    font-family: inherit;
}

#wiucMessageInput:focus {
    outline: none;
    border-color: var(--wiuc-primary);
}

.wiuc-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--wiuc-primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.wiuc-send-btn:hover {
    transform: scale(1.1);
}

.wiuc-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wiuc-upload-container {
    margin-top: 8px;
}

.wiuc-upload-btn {
    background: transparent;
    border: 1px solid var(--wiuc-border);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.wiuc-upload-btn:hover {
    background: var(--wiuc-bg);
}

.wiuc-powered-by {
    text-align: center;
    font-size: 11px;
    color: #999;
    margin-top: 8px;
}

/* Modal */
.wiuc-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wiuc-modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.wiuc-modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--wiuc-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wiuc-modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.wiuc-modal-close {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.wiuc-modal-body {
    padding: 20px;
}

#wiucContactForm {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#wiucContactForm input,
#wiucContactForm textarea {
    border: 1px solid var(--wiuc-border);
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    font-family: inherit;
}

#wiucContactForm input:focus,
#wiucContactForm textarea:focus {
    outline: none;
    border-color: var(--wiuc-primary);
}

.wiuc-submit-btn {
    background: var(--wiuc-primary);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.wiuc-submit-btn:hover {
    opacity: 0.9;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .wiuc-chat-window {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    
    .wiuc-chatbot-widget.bottom-right,
    .wiuc-chatbot-widget.bottom-left {
        bottom: 10px;
    }
    
    .wiuc-chatbot-widget.bottom-right {
        right: 10px;
    }
    
    .wiuc-chatbot-widget.bottom-left {
        left: 10px;
    }
}
