/* Trengo-style Exact Match CSS */

:root {
    --bia-primary-color: #B48859;
}

/* Reset and Base Styles */
.bia-chat-wrapper,
.bia-chat-wrapper * {
    margin: 0;
    padding: 0;
    border: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
}

.bia-chat-wrapper {
    position: fixed !important;
    z-index: 999999 !important;
    bottom: 20px !important;
    font-size: 15px !important;
    line-height: 1.5 !important;
    color: #000000 !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

.bia-chat-wrapper[data-position="left"] {
    left: 20px !important;
}

.bia-chat-wrapper[data-position="right"] {
    right: 20px !important;
}

.bia-chat-wrapper[data-position="right"] .bia-chat-modal {
    right: 0 !important;
    left: auto !important;
    transform-origin: bottom right !important;
}

/* Chat Launcher Button */
.bia-chat-launcher {
    width: 60px !important;
    height: 60px !important;
    border-radius: 30px 30px 30px 0px !important;
    cursor: pointer !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: var(--bia-primary-color) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    transition: all 0.2s ease !important;
}

.bia-chat-launcher:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2) !important;
}

.launcher-stripes {
    display: flex !important;
    gap: 4px !important;
    align-items: center !important;
    justify-content: center !important;
    height: 20px !important;
}

.launcher-stripes .stripe {
    width: 3px !important;
    height: 100% !important;
    background: white !important;
    border-radius: 3px !important;
    display: block !important;
}

.launcher-stripes .stripe:nth-child(1) { height: 14px !important; }
.launcher-stripes .stripe:nth-child(2) { height: 20px !important; }
.launcher-stripes .stripe:nth-child(3) { height: 14px !important; }

/* Chat Modal */
.bia-chat-modal {
    position: absolute !important;
    bottom: 80px !important;
    left: 0 !important;
    width: 380px !important;
    height: auto !important;
    max-height: 700px !important;
    min-height: 550px !important;
    background: #FFFFFF !important;
    border-radius: 24px !important;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12) !important;
    flex-direction: column !important;
    overflow: hidden !important;
    transform-origin: bottom left !important;
    border: none !important;
    display: none !important;
}

.bia-chat-modal.bia-modal-open {
    display: flex !important;
}

/* Header */
.bia-chat-header {
    padding: 28px 24px 10px 24px !important;
    background: #FFFFFF !important;
    position: relative !important;
    flex-shrink: 0 !important;
    z-index: 10 !important;
    order: 1 !important;
}

/* Soft gradient separator below header */
.bia-chat-header::after {
    content: '' !important;
    position: absolute !important;
    bottom: -20px !important;
    left: 0 !important;
    width: 100% !important;
    height: 20px !important;
    background: linear-gradient(to bottom, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%) !important;
    z-index: 2 !important;
    pointer-events: none !important;
}

.bia-chat-header-content {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
}

.bia-team-info {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    padding-right: 10px !important;
}

.bia-team-details {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin-bottom: 8px !important;
}

.bia-team-details h3 {
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #000000 !important;
    margin: 0 !important;
    letter-spacing: -0.5px !important;
    line-height: 1.2 !important;
}

.bia-status-badge {
    display: inline-flex !important;
    align-items: center !important;
    padding: 4px 10px !important;
    background: #237c70 !important; /* Darker green from screenshot */
    color: #FFFFFF !important;
    border-radius: 100px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    margin-top: 4px !important;
}

.bia-chat-close {
    background: transparent !important;
    border: none !important;
    color: #9E9E9E !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin-top: 4px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: color 0.2s !important;
}

.bia-chat-close:hover {
    color: #000000 !important;
}

.bia-chat-close svg {
    width: 24px !important;
    height: 24px !important;
}

/* Team Tagline */
.bia-team-tagline {
    font-size: 15px !important;
    color: #1a1a1a !important;
    line-height: 1.4 !important;
    margin: 12px 0 20px 0 !important;
    font-weight: 400 !important;
}

/* Avatars Section */
.bia-avatar-section {
    display: flex !important;
    gap: 16px !important;
    padding: 0 !important;
    align-items: flex-start !important;
}

.bia-avatar-wrapper {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 8px !important;
    width: 64px !important;
}

