/* EziRepair AI Chatbot - Frontend Styles */

/* Chatbot Widget - Floating Button */
#ezirepair-chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.ezirepair-chatbot-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #0f2684;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(15, 38, 132, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.ezirepair-chatbot-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(15, 38, 132, 0.4);
}

.ezirepair-chatbot-button:active {
    transform: scale(0.95);
}

.ezirepair-chatbot-icon,
.ezirepair-chatbot-close-icon {
    width: 28px;
    height: 28px;
    color: white;
    transition: opacity 0.2s ease;
}

.ezirepair-chatbot-icon {
    opacity: 1;
}

.ezirepair-chatbot-close-icon {
    opacity: 0;
    position: absolute;
}

.ezirepair-chatbot-button.active .ezirepair-chatbot-icon {
    opacity: 0;
}

.ezirepair-chatbot-button.active .ezirepair-chatbot-close-icon {
    opacity: 1;
}

/* Chat Window */
.ezirepair-chatbot-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    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 */
.ezirepair-chatbot-header {
    background: #0f2684;
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

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

.ezirepair-chatbot-avatar svg {
    width: 24px;
    height: 24px;
    color: white;
}

.ezirepair-chatbot-header-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
}

.ezirepair-chatbot-status {
    font-size: 13px;
    opacity: 0.9;
}

.ezirepair-chatbot-minimize-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ezirepair-chatbot-minimize-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.ezirepair-chatbot-minimize-btn svg {
    width: 20px;
    height: 20px;
}

/* Messages Container */
.ezirepair-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

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

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

.ezirepair-chatbot-messages::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.ezirepair-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Message Styles */
.ezirepair-chatbot-message {
    margin-bottom: 16px;
    display: flex;
    animation: fadeIn 0.3s ease;
}

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

.ezirepair-chatbot-message-content {
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 80%;
    line-height: 1.5;
    font-size: 14px;
    word-wrap: break-word;
}

.ezirepair-chatbot-message-bot .ezirepair-chatbot-message-content {
    background: white;
    color: #2d3748;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

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

.ezirepair-chatbot-message-user .ezirepair-chatbot-message-content {
    background: #0f2684;
    color: white;
    border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.ezirepair-chatbot-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    width: fit-content;
    margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.ezirepair-chatbot-typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #0f2684;
    opacity: 0.6;
    animation: bounce 1.4s infinite ease-in-out both;
}

.ezirepair-chatbot-typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.ezirepair-chatbot-typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Input Container */
.ezirepair-chatbot-input-container {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e2e8f0;
}

.ezirepair-chatbot-form {
    display: flex;
    gap: 12px;
    align-items: center;
    align-items: stretch;
}

.ezirepair-chatbot-input {
    flex: 1;
    padding: 12px 20px;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s ease;
    font-family: inherit;
    line-height: 1.5;
}

.ezirepair-chatbot-input:focus {
    border-color: #0f2684;
}

.ezirepair-chatbot-send-btn {
    min-width: 48px !important;
    min-height: 48px !important;
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    background: #0f2684 !important;
    border: none !important;
    color: white !important;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
}

.ezirepair-chatbot-send-btn:hover {
    transform: scale(1.05);
    background: #1a3aa8;
}

.ezirepair-chatbot-send-btn:active {
    transform: scale(0.95);
}

.ezirepair-chatbot-send-btn svg {
    width: 22px;
    height: 22px;
}

/* Inline Chatbot */
.ezirepair-chatbot-inline {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.ezirepair-chatbot-inline-header {
    background: #0f2684;
    color: white;
    padding: 20px;
}

.ezirepair-chatbot-inline-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: white;
}

.ezirepair-chatbot-inline-messages {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #ezirepair-chatbot-widget {
        bottom: 10px;
        right: 10px;
    }
    
    .ezirepair-chatbot-window {
        bottom: 80px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
    }
    
    .ezirepair-chatbot-button {
        width: 56px;
        height: 56px;
    }
    
    .ezirepair-chatbot-icon,
    .ezirepair-chatbot-close-icon {
        width: 24px;
        height: 24px;
    }
}

/* Consistent styling regardless of system theme */
