/**
 * Divine Form Integration Styles
 */

/* Settings Page */
.divine-integration-settings {
    max-width: 1200px;
}

.divine-integration-settings .description {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

/* Existing Integrations Table */
.divine-existing-integrations {
    margin-bottom: 40px;
}

.divine-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.divine-status-active {
    background: #d4edda;
    color: #155724;
}

.divine-status-inactive {
    background: #f8d7da;
    color: #721c24;
}

/* New Integration Section */
.divine-new-integration {
    margin-top: 30px;
}

#divine-add-integration-btn .dashicons {
    margin-top: 3px;
}

/* Modal Styles */
.divine-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.divine-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
}

.divine-modal-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: divineModalSlideIn 0.3s ease;
}

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

.divine-modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.divine-modal-header h2 {
    margin: 0;
    font-size: 20px;
}

.divine-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #666;
    transition: color 0.2s;
}

.divine-modal-close:hover {
    color: #000;
}

.divine-modal-close .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.divine-modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.divine-modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.divine-modal-footer-right {
    display: flex;
    gap: 10px;
}

/* Form Sections */
.divine-form-section {
    margin-bottom: 40px;
}

.divine-form-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #23282d;
    font-size: 18px;
}

.divine-form-section .form-table {
    margin-top: 0;
}

.divine-form-section .required {
    color: #d63638;
}

/* Field Mapping */
.divine-mapping-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.divine-mapping-loading .spinner {
    float: none;
    margin: 0 auto 10px;
}

.divine-mapping-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.divine-mapping-table thead {
    background: #f5f5f5;
}

.divine-mapping-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
}

.divine-mapping-table td {
    padding: 12px;
    border-bottom: 1px solid #e5e5e5;
}

.divine-mapping-table tr:last-child td {
    border-bottom: none;
}

.divine-mapping-table select {
    width: 100%;
    max-width: 300px;
}

.divine-placeholder-label {
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 13px;
}

.divine-mapping-empty {
    text-align: center;
    padding: 40px;
    color: #999;
}

.divine-unmapped-fields {
    margin-top: 30px;
    padding: 15px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
}

.divine-unmapped-fields h4 {
    margin-top: 0;
    color: #856404;
}

.divine-unmapped-fields ul {
    margin: 10px 0 0;
    padding-left: 20px;
}

.divine-unmapped-fields li {
    margin: 5px 0;
}

/* Test Preview */
#divine-test-preview-content {
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    max-height: 500px;
    overflow-y: auto;
    font-family: Arial, sans-serif;
    line-height: 1.6;
}

#divine-test-preview-content h1,
#divine-test-preview-content h2,
#divine-test-preview-content h3 {
    margin-top: 0;
}

/* Buttons */
.button .dashicons {
    margin-right: 5px;
}

/* Loading States */
.button.loading {
    position: relative;
    color: transparent !important;
}

.button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

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

/* Success Messages */
.divine-success-message {
    display: inline-block;
    padding: 8px 15px;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    margin-left: 10px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 782px) {
    .divine-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .divine-modal-header,
    .divine-modal-body,
    .divine-modal-footer {
        padding: 15px;
    }
    
    .divine-modal-footer {
        flex-direction: column;
        gap: 10px;
    }
    
    .divine-modal-footer-right {
        width: 100%;
        flex-direction: column;
    }
    
    .divine-modal-footer button {
        width: 100%;
    }
    
    .divine-mapping-table {
        font-size: 13px;
    }
    
    .divine-mapping-table th,
    .divine-mapping-table td {
        padding: 8px;
    }
}
