/* WhatsApp Forms CSS */

/* Popup Overlay */
.wa-forms-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
}

    .wa-forms-overlay.active {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 20px;
        box-sizing: border-box;
    }

/* Popup Container */
.wa-forms-popup {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: wa-forms-fadeIn 0.3s ease-out;
    margin: auto;
    transform: translateY(0);
}

@keyframes wa-forms-fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Popup Header */
.wa-forms-header {
    padding: 20px 25px 15px;
    border-bottom: 1px solid #e5e5e5;
    position: relative;
}

.wa-forms-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.wa-forms-subtitle {
    margin: 5px 0 0;
    font-size: 14px;
    color: #666;
}

.wa-forms-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .wa-forms-close:hover {
        color: #333;
    }

/* Form Body */
.wa-forms-body {
    padding: 25px;
}

/* Form Fields */
.wa-forms-field {
    margin-bottom: 20px;
}

.wa-forms-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.wa-forms-required {
    color: #e74c3c;
}

.wa-forms-input,
.wa-forms-select,
.wa-forms-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

    .wa-forms-input:focus,
    .wa-forms-select:focus,
    .wa-forms-textarea:focus {
        outline: none;
        border-color: #2563EB;
        box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.1);
    }

    .wa-forms-input::placeholder {
        color: #999;
    }

.wa-forms-textarea {
    resize: vertical;
    min-height: 80px;
}

/* Error States */
.wa-forms-field.error .wa-forms-input,
.wa-forms-field.error .wa-forms-select,
.wa-forms-field.error .wa-forms-textarea {
    border-color: #e74c3c;
}

.wa-forms-error-message {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.wa-forms-field.error .wa-forms-error-message {
    display: block;
}

/* Form Actions */
.wa-forms-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 20px 25px;
    border-top: 1px solid #e5e5e5;
    background-color: #f8f9fa;
}

.wa-forms-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.wa-forms-btn-cancel {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #ddd;
}

    .wa-forms-btn-cancel:hover {
        background: #e9ecef;
        color: #333;
    }

.wa-forms-btn-whatsapp {
    background: #2563EB;
    color: white;
}

    .wa-forms-btn-whatsapp:hover {
        background: #20ba5a;
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
    }

.wa-forms-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* WhatsApp Icon */
.wa-whatsapp-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Apply Button - Override all button styles with highest specificity */
html body div button.wa-forms-trigger[class*="wa-forms-trigger"],
html body div .wa-forms-trigger[class*="wa-forms-trigger"],
html body div [type="button"].wa-forms-trigger[class*="wa-forms-trigger"],
html body div [type="submit"].wa-forms-trigger[class*="wa-forms-trigger"],
html body button.wa-forms-trigger,
html body .wa-forms-trigger,
html body [type="button"].wa-forms-trigger,
html body [type="submit"].wa-forms-trigger {
    background-color: #2563EB !important;
    background: #2563EB !important;
    color: white !important;
    padding: 17px 40px !important;
    border: none !important;
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
    border-radius: 5px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    font-family: inherit !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    display: inline-block !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
    outline: none !important;
    line-height: 1.2 !important;
    vertical-align: middle !important;
    min-width: auto !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
}

html body div button.wa-forms-trigger[class*="wa-forms-trigger"]:hover,
html body div .wa-forms-trigger[class*="wa-forms-trigger"]:hover,
html body div [type="button"].wa-forms-trigger[class*="wa-forms-trigger"]:hover,
html body div [type="submit"].wa-forms-trigger[class*="wa-forms-trigger"]:hover,
html body button.wa-forms-trigger:hover,
html body .wa-forms-trigger:hover,
html body [type="button"].wa-forms-trigger:hover,
html body [type="submit"].wa-forms-trigger:hover {
    background-color: #128C7E !important;
    background: #128C7E !important;
    color: white !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
    border: none !important;
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
    text-decoration: none !important;
}

html body div button.wa-forms-trigger[class*="wa-forms-trigger"]:focus,
html body div .wa-forms-trigger[class*="wa-forms-trigger"]:focus,
html body div [type="button"].wa-forms-trigger[class*="wa-forms-trigger"]:focus,
html body div [type="submit"].wa-forms-trigger[class*="wa-forms-trigger"]:focus,
html body button.wa-forms-trigger:focus,
html body .wa-forms-trigger:focus,
html body [type="button"].wa-forms-trigger:focus,
html body [type="submit"].wa-forms-trigger:focus {
    background-color: #128C7E !important;
    background: #128C7E !important;
    color: white !important;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.3) !important;
    outline: none !important;
    border: none !important;
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
    text-decoration: none !important;
}

html body div button.wa-forms-trigger[class*="wa-forms-trigger"]:active,
html body div .wa-forms-trigger[class*="wa-forms-trigger"]:active,
html body div [type="button"].wa-forms-trigger[class*="wa-forms-trigger"]:active,
html body div [type="submit"].wa-forms-trigger[class*="wa-forms-trigger"]:active,
html body button.wa-forms-trigger:active,
html body .wa-forms-trigger:active,
html body [type="button"].wa-forms-trigger:active,
html body [type="submit"].wa-forms-trigger:active {
    background-color: #0d7377 !important;
    background: #0d7377 !important;
    color: white !important;
    transform: translateY(0) !important;
    border: none !important;
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
    text-decoration: none !important;
}

/* Admin Styles */
.wa-forms-admin {
    background: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

    .wa-forms-admin h2 {
        margin-top: 0;
    }

    .wa-forms-admin table {
        width: 100%;
        border-collapse: collapse;
        margin-top: 20px;
    }

    .wa-forms-admin th,
    .wa-forms-admin td {
        padding: 12px;
        text-align: left;
        border-bottom: 1px solid #ddd;
    }

    .wa-forms-admin th {
        background-color: #f8f9fa;
        font-weight: 600;
    }

.wa-forms-form-builder {
    max-width: 800px;
}

.wa-forms-builder-section {
    background: white;
    margin-bottom: 20px;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

    .wa-forms-builder-section h3 {
        margin-top: 0;
        color: #333;
    }

.wa-forms-builder-field {
    margin-bottom: 15px;
}

    .wa-forms-builder-field label {
        display: block;
        margin-bottom: 5px;
        font-weight: 500;
    }

    .wa-forms-builder-field input,
    .wa-forms-builder-field select,
    .wa-forms-builder-field textarea {
        width: 100%;
        padding: 8px 12px;
        border: 1px solid #ddd;
        border-radius: 3px;
        box-sizing: border-box;
    }

/* Responsive Design */
@media (max-width: 768px) {
    .wa-forms-popup {
        width: 95%;
        margin: 20px;
    }

    .wa-forms-actions {
        flex-direction: column;
    }

    .wa-forms-btn {
        width: 100%;
        justify-content: center;
    }
}
