/* Admin Styles */
.aff-admin-container {
    margin-top: 20px;
}

.aff-form-section {
    background: #fff;
    border: 1px solid #ccd0d4;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.aff-form-section h3 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.aff-fields-list {
    margin-top: 20px;
}

.aff-field-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border: 1px solid #ddd;
    margin-bottom: 5px;
    background: #f9f9f9;
    transition: background 0.2s;
}

.aff-field-row:hover {
    background: #f5f5f5;
}

.aff-field-row.aff-sub-field {
    margin-left: 30px;
    background: #fff;
    border-left: 3px solid #0073aa;
}

.aff-field-info {
    flex: 1;
}

.aff-field-info label {
    display: flex;
    align-items: center;
    gap: 10px;
}

.aff-field-info strong {
    font-size: 14px;
}

.field-type {
    color: #666;
    font-size: 12px;
}

.aff-field-settings {
    display: flex;
    gap: 15px;
    align-items: center;
}

.aff-field-settings label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
}

.field-width {
    width: 80px;
}

.field-step {
    width: 100px;
}

.aff-step-config {
    background: #f9f9f9;
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.aff-step-config h4 {
    margin: 0;
    min-width: 80px;
}

.aff-step-config input[type="text"] {
    flex: 1;
}

.aff-form-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.aff-form-actions button {
    margin-right: 10px;
}

/* Field ordering controls */
.field-order-controls {
    display: flex;
    gap: 5px;
    margin-left: 10px;
}

.field-move-up, .field-move-down {
    min-width: 30px;
    height: 30px;
    padding: 0;
    font-size: 14px;
    line-height: 1;
    border-radius: 3px;
}

.field-move-up:hover, .field-move-down:hover {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

.aff-field-row:first-child .field-move-up {
    opacity: 0.3;
    cursor: not-allowed;
}

.aff-field-row:last-child .field-move-down {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Frontend Styles */
.aff-form-container {
    max-width: 100%;
    margin: 20px 0;
}

.aff-frontend-form {
    background: #fff;
    padding: 60px!important;
    border-radius: 15px!important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1)!important;
     max-width: 1148px;

}

/* Multi-step navigation */
.aff-steps-navigation {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    position: relative;
}

.aff-steps-navigation::before {
    content: '';
     width: 75%;
    position: absolute;
    top: 25px;
    height: 4px;
    background: #f2f2f2;
    z-index: 1;
}

.aff-step-indicator {
    position: relative;
    z-index: 2;
    text-align: center;
    flex: 1;
    cursor: pointer;
}

.aff-step-indicator .step-number {
    display: inline-block;
    width: 50px;
  	padding-top: 7px;
    padding-bottom: 5px;

    line-height: 40px;
    border-radius: 15px;
    background: #f2f2f2;
    border: 0px solid #ddd;
    color: #999;
    font-weight: bold;
    transition: all 0.3s;
}

.aff-step-indicator.active .step-number {
    background: #666;
    border-color: #0073aa;
    color: #fff;
}

.aff-step-indicator.completed .step-number {
    background: #000000;
    border-color: #46b450;
    color: #fff;
}

.aff-step-indicator .step-title {
    display: block;
    margin-top: 10px;
    font-size: 15px;
    font-weight: 200;
    color: #000000;
}

.aff-step-indicator.active .step-title {
    color: #000000;
    font-weight: bold;
}

/* Form steps */
.aff-step {
    display: none;
}

.aff-step.active {
    display: block;
    animation: fadeIn 0.3s;
}

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

/* Form fields */
.aff-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.aff-field-wrapper {
    margin-bottom: 20px;
}

.aff-field-wrapper.aff-field-width-25 {
    flex: 0 0 calc(25% - 15px);
}

.aff-field-wrapper.aff-field-width-33 {
    flex: 0 0 calc(33.333% - 15px);
}

.aff-field-wrapper.aff-field-width-50 {
    flex: 0 0 calc(50% - 10px);
}

.aff-field-wrapper.aff-field-width-66 {
    flex: 0 0 calc(66.666% - 10px);
}

.aff-field-wrapper.aff-field-width-75 {
    flex: 0 0 calc(75% - 10px);
}

.aff-field-wrapper.aff-field-width-100 {
    flex: 0 0 100%;
}

.aff-field-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.aff-field-label .required {
    color: #d63638;
    margin-left: 3px;
}

.aff-field-instructions {
    font-size: 13px;
    color: #666;
    margin-top: -5px;
    margin-bottom: 8px;
}

.aff-field {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.aff-field:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.aff-field.error {
    border-color: #d63638;
}

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

select.aff-field {
    background: #fff url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2714%27%20height%3D%278%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27M1%201l6%206%206-6%27%20stroke%3D%27%23555%27%20stroke-width%3D%272%27%20fill%3D%27none%27%20fill-rule%3D%27evenodd%27/%3E%3C/svg%3E') no-repeat right 12px center;
    background-size: 12px;
    padding-right: 35px;
    appearance: none;
}

/* Checkbox and Radio groups */
.aff-checkbox-group,
.aff-radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.aff-checkbox-label,
.aff-radio-label {
    display: flex;
    align-items: center;
    font-size: 14px;
    cursor: pointer;
}

.aff-checkbox-label input,
.aff-radio-label input {
    margin-right: 8px;
}

/* File uploads */
.aff-file-preview,
.aff-gallery-preview {
    margin-top: 10px;
}

.aff-gallery-preview img {
    border: 2px solid #ddd;
    border-radius: 4px;
}

/* Repeater fields */
.aff-repeater {
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 4px;
    background: #f9f9f9;
}

.aff-repeater-row {
    background: #fff;
    border: 1px solid #e0e0e0;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 4px;
    position: relative;
}

.aff-repeater-field {
    margin-bottom: 15px;
}

.aff-repeater-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 13px;
}

.aff-repeater-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #d63638;
    color: #fff;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.aff-repeater-remove:hover {
    background: #b32d2e;
}

.aff-repeater-add {
    background: #000;
    color: #fff;
    border: none;
    padding: 15px 30px;
    border-radius: 100px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
}

.aff-repeater-add:hover {
    background: #000000c4;
}

/* Group fields */
.aff-group {
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 4px;
    background: #f9f9f9;
}

.aff-group-field {
    margin-bottom: 15px;
}

.aff-group-field:last-child {
    margin-bottom: 0;
}

/* Buttons */
.aff-step-buttons,
.aff-form-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.aff-btn-prev,
.aff-btn-next,
.aff-btn-submit {
    border: none;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 200;
    cursor: pointer;
    transition: all 0.2s;
      padding: 15px 30px;
}

.aff-btn-prev {
    background: #666;
    color: #fff;
      padding: 15px 30px;
}

.aff-btn-prev:hover {
    background: #555;
}

.aff-btn-next {
    background: #000;
    color: #fff;
}

.aff-btn-next:hover {
    background: #000000c4;
}

.aff-btn-submit {
    background: #46b450;
    color: #fff;
}

.aff-btn-submit:hover {
    background: #3a9b3f;
}

.aff-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Messages */
.aff-form-message {
    padding: 12px 15px;
    border-radius: 4px;
    margin-top: 20px;
}

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

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

.aff-field-error {
    color: #d63638;
    font-size: 13px;
    margin-top: 5px;
}

/* Loading */
.aff-form-loading {
    text-align: center;
    padding: 20px;
    font-size: 16px;
    color: #666;
}

.aff-form-loading::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #ddd;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

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

/* Responsive */
@media (max-width: 768px) {
    .aff-field-wrapper.aff-field-width-25,
    .aff-field-wrapper.aff-field-width-33,
    .aff-field-wrapper.aff-field-width-50,
    .aff-field-wrapper.aff-field-width-66,
    .aff-field-wrapper.aff-field-width-75 {
        flex: 0 0 100%;
    }
    
    .aff-steps-navigation {
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    .aff-step-indicator .step-title {
        display: none;
    }
    
    .aff-field-settings {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .aff-field-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .aff-field-info {
        margin-bottom: 10px;
    }
}

/* RTL Support for Hebrew */
.rtl .aff-field-row.aff-sub-field {
    margin-left: 0;
    margin-right: 30px;
    border-left: none;
    border-right: 3px solid #0073aa;
}

.rtl .aff-checkbox-label input,
.rtl .aff-radio-label input {
    margin-right: 0;
    margin-left: 8px;
}

.rtl .aff-repeater-remove {
    right: auto;
    left: 10px;
}




/* Searchable Select for Address Field */
.aff-searchable-select-wrapper {
    position: relative;
    width: 100%;
}

.aff-searchable-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
    background: #fff;
}

.aff-searchable-select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.aff-searchable-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.aff-searchable-option {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
    font-size: 14px;
}

.aff-searchable-option:hover {
    background-color: #f5f5f5;
}

.aff-searchable-option:last-child {
    border-bottom: none;
}

.aff-searchable-option.selected {
    background-color: #0073aa;
    color: #fff;
}

.aff-searchable-option.no-results {
    color: #666;
    font-style: italic;
    cursor: default;
}

.aff-searchable-option.no-results:hover {
    background-color: transparent;
}