/* Master Data Management Styles */

.masterdata_container {
    padding: 20px 0;
}

.is-hidden {
    display: none !important;
}

#masterdataAlertHost {
    position: fixed;
    top: 90px;
    left: 50%;
    transform: translateX(-50%);
    width: min(720px, 92vw);
    z-index: 2000;
    pointer-events: none;
}

#masterdataAlertHost .masterdata_alert {
    pointer-events: auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    padding: 14px 18px;
    font-size: 14px;
    margin-bottom: 12px;
    border-left: 5px solid rgba(86, 90, 221, 0.8);
    background: #ffffff;
    animation: alert-pop 220ms ease-out;
}

#masterdataAlertHost .alert-success {
    border-left-color: #2fb344;
    box-shadow: 0 10px 26px rgba(47, 179, 68, 0.18);
}

#masterdataAlertHost .alert-danger {
    border-left-color: #e03131;
    box-shadow: 0 10px 26px rgba(224, 49, 49, 0.18);
}

#masterdataAlertHost .alert-warning {
    border-left-color: #f59f00;
    box-shadow: 0 10px 26px rgba(245, 159, 0, 0.18);
}

#masterdataAlertHost .alert-info {
    border-left-color: #228be6;
    box-shadow: 0 10px 26px rgba(34, 139, 230, 0.18);
}

@keyframes alert-pop {
    0% {
        transform: translateY(-4px);
        opacity: 0.6;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.file_selector_section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
}

.file_selector_section .form_input {
    margin-bottom: 0;
    flex: 1;
    max-width: 400px;
}

.file_selector_actions {
    display: none;
    gap: 12px;
    align-items: center;
}

.file_selector_actions.visible {
    display: flex;
}

.loading_section {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 8px;
}

.loader_spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #565add;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.editor_section {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.editor_tabs {
    display: flex;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.tab_btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab_btn:hover {
    background: #e9ecef;
    color: #495057;
}

.tab_btn.active {
    background: white;
    color: #565add;
    border-bottom: 3px solid #565add;
}

.tab_content {
    display: none;
    padding: 20px;
}

.tab_content.active {
    display: block;
}

.steps_list_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.steps_list_header h3 {
    margin: 0;
    font-size: 18px;
    color: #212529;
}

.btn_sm {
    padding: 6px 12px;
    font-size: 12px;
}

.steps_list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 15px;
}

.step_card {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #f8f9fa;
    transition: box-shadow 0.3s;
}

.step_card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.step_card_header {
    padding: 15px;
    background: white;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.step_info h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #212529;
    line-height: 1.4;
}

.step_id_badge {
    display: inline-block;
    padding: 4px 8px;
    background: #e7e7ff;
    color: #565add;
    font-size: 11px;
    border-radius: 4px;
    font-family: 'poppins_medium';
}

.step_actions {
    display: flex;
    gap: 5px;
}

.btn_icon {
    padding: 8px 12px;
    border: none;
    background: #565add;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn_icon:hover {
    background: #4548b8;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(86, 90, 221, 0.3);
}

.step_card_body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.step_detail {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

.detail_label {
    color: #6c757d;
    font-family: 'poppins_medium';
}

.detail_value {
    color: #212529;
}

.providers_filter {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.providers_list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.provider_card {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #f8f9fa;
    overflow: hidden;
}

.provider_header {
    padding: 15px;
    background: white;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.provider_header h4 {
    margin: 0;
    font-size: 14px;
    color: #212529;
}

.provider_options {
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.provider_option_item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    transition: box-shadow 0.3s;
}

.provider_option_item:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.option_thumbnail {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
}

.option_name {
    flex: 1;
    font-size: 13px;
    color: #212529;
}

.option_actions {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.option_actions .btn_icon {
    padding: 4px 8px;
    font-size: 12px;
}

.option_actions .delete_option_btn {
    background: #dc3545;
}

.option_actions .delete_option_btn:hover {
    background: #c82333;
}

.empty_state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-size: 14px;
}

.empty_state_sm {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    font-size: 12px;
    margin: 0;
}

.step_editor_form,
.provider_editor_form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.step_options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.checkbox_label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    margin: 0;
}

.checkbox_label input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

.fields_section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.fields_section h6 {
    margin-bottom: 15px;
    font-size: 14px;
    color: #212529;
}

.field_editor_card {
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 10px;
}

.field_display_card {
    padding: 12px 15px;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.field_display_card:hover {
    border-color: #565add;
    box-shadow: 0 2px 4px rgba(86, 90, 221, 0.1);
}

.field_display_row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.field_display_label {
    font-weight: 500;
    color: #212529;
    font-size: 14px;
}

.field_display_meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: #6c757d;
}

.meta_item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.meta_item i {
    color: #565add;
}

.empty_state_sm {
    text-align: center;
    color: #6c757d;
    font-size: 13px;
    padding: 20px;
    font-style: italic;
}

.field_editor_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.field_type_badge {
    padding: 3px 8px;
    background: #e7e7ff;
    color: #565add;
    font-size: 11px;
    border-radius: 4px;
    font-family: 'poppins_medium';
}

.field_editor_details {
    font-size: 12px;
    color: #6c757d;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.image_upload_area {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.image_upload_area input[type="file"] {
    font-size: 12px;
}

.image_preview {
    width: 100%;
    height: 150px;
    border: 2px dashed #e9ecef;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    position: relative;
}

.image_preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.upload_placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #6c757d;
    font-size: 13px;
}

.upload_placeholder i {
    font-size: 32px;
    color: #adb5bd;
}

.version_item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 10px;
}

