/* Ernie Chat Widget Styles */
#ernie-chat-widget {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s ease;
}

#ernie-chat-widget:hover {
    transform: scale(1.05);
}

#ernie-chat-widget .ernie-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color, #1e293b);
    text-align: center;
    background: var(--white, #ffffff);
    padding: 6px 12px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
}

#ernie-chat-widget .ernie-image {
    width: 80px;
    height: auto;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    background: var(--white, #ffffff);
    padding: 4px;
}

/* Modal Styles */
#ernie-chat-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#ernie-chat-modal.active {
    display: flex;
}

#ernie-chat-modal-content {
    background: var(--white, #ffffff);
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#ernie-chat-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

#ernie-chat-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color, #1e293b);
}

#ernie-chat-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
}

#ernie-chat-modal-close:hover {
    background: var(--bg-secondary, #f1f5f9);
    color: var(--text-color, #1e293b);
}

#ernie-chat-modal-body {
    padding: 24px;
}

#ernieContactForm {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#ernieContactForm > div:first-child {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

#ernieContactForm label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color, #1e293b);
}

#ernieContactForm input,
#ernieContactForm textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

#ernieContactForm input:focus,
#ernieContactForm textarea:focus {
    outline: none;
    border-color: var(--primary-accent, #2563eb);
}

#ernieContactForm textarea {
    resize: vertical;
}

#ernieFormMessage {
    display: none;
    padding: 16px;
    border-radius: 8px;
    margin-top: 8px;
}

#ernieFormMessage.success {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
    border: 1px solid #16a34a;
}

#ernieFormMessage.error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid #dc2626;
}

/* Mobile Responsive */
@media (max-width: 640px) {
    #ernie-chat-widget {
        bottom: 15px;
        left: 15px;
    }

    #ernie-chat-widget .ernie-image {
        width: 60px;
    }

    #ernie-chat-widget .ernie-text {
        font-size: 12px;
        padding: 4px 8px;
    }

    #ernie-chat-modal-content {
        max-height: 95vh;
        margin: 10px;
    }

    #ernie-chat-modal-header {
        padding: 16px 20px;
    }

    #ernie-chat-modal-header h2 {
        font-size: 20px;
    }

    #ernie-chat-modal-body {
        padding: 20px;
    }

    #ernieContactForm > div:first-child {
        grid-template-columns: 1fr;
    }
}

