/**
 * TextBlast WP Form Styles
 */

/* Base form styles */
.textblast-form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.textblast-form.textblast-vertical {
    flex-direction: column;
    align-items: stretch;
}

.textblast-form.textblast-horizontal {
    flex-direction: row;
    align-items: stretch;
}

/* Field wrapper */
.textblast-field-wrapper {
    flex: 1;
}

.textblast-form.textblast-vertical .textblast-field-wrapper {
    width: 100%;
}

.textblast-form.textblast-horizontal .textblast-field-wrapper {
    min-width: 250px;
}

/* Input field */
.textblast-input {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    transition: border-color 0.3s ease;
}

.textblast-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

/* Button */
.textblast-button {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.textblast-button:hover {
    background-color: #005a87;
}

.textblast-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.textblast-button.loading {
    position: relative;
    color: transparent;
}

.textblast-button.loading::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    top: 50%;
    left: 50%;
    margin-left: -7px;
    margin-top: -7px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: textblast-spin 0.8s linear infinite;
}

@keyframes textblast-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Button wrapper */
.textblast-button-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.textblast-form.textblast-vertical .textblast-button-wrapper {
    width: 100%;
}

.textblast-form.textblast-horizontal .textblast-button-wrapper {
    flex-shrink: 0;
}

/* Status message */
.textblast-status {
    font-size: 13px;
    padding: 0;
}

.textblast-status.success {
    color: #28a745;
}

.textblast-status.error {
    color: #dc3545;
}

/* reCAPTCHA wrapper */
.textblast-recaptcha-wrapper {
    margin: 10px 0;
}

.textblast-form.textblast-vertical .textblast-recaptcha-wrapper {
    width: 100%;
}

/* Error state */
.textblast-form .textblast-input.error {
    border-color: #dc3545;
}

/* Loading state */
.textblast-form.loading .textblast-input,
.textblast-form.loading .textblast-button {
    opacity: 0.6;
    pointer-events: none;
}

/* Elementor overrides */
.elementor-form.textblast-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.elementor-form.textblast-form .elementor-form-fields-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.elementor-form.textblast-form.textblast-horizontal .elementor-form-fields-wrapper {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
}

.elementor-form.textblast-form .elementor-field-group {
    display: flex;
    flex-direction: column;
    margin: 0 ;
}

.elementor-form.textblast-form.textblast-horizontal .elementor-field-group.elementor-col-50 {
    flex: 0 1 calc(50% - 7.5px);
}

.elementor-form.textblast-form.textblast-horizontal .elementor-field-group.e-form__buttons.elementor-col-50 {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 0;
}

.elementor-form.textblast-form.textblast-horizontal .elementor-field-group.elementor-col-100 {
    flex: 0 1 100%;
}

.elementor-form.textblast-form .elementor-field-label {
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 14px;
}

.elementor-form.textblast-form .elementor-field-label.elementor-screen-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.elementor-form.textblast-form .elementor-field {
    padding: 10px 12px ;
    border: 1px solid #ccc ;
    border-radius: 4px ;
    font-size: 14px ;
}

.elementor-form.textblast-form .elementor-field:focus {
    border-color: #0073aa ;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1) ;
}

.elementor-form.textblast-form .elementor-button {
    padding: 10px 20px;
    font-weight: 600 ;
    background-color: #0073aa;
    border: none ;
    border-radius: 4px ;
    margin: 0 ;
    flex: 1;
}

.elementor-form.textblast-form .elementor-button:hover {
    background-color: #005a87 ;
}

/* Responsive */
@media (max-width: 768px) {
    .textblast-form.textblast-horizontal {
        flex-direction: column;
        align-items: stretch;
    }

    .textblast-form.textblast-horizontal .textblast-field-wrapper {
        min-width: auto;
    }

    .textblast-form.textblast-horizontal .textblast-button-wrapper {
        width: 100%;
    }

    .textblast-button {
        width: 100%;
    }
}