.bia-avatar {
    width: 64px !important;
    height: 64px !important;
    border-radius: 20px !important; /* Squircle shape from screenshot */
    background: var(--bia-primary-color) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    position: relative !important;
}

.bia-avatar img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.bia-avatar-text {
    color: white !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    line-height: 1.2 !important;
    text-align: center !important;
}

.bia-avatar-name {
    font-size: 13px !important;
    color: #9E9E9E !important;
    font-weight: 400 !important;
    text-align: center !important;
}

/* Chat Body */
.bia-chat-body {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 10px 24px 24px 24px !important;
    background: #FFFFFF !important;
    position: relative !important;
    order: 3 !important;
}

/* Pre-form Text */
.bia-pre-form-text {
    font-size: 15px !important;
    line-height: 1.5 !important;
    color: #000000 !important;
    margin-bottom: 24px !important;
    margin-top: 10px !important;
}

/* Form Styling */
.bia-email-form {
    width: 100% !important;
}

.bia-form-group {
    position: relative !important;
    margin-bottom: 16px !important;
}

.bia-form-group input,
.bia-form-group textarea {
    width: 100% !important;
    padding: 16px 16px !important;
    border: 1px solid #F0F0F0 !important;
    border-radius: 16px !important; /* Matching screenshot rounded inputs */
    font-size: 15px !important;
    color: #000000 !important;
    background: #FFFFFF !important;
    transition: all 0.2s !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02) !important; /* Very subtle shadow */
    resize: none !important;
}

.bia-form-group input:focus,
.bia-form-group textarea:focus {
    outline: none !important;
    border-color: var(--bia-primary-color) !important;
    box-shadow: 0 2px 12px rgba(180, 136, 89, 0.1) !important;
}

.bia-form-group label {
    display: none !important; /* Hiding labels to match screenshot placeholders */
}

/* Exception for file upload label */
.bia-form-group .bia-file-upload-label {
    display: flex !important;
}

/* Select dropdown label */
.bia-form-group .bia-select-label {
    display: block !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #000000 !important;
    margin-bottom: 8px !important;
}

.bia-form-group input::placeholder,
.bia-form-group textarea::placeholder {
    color: #9E9E9E !important;
    font-weight: 400 !important;
    font-size: 15px !important;
}

/* Textarea with Submit Button */
.bia-form-group-textarea {
    position: relative !important;
    margin-bottom: 0 !important;
}

.bia-form-group-textarea textarea {
    min-height: 140px !important;
    padding-bottom: 60px !important; /* Space for button */
}

.bia-submit-button {
    position: absolute !important;
    bottom: 12px !important;
    right: 12px !important;
    width: 48px !important;
    height: 36px !important; /* Rounded rectangle shape */
    border-radius: 18px !important;
    background: var(--bia-primary-color) !important; /* Match brand color */
    border: none !important;
    color: white !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s !important;
    box-shadow: 0 2px 8px rgba(180, 136, 89, 0.3) !important;
}

.bia-submit-button:hover {
    transform: scale(1.05) !important;
}

.bia-submit-button svg {
    width: 20px !important;
    height: 20px !important;
    transform: translateX(1px) !important; /* Visual correction */
}

/* Tab Navigation */
.bia-chat-tabs {
    display: flex !important;
    background: #FFFFFF !important;
    /* border-top: 1px solid #F5F5F5 !important; Remove border for cleaner look */
    padding: 8px 24px 16px 24px !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
    justify-content: center !important;
    gap: 24px !important;
    order: 2 !important;
}

.bia-tab {
    width: auto !important;
    padding: 10px !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #BDBDBD !important; /* Lighter inactive color */
    transition: all 0.2s !important;
    position: relative !important;
}

.bia-tab:hover {
    color: #9E9E9E !important;
}

.bia-tab.active {
    color: var(--bia-primary-color) !important;
}

.bia-tab.active svg {
    stroke-width: 2px !important;
    filter: drop-shadow(0 2px 4px rgba(180, 136, 89, 0.2)) !important;
}

/* Underline indicator for active tab */
.bia-tab.active::after {
    content: '' !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 20px !important;
    height: 3px !important;
    background: var(--bia-primary-color) !important;
    border-radius: 3px !important;
}