.version_info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.version_info strong {
    color: #212529;
    font-size: 14px;
}

.version_date,
.version_user {
    font-size: 12px;
    color: #6c757d;
}

.version_desc {
    font-size: 12px;
    color: #868e96;
    margin: 4px 0 0 0;
    font-style: italic;
}

.version_actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.modal-dialog.modal-xl {
    max-width: 1200px;
}

.modal-dialog.modal-lg {
    max-width: 800px;
}

.modal-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 15px 20px;
}

.modal-title {
    font-size: 18px;
    color: #212529;
    font-family: 'poppins_semibold';
}

.modal-footer {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 15px 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1050;
    padding: 20px;
    backdrop-filter: blur(2px);
}

.modal.show {
    display: flex;
}

.modal-dialog {
    width: 100%;
    max-height: 100%;
    overflow: auto;
}

.modal-content {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: none;
}

.modal-body {
    max-height: 70vh;
    overflow-y: auto;
    background: #ffffff;
    padding: 20px;
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
}

body.modal-open {
    overflow: hidden;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 10px;
}

@media (max-width: 768px) {
    .steps_list {
        grid-template-columns: 1fr;
    }

    .provider_options {
        grid-template-columns: 1fr;
    }

    .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .editor_tabs {
        flex-direction: column;
    }

    .tab_btn {
        border-bottom: 1px solid #e9ecef;
    }

    .tab_btn.active {
        border-bottom: 3px solid #565add;
    }
}

/* Field Editor Styles */
.field_edit_card {
    padding: 15px;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.field_edit_card:hover {
    border-color: #565add;
    box-shadow: 0 2px 8px rgba(86, 90, 221, 0.15);
}

.field_edit_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.field_edit_info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.field_edit_label {
    font-weight: 500;
    color: #212529;
    font-size: 14px;
}

.field_required_badge {
    padding: 2px 6px;
    background: #ff6b6b;
    color: white;
    font-size: 10px;
    border-radius: 3px;
    font-family: 'poppins_medium';
}

.field_edit_actions {
    display: flex;
    gap: 6px;
}

.field_edit_meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: #6c757d;
}

.btn_danger {
    background: #dc3545 !important;
}

.btn_danger:hover {
    background: #c82333 !important;
}

.add_field_btn {
    margin-top: 10px;
}

.btn_block {
    width: 100%;
}

/* Option Editor Styles */
.option_edit_item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    margin-bottom: 8px;
}

.option_edit_item:hover {
    background: #e9ecef;
}

.option_thumbnail_sm {
    width: 30px;
    height: 30px;
    object-fit: contain;
    border-radius: 4px;
}

.option_name {
    flex: 1;
    font-size: 13px;
    color: #212529;
}

.option_actions {
    display: flex;
    gap: 4px;
}

.btn_icon_sm {
    padding: 4px 8px;
    border: none;
    background: #565add;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
}

.btn_icon_sm:hover {
    background: #4548b8;
    transform: translateY(-1px);
}

.btn_icon_sm.btn_danger {
    background: #dc3545;
}

.btn_icon_sm.btn_danger:hover {
    background: #c82333;
}

.field_options_list {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 10px;
}

.options_section_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.options_section_header h6 {
    margin: 0;
    font-size: 14px;
    color: #212529;
    font-family: 'poppins_semibold';
}

.my-3 {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

/* Steps List Header */
.steps_list_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px;
    background: white;
}

.steps_list_header h3 {
    margin: 0;
    font-size: 18px;
    color: #212529;
    font-family: 'poppins_semibold';
}

.btn_sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* Field Editor Form Improvements */
.field_properties_section {
    padding: 0;
}

.section_title {
    font-size: 13px;
    color: #565add;
    font-family: 'poppins_semibold';
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.field_flags {
    display: flex;
    gap: 30px;
    margin-top: 5px;
}

.field_editor_form {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 5px;
}

.field_editor_form .form_input {
    margin-bottom: 20px;
}

.field_editor_form .form-text {
    font-size: 11px;
    color: #6c757d;
    margin-top: 5px;
    display: block;
}

.field_editor_form .form-control {
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.field_editor_form .form-control:focus {
    border-color: #565add;
    box-shadow: 0 0 0 0.2rem rgba(86, 90, 221, 0.15);
}

.field_editor_form label {
    font-family: 'poppins_medium';
    font-size: 13px;
    color: #2c3e50;
    margin-bottom: 8px;
    display: block;
}

.options_divider {
    height: 1px;
    background: linear-gradient(to right, #e9ecef, #565add, #e9ecef);
    margin: 25px 0 20px 0;
}

.empty_state {
    text-align: center;
    color: #999;
    font-size: 13px;
    padding: 20px;
    font-style: italic;
}

/* Publish Button Highlight for Unsaved Changes */
#publishBtn.has-pending {
    animation: pulse-glow 2s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(86, 90, 221, 0.4);
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(86, 90, 221, 0.4);
    }

    50% {
        box-shadow: 0 0 20px rgba(86, 90, 221, 0.7);
    }
}

.publish_badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #ff6b6b;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 6px 14px rgba(255, 107, 107, 0.3);
}

#publishBtn.has-pending .publish_badge {
    animation: badge-pulse 1.4s ease-in-out infinite;
}

@keyframes badge-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }
}