/* Pro Chat Widget - Modern Professional Style */
.pro-chat-widget-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Toggle Button with Text */
.pro-chat-toggle {
    background: linear-gradient(135deg, #007bff, #0056b3);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    outline: none;
    padding: 10px 18px;
    border-radius: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pro-chat-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.chat-button-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-button-text {
    color: white;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.pro-chat-toggle svg {
    transition: transform 0.3s ease;
}

/* Close icon inside button */
.pro-chat-toggle .close-icon {
    width: 20px;
    height: 20px;
}

/* Chat Box */
.pro-chat-box {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 320px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2), 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

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

/* Header */
.pro-chat-header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pro-chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.pro-chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    margin: 0;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.pro-chat-close:hover {
    opacity: 1;
}

/* Body */
.pro-chat-body {
    padding: 20px;
    background: #ffffff;
}

.pro-chat-intro {
    font-size: 14px;
    color: #6c757d;
    margin: 0 0 16px 0;
    text-align: center;
}

/* Form Fields - Consistent Styling for ALL Fields */
.pro-chat-field {
    margin-bottom: 16px;
}

/* Style ALL input and textarea the SAME with VISIBLE border */
.pro-chat-field input,
.pro-chat-field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d0d0d0 !important;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    font-weight: normal;
    line-height: 1.5;
    transition: all 0.2s;
    box-sizing: border-box;
    margin: 0;
    
    /* Force light background regardless of site theme */
    background: #fafafa !important;
    color: #333333 !important;
    background-color: #fafafa !important;
}

/* Override any dark theme styles on inputs */
.pro-chat-field input,
.pro-chat-field textarea,
.pro-chat-field input:focus,
.pro-chat-field textarea:focus,
.pro-chat-field input:active,
.pro-chat-field textarea:active,
.pro-chat-field input:hover,
.pro-chat-field textarea:hover {
    background: #fafafa !important;
    background-color: #fafafa !important;
    color: #333333 !important;
    border: 1px solid #d0d0d0 !important;
}

/* Focus state for ALL fields - different border color */
.pro-chat-field input:focus,
.pro-chat-field textarea:focus {
    outline: none;
    border: 1px solid #007bff !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Placeholder text color for ALL fields */
.pro-chat-field input::placeholder,
.pro-chat-field textarea::placeholder {
    color: #999999 !important;
    font-size: 14px;
    font-weight: normal;
    opacity: 1;
}

/* For older browsers */
.pro-chat-field input::-webkit-input-placeholder,
.pro-chat-field textarea::-webkit-input-placeholder {
    color: #999999 !important;
    font-size: 14px;
}

.pro-chat-field input:-moz-placeholder,
.pro-chat-field textarea:-moz-placeholder {
    color: #999999 !important;
    font-size: 14px;
}

/* Textarea specific - keep consistent with inputs */
.pro-chat-field textarea {
    resize: vertical;
    min-height: 80px;
    max-height: 150px;
}

/* Character Counter */
.char-counter {
    text-align: right;
    font-size: 11px;
    color: #999;
    margin-top: 5px;
}

#char-count {
    font-weight: 600;
    color: #007bff;
}

/* Error Messages */
.error-message {
    display: block;
    font-size: 11px;
    color: #dc3545;
    margin-top: 4px;
    min-height: 16px;
}

/* Error Border for ALL fields */
.error-border {
    border: 1px solid #dc3545 !important;
    background: #fff8f8 !important;
}

/* Submit Button */
.pro-chat-submit {
    width: 100%;
    background: linear-gradient(135deg, #28a745, #1e7e34);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.pro-chat-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.pro-chat-submit:active {
    transform: translateY(0);
}

.pro-chat-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Response Message */
.pro-chat-response {
    margin-top: 12px;
    text-align: center;
    font-size: 13px;
    min-height: 40px;
}

.pro-chat-response.success {
    color: #28a745;
}

.pro-chat-response.error {
    color: #dc3545;
}

/* Loading Spinner */
.pro-chat-submit.loading {
    position: relative;
    color: transparent;
}

.pro-chat-submit.loading::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin-left: -9px;
    margin-top: -9px;
    border: 2px solid white;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Mobile Responsive - Show text on mobile with adjusted sizing */
@media (max-width: 480px) {
    .pro-chat-box {
        width: calc(100vw - 40px);
        right: 0;
        bottom: 70px;
    }
    
    /* Keep pill shape but adjust padding for mobile */
    .pro-chat-toggle {
        padding: 8px 14px;
        gap: 6px;
    }
    
    .chat-button-text {
        font-size: 12px;
        white-space: nowrap;
    }
    
    .pro-chat-toggle svg {
        width: 18px;
        height: 18px;
    }
    
    .chat-button-content {
        gap: 6px;
    }
}