.bia-tab svg {
    width: 28px !important;
    height: 28px !important;
}

/* WhatsApp Screen */
.bia-whatsapp-screen {
    text-align: center !important;
    padding: 40px 20px !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
}

.bia-whatsapp-icon {
    margin-bottom: 24px !important;
    color: #25D366 !important;
}

.bia-whatsapp-screen p {
    font-size: 15px !important;
    color: #616161 !important;
    line-height: 1.6 !important;
    margin-bottom: 32px !important;
}

.bia-whatsapp-button {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 14px 32px !important;
    background: #25D366 !important;
    color: white !important;
    border: none !important;
    border-radius: 100px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    text-decoration: none !important;
    transition: all 0.2s !important;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.25) !important;
}

.bia-whatsapp-button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.35) !important;
}

/* Scrollbar Styling */
.bia-chat-body::-webkit-scrollbar {
    width: 4px !important;
}

.bia-chat-body::-webkit-scrollbar-track {
    background: transparent !important;
}

.bia-chat-body::-webkit-scrollbar-thumb {
    background: #E0E0E0 !important;
    border-radius: 4px !important;
}

/* Animation */
@keyframes modalPop {
    0% {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.bia-chat-modal[style*="display: block"] {
    animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    display: flex !important;
}

/* FAQ Styling */
.bia-faq-container {
    padding: 0 !important;
}

.bia-faq-category {
    margin-bottom: 8px !important;
    border-radius: 12px !important;
    overflow: hidden !important;
}

.bia-faq-category-header {
    padding: 14px 16px !important;
    background: #F8F8F8 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #333333 !important;
    cursor: pointer !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    transition: background 0.2s !important;
    border-radius: 12px !important;
}

.bia-faq-category-header:hover {
    background: #F0F0F0 !important;
}

.bia-faq-category-header::after {
    content: '+' !important;
    font-size: 18px !important;
    font-weight: 400 !important;
    color: #9E9E9E !important;
    transition: transform 0.2s !important;
}

.bia-faq-category.active .bia-faq-category-header::after {
    content: '−' !important;
}

.bia-faq-items {
    display: none !important;
    padding: 0 !important;
    background: #FFFFFF !important;
}

.bia-faq-category.active .bia-faq-items {
    display: block !important;
}

.bia-faq-item {
    padding: 12px 16px !important;
    font-size: 14px !important;
    color: #666666 !important;
    cursor: pointer !important;
    border-bottom: 1px solid #F5F5F5 !important;
    transition: background 0.2s, color 0.2s !important;
}

.bia-faq-item:last-child {
    border-bottom: none !important;
}

.bia-faq-item:hover {
    background: #FAFAFA !important;
    color: #333333 !important;
}

.bia-faq-item.active {
    background: #FAFAFA !important;
}

.bia-faq-question {
    display: block !important;
}

.bia-faq-answer {
    display: none !important;
    margin-top: 10px !important;
    padding-top: 10px !important;
    border-top: 1px solid #EEEEEE !important;
    font-size: 13px !important;
    color: #555555 !important;
    line-height: 1.5 !important;
}

.bia-faq-item.active .bia-faq-answer {
    display: block !important;
}

/* Hidden class for conditional fields */
.bia-conditional-field.bia-hidden,
.bia-whatsapp-suggestion.bia-hidden {
    display: none !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0 !important;
}

/* Radio Button Group Styling */
.bia-radio-group {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
}

.bia-radio-option {
    display: flex !important;
    align-items: center !important;
    padding: 12px 16px !important;
    border: 1px solid #E0E0E0 !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    color: #000000 !important;
    background: #FFFFFF !important;
    font-size: 15px !important;
    transition: all 0.2s !important;
}

.bia-radio-option:hover {
    border-color: var(--bia-primary-color) !important;
    background: #FFF9F5 !important;
}

.bia-radio-option input[type="radio"] {
    width: 18px !important;
    height: 18px !important;
    margin-right: 12px !important;
    accent-color: var(--bia-primary-color) !important;
}

.bia-radio-option span {
    color: #000000 !important;
}

.bia-radio-option input[type="radio"]:checked + span {
    font-weight: 600 !important;
}

/* Date Picker Styling */
.bia-form-group input[type="date"] {
    width: 100% !important;
    padding: 14px 16px !important;
    border: 1px solid #E0E0E0 !important;
    border-radius: 12px !important;
    font-size: 15px !important;
    color: #000000 !important;
    background: #FFFFFF !important;
    cursor: pointer !important;
}

.bia-form-group input[type="date"]:focus {
    border-color: var(--bia-primary-color) !important;
    outline: none !important;
}

/* Time Select Styling */
.bia-form-group select {
    width: 100% !important;
    padding: 14px 16px !important;
    border: 1px solid #E0E0E0 !important;
    border-radius: 12px !important;
    font-size: 15px !important;
    color: #000000 !important;
    background: #FFFFFF !important;
    cursor: pointer !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='%23666'%3E%3Cpath d='M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
}

.bia-form-group select:focus {
    border-color: var(--bia-primary-color) !important;
    outline: none !important;
}

.bia-form-group select option {
    color: #000000 !important;
    background: #FFFFFF !important;
    padding: 10px !important;
}

/* Full Width Submit Button */
.bia-submit-button-full {
    width: 100% !important;
    padding: 14px 24px !important;
    border: none !important;
    border-radius: 12px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #FFFFFF !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    transition: all 0.2s !important;
}

.bia-submit-button-full:hover {
    opacity: 0.9 !important;
    transform: translateY(-1px) !important;
}

.bia-submit-button-full svg {
    fill: #FFFFFF !important;
}

/* WhatsApp Suggestion Box */
.bia-whatsapp-suggestion {
    margin-bottom: 16px !important;
}

.bia-suggestion-box {
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%) !important;
    border-radius: 16px !important;
    padding: 16px !important;
    text-align: center !important;
}

.bia-suggestion-box p {
    font-size: 14px !important;
    color: #2E7D32 !important;
    margin: 0 0 12px 0 !important;
    line-height: 1.4 !important;
}

.bia-suggestion-box p strong {
    font-weight: 600 !important;
}

.bia-whatsapp-button-small {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 10px 20px !important;
    background: #25D366 !important;
    color: white !important;
    border: none !important;
    border-radius: 100px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    text-decoration: none !important;
    transition: all 0.2s !important;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.25) !important;
}

