/**
 * Quacklabs Chatbot Widget Styles
 * Version: 1.0.0
 */

/* Reset and Base Styles */
.ql-chatbot-container * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Container */
.ql-chatbot-container {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.ql-chatbot-container.bottom-right {
    bottom: 20px;
    right: 20px;
}

.ql-chatbot-container.bottom-left {
    bottom: 20px;
    left: 20px;
}

/* Chat Button */
.ql-chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.ql-chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.5);
}

.ql-chat-button svg {
    width: 28px;
    height: 28px;
    stroke: white;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ql-chat-icon {
    display: block;
}

.ql-close-icon {
    display: none;
}

.ql-chat-button.active .ql-chat-icon {
    display: none;
}

.ql-chat-button.active .ql-close-icon {
    display: block;
}

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

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

/* Header */
.ql-chat-header {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 16px 16px 0 0;
}

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

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

.ql-avatar svg {
    width: 24px;
    height: 24px;
    stroke: white;
    stroke-width: 2;
}

.ql-header-title {
    font-size: 16px;
    font-weight: 600;
}

.ql-header-status {
    font-size: 12px;
    opacity: 0.9;
}

.ql-minimize-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

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

.ql-minimize-btn svg {
    width: 18px;
    height: 18px;
    stroke: white;
    stroke-width: 2;
}

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

.ql-messages::-webkit-scrollbar {
    width: 6px;
}

.ql-messages::-webkit-scrollbar-track {
    background: transparent;
}

.ql-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.ql-messages::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Message Bubbles */
.ql-message {
    display: flex;
    animation: fadeIn 0.3s ease;
}

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

.ql-bot-message {
    justify-content: flex-start;
}

.ql-user-message {
    justify-content: flex-end;
}

.ql-message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 12px;
    position: relative;
}

.ql-bot-message .ql-message-content {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px 12px 12px 4px;
}

.ql-user-message .ql-message-content {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    border-radius: 12px 12px 4px 12px;
}

.ql-message-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.ql-message-time {
    display: block;
    font-size: 11px;
    margin-top: 6px;
    opacity: 0.6;
}

/* Quick Actions */
.ql-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.ql-quick-btn {
    padding: 8px 14px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.ql-quick-btn:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
}

/* Typing Indicator */
.ql-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    width: fit-content;
}

.ql-typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6366f1;
    animation: typing 1.4s infinite;
}

.ql-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.ql-typing-indicator 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; }
}

/* Lead Form */
.ql-lead-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.ql-lead-form input {
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.ql-lead-form input:focus {
    outline: none;
    border-color: #6366f1;
}

.ql-submit-btn {
    padding: 10px 16px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.ql-submit-btn:hover {
    transform: translateY(-1px);
}

/* Input Container */
.ql-input-container {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.ql-message-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    transition: border-color 0.2s ease;
}

.ql-message-input:focus {
    outline: none;
    border-color: #6366f1;
}

.ql-send-btn {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.ql-send-btn:hover {
    transform: translateY(-2px);
}

.ql-send-btn svg {
    width: 20px;
    height: 20px;
    stroke: white;
    stroke-width: 2;
}

/* Responsive Design */
@media (max-width: 480px) {
    .ql-chat-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 140px);
        bottom: 80px;
    }
    
    .ql-chatbot-container.bottom-right,
    .ql-chatbot-container.bottom-left {
        left: 20px;
        right: 20px;
    }
}