/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500&display=swap');

/* iAM Smart Button - High specificity to override Elementor and theme styles */
.iamsmart-container .iamsmart-button,
button.iamsmart-button,
.iamsmart-button.iamsmart-button {
    background-color: #2B7367 !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 8px 12px !important; /* Reduced padding */
    cursor: pointer !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    font-family: 'Noto Sans SC', Arial, sans-serif !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    outline: none !important;
    transition: background-color 0.2s ease !important;
    box-shadow: none !important;
    border-left: none !important;
    margin: 0 !important;
    line-height: normal !important;
}

.iamsmart-container .iamsmart-button:hover,
button.iamsmart-button:hover,
.iamsmart-button.iamsmart-button:hover {
    background-color: #1f5a50 !important;
    color: white !important;
    border: none !important;
    box-shadow: none !important;
}

.iamsmart-container .iamsmart-button:active,
.iamsmart-container .iamsmart-button:focus,
button.iamsmart-button:active,
button.iamsmart-button:focus,
.iamsmart-button.iamsmart-button:active,
.iamsmart-button.iamsmart-button:focus {
    background-color: #1f5a50 !important;
    color: white !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Logo */
.iamsmart-button .iamsmart-logo {
    height: 28px !important; /* Increased height */
    width: 21px !important; /* Set width for aspect ratio */
    margin-right: 8px !important; /* Matched to button's side padding */
    margin-left: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Button text */
.iamsmart-button .iamsmart-text {
    font-size: 16px !important;
    white-space: nowrap !important;
    color: white !important;
}

/* Loading state */
.iamsmart-button.loading {
    pointer-events: none !important;
    opacity: 0.7 !important; /* Make button dimmer */
}

/* Container */
.iamsmart-container {
    text-align: left;
    max-width: 1800px; /* Match the form container width */
    margin: 0 auto; /* Center the container like the form */
    padding: 0 20px; /* Match the form container padding */
    box-sizing: border-box; /* Ensure padding is included in width calculation */
}

/* Override any Elementor or theme positioning for the button container */
.elementor-widget-shortcode .iamsmart-container,
.elementor-shortcode .iamsmart-container,
div.iamsmart-container {
    text-align: left !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
    display: block !important;
}

/* Error message - Proper error styling */
.iamsmart-error {
    color: #d63638 !important;
    background-color: #ffebe9 !important;
    padding: 10px !important;
    border-left: 4px solid #d63638 !important;
    margin-bottom: 15px !important;
    border-radius: 4px !important;
    border: 1px solid #ffcdd2 !important;
    display: block !important;
    font-family: inherit !important;
    font-size: 14px !important;
}

/* iAM Smart Error Message */
.iamsmart-error-message {
    background-color: #f8d7da !important;
    border: 1px solid #f5c6cb !important;
    color: #721c24 !important;
    padding: 6px 10px !important;
    margin: 10px 0 !important;
    border-radius: 3px !important;
    font-size: 13px !important;
    font-family: 'Noto Sans SC', Arial, sans-serif !important;
    line-height: 1.3 !important;
    display: block !important;
    box-sizing: border-box !important;
    width: fit-content !important;
    max-width: 100% !important;
    text-align: left !important;
    clear: both !important;
}

/* Severity variants */
.iamsmart-error-message.is-error {
    background-color: #f8d7da !important;
    border-color: #f5c6cb !important;
    color: #721c24 !important;
}
.iamsmart-error-message.is-warning {
    background-color: #fff3cd !important;
    border-color: #ffe8a1 !important;
    color: #856404 !important;
}
.iamsmart-error-message.is-info {
    background-color: #e2f0ff !important;
    border-color: #b6dcfe !important;
    color: #0a4b78 !important;
}

/* Form message styles */
.iamsmart-form-messages {
    margin-top: 15px;
    padding: 12px;
    border-radius: 4px;
    font-size: 14px;
}

.iamsmart-form-messages.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.iamsmart-form-messages.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.iamsmart-form-messages p {
    margin: 0;
}

/* IAM Smart Form Styles */
.iamsmart-form-container {
    max-width: 1800px; /* Increased from 600px (20% wider) */
    margin: 0 auto;
    padding: 20px;
    font-family: 'Noto Sans SC', Arial, sans-serif;
}

.iamsmart-form {
    background: white;
    padding: 0;
}

.iamsmart-field-group {
    margin-bottom: 20px;
    position: relative;
    margin-right: 50px; /* Add right margin to make room for tags */
}

.iamsmart-label {
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 400;
    color: #333;
    font-family: 'Noto Sans SC', Arial, sans-serif;
}

.iamsmart-required {
    color: #ff4444;
    font-weight: normal;
}

.iamsmart-input,
.iamsmart-select,
.iamsmart-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Noto Sans SC', Arial, sans-serif;
    background-color: #fff;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.iamsmart-input:focus,
.iamsmart-select:focus,
.iamsmart-textarea:focus {
    outline: none;
    border-color: #4285f4;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}

.iamsmart-input::placeholder,
.iamsmart-textarea::placeholder {
    color: #9aa0a6;
    font-size: 16px;
}

.iamsmart-select {
    cursor: pointer;
    background-color: #fff !important;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%23666"><path d="M8 12L3 7h10z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.iamsmart-select option {
    font-family: 'Noto Sans SC', Arial, sans-serif;
    padding: 8px;
}

.iamsmart-textarea {
    resize: vertical;
    min-height: 100px;
}

.iamsmart-submit-group {
    text-align: center;
    margin-top: 30px;
}

.iamsmart-submit-button {
    background-color: #4285f4;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 500;
    font-family: 'Noto Sans SC', Arial, sans-serif;
    cursor: pointer;
    transition: background-color 0.2s ease;
    min-width: 120px;
}

.iamsmart-submit-button:hover {
    background-color: #3367d6;
}

.iamsmart-submit-button:active {
    background-color: #2d5aa0;
}

.iamsmart-submit-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.3);
}

.iamsmart-submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Smart Tag Styles - Positioned outside fields */
.iamsmart-tag {
    position: absolute;
    right: -40px; /* Position outside the field */
    bottom: 0; /* Align with bottom of field group */
    height: 44px; /* Fixed height matching input field */
    width: auto; /* Let width adjust based on image aspect ratio */
    min-width: 24px; /* Minimum width for consistency */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
    background-color: transparent;
}

.iamsmart-tag img {
    height: 44px; /* Fixed height that matches typical field height */
    width: auto; /* Width adjusts automatically to maintain aspect ratio */
    display: block;
    object-fit: contain; /* Maintain aspect ratio */
}

/* iAMSmart Data Legend */
.iamsmart-data-legend {
    display: none;
    margin: 20px 0;
    padding: 0;
    background: none;
    border: none;
    font-size: 16px;
    color: #333;
    font-family: 'Noto Sans SC', Arial, sans-serif;
    align-items: center;
    gap: 8px;
}

.iamsmart-data-legend.show {
    display: flex;
}

.iamsmart-data-legend .iamsmart-legend-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.iamsmart-data-legend .iamsmart-legend-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.iamsmart-data-legend .iamsmart-legend-text {
    line-height: 1.4;
    font-weight: 400;
}

/* Responsive design */
@media (max-width: 768px) {
    .iamsmart-container {
        padding: 0 15px; /* Match mobile form padding */
    }
    
    .iamsmart-form-container {
        padding: 15px;
    }
    
    .iamsmart-field-group {
        margin-right: 44px; /* Adjust margin for mobile */
    }.iamsmart-tag {
        right: -36px; /* Closer on mobile */
        height: 38px; /* Smaller height on mobile */
        min-width: 20px; /* Smaller minimum width on mobile */
    }
    
    .iamsmart-tag img {
        height: 38px; /* Slightly smaller height on mobile */
        width: auto; /* Width still adjusts automatically */
    }
    
    .iamsmart-input,
    .iamsmart-select,
    .iamsmart-textarea {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}