.bia-whatsapp-button-small:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35) !important;
}

.bia-suggestion-subtext {
    font-size: 12px !important;
    color: #558B2F !important;
    margin: 12px 0 0 0 !important;
}

/* File Upload Styling */
.bia-file-upload-label {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    cursor: pointer !important;
    padding: 12px 16px !important;
    border: 2px dashed #E0E0E0 !important;
    border-radius: 16px !important;
    transition: all 0.2s !important;
    background: #FAFAFA !important;
}

.bia-file-upload-label:hover {
    border-color: var(--bia-primary-color) !important;
    background: #FFF8F3 !important;
}

.bia-file-upload-label input[type="file"] {
    display: none !important;
}

.bia-file-upload-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 8px 16px !important;
    background: var(--bia-primary-color) !important;
    color: white !important;
    border-radius: 100px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
}

.bia-file-upload-btn svg {
    fill: white !important;
}

.bia-file-name {
    font-size: 13px !important;
    color: #9E9E9E !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    flex: 1 !important;
}

.bia-file-name.has-file {
    color: #333333 !important;
}

/* Conditional Field Animation */
.bia-conditional-field {
    transition: all 0.3s ease !important;
}

/* Form Message Styling */
.bia-form-message {
    padding: 12px 16px !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    margin-top: 16px !important;
}

.bia-form-message.success {
    background: #E8F5E9 !important;
    color: #2E7D32 !important;
}

.bia-form-message.error {
    background: #FFEBEE !important;
    color: #C62828 !important;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .bia-chat-modal {
        width: calc(100vw - 40px) !important;
        max-width: 400px !important;
        bottom: 90px !important;
        height: auto !important;
        max-height: 80vh !important;
    }
    
    .bia-file-upload-label {
        flex-wrap: wrap !important;
    }
    
    .bia-file-name {
        width: 100% !important;
        margin-top: 8px !important;
    }
}
