.transformations_loader_overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 52, 102, 0.65);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.transformations_loader_overlay.is-visible {
    display: flex;
}

.transformations_loader_content {
    text-align: center;
    color: #ffffff;
    font-size: 16px;
}

.transformations_loader_spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: #7ab8ff;
    border-radius: 50%;
    margin: 0 auto 12px;
    animation: transformations_loader_spin 1s linear infinite;
}

.transformations_loader_text {
    font-weight: 600;
    letter-spacing: .5px;
}

.btn-loading {
    opacity: .8;
    position: relative;
}

.btn-loading::after {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.6);
    border-top-color: transparent;
    border-radius: 50%;
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
    animation: transformations_loader_spin .8s linear infinite;
}

@keyframes transformations_loader_spin {
    to {
        transform: rotate(360deg);
    }
}
/**
 * Test Page Version Dropdown Styles
 * Custom dropdown for selecting transformation versions on the test page
 */

.test_version_dropdown {
    position: relative;
    display: inline-block;
    width: 100%;
}

.test_version_dropdown_trigger {
    width: 100%;
    padding: 12px 40px 12px 15px;
    font-size: 14px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
    font-family: inherit;
    min-height: 44px;
}

.test_version_dropdown_trigger:hover {
    border-color: #2196F3;
}

.test_version_dropdown.test_version_dropdown_open .test_version_dropdown_trigger {
    border-color: #2196F3;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.test_version_dropdown_arrow {
    color: #666;
    font-size: 12px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 10px;
}

.test_version_dropdown.test_version_dropdown_open .test_version_dropdown_arrow {
    transform: rotate(180deg);
}

.test_version_dropdown_options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #2196F3;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.test_version_dropdown.test_version_dropdown_open .test_version_dropdown_options {
    display: block;
}

.test_version_dropdown_option {
    padding: 12px 15px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.test_version_dropdown_option:last-child {
    border-bottom: none;
}

.test_version_dropdown_option:hover {
    background: #f5f5f5;
}

.test_version_dropdown_option.test_version_dropdown_option_selected {
    background: #e3f2fd !important;
    font-weight: 500;
    color: #1976d2;
}

.test_version_dropdown_selected_text {
    flex: 1;
    text-align: left;
}

/* Custom scrollbar for options */
.test_version_dropdown_options::-webkit-scrollbar {
    width: 8px;
}

.test_version_dropdown_options::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.test_version_dropdown_options::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.test_version_dropdown_options::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Disabled state */
.test_version_dropdown.test_version_dropdown_disabled .test_version_dropdown_trigger {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .test_version_dropdown {
        width: 100%;
    }
    
    .test_version_dropdown_options {
        max-height: 250px;
    }
}


/**
 * File Search Styles
 * Search input for filtering files from connected apps
 */

 .file-search-container {
    position: relative;
    width: 100%;
}

.file-search-input {
    width: 100%;
    padding: 8px 12px 8px 35px;
    font-size: 14px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: white;
    transition: all 0.3s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.file-search-input:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.file-search-input::placeholder {
    color: #999;
}



/**
 * Edit Page - Reference Content Management Styles
 * Styles for adding/removing reference labels in edit.html
 * Naming convention: edit_classname_functionality
 */

.edit_reference_item {
    background: #f9f9f9;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex !important;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.edit_reference_item:hover {
    border-color: #bbb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.edit_reference_label {
    flex: 0 0 120px;
}

.edit_reference_label strong {
    color: #666;
    font-size: 14px;
}

.edit_reference_input_wrapper {
    flex: 1;
    min-height: 40px;
}

.edit_reference_input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
    box-sizing: border-box;
    height: 40px;
    display: block;
}

.edit_reference_input:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.edit_reference_input::placeholder {
    color: #999;
}

.edit_reference_input_error {
    border-color: #d32f2f !important;
    background-color: #ffebee !important;
}

.edit_reference_remove_btn_wrapper {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit_reference_remove_btn {
    background: #d32f2f;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.edit_reference_remove_btn:hover {
    background: #b71c1c;
    transform: scale(1.1);
}

.edit_reference_remove_btn:active {
    transform: scale(0.95);
}

.edit_reference_remove_btn i {
    font-size: 14px;
    line-height: 1;
}

#add_reference_btn {
    font-size: 14px;
}

/**
 * View Page Styles
 */

.view_actions_buttons {
    display: flex;
    gap: 10px;
}

/**
 * Test Page - Reference Content Section Styles
 * Styles for the reference content section in test.html
 */

.test_description_reference_content {
    margin: 5px 0 10px 0;
    font-size: 14px;
}

/**
 * Test Page - Meta Parameters Styles
 * Styles for LLM model parameters during testing
 * Naming convention: test_meta_parameter_classname
 */

.test_meta_parameter_field {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    gap: 20px;
    transition: all 0.3s ease;
    align-items: flex-start;
}

.test_meta_parameter_field:hover {
    border-color: #bbb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.test_meta_parameter_field_label {
    flex: 1;
}

.test_meta_parameter_field_label label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-size: 14px;
}

.test_meta_parameter_field_label strong {
    color: #2196F3;
    font-size: 14px;
}

.test_meta_parameter_suffix {
    font-size: 12px;
    color: #999;
    font-weight: normal;
    margin-left: 5px;
}

.test_meta_parameter_description {
    margin: 5px 0;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.test_meta_parameter_hint {
    margin: 3px 0 0 0;
    font-size: 12px;
    color: #999;
    font-style: italic;
}

.test_meta_parameter_field_input {
    flex: 0 0 180px;
    display: flex;
    align-items: flex-start;
    padding-top: 2px;
}

.test_meta_parameter_input {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
    box-sizing: border-box;
    height: 40px;
}

.test_meta_parameter_input:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.test_meta_parameter_input::placeholder {
    color: #999;
}

.test_meta_parameter_checkbox_wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 8px;
}

.test_meta_parameter_checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.test_meta_parameter_checkbox_label {
    font-size: 14px;
    color: #333;
    cursor: pointer;
    user-select: none;
}

/* Mobile responsive for Meta parameters */
@media (max-width: 768px) {
    .test_meta_parameter_field {
        flex-direction: column;
        gap: 10px;
    }
    
    .test_meta_parameter_field_input {
        flex: 0 0 auto;
        width: 100%;
    }
}

/**
 * Test Page Styles
 * Styles for transformation testing page (test.html)
 */

/* Prevent horizontal scroll */
body {
    overflow-x: hidden;
}

/* Page reload overlay animation */
#page_reload_overlay {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Split Pane Styles */
#split_container {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    width: 100%;
    overflow-x: hidden;
}

/* Ensure content wraps and doesn't overflow */
#left_panel *,
#right_panel * {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
}

#left_panel pre,
#right_panel pre {
    overflow-x: auto;
    max-width: 100%;
}

/* Ensure form elements don't overflow */
#left_panel textarea,
#left_panel input[type="text"],
#left_panel select {
    max-width: 100%;
    box-sizing: border-box;
}

/* Fix textarea height and resize */
#left_panel textarea {
    min-height: 200px !important;
    resize: vertical !important;
    display: block !important;
}

#reference_text {
    min-height: 200px !important;
    resize: vertical !important;
    display: block !important;
}

/* Ensure textarea resize handle is visible */
textarea {
    overflow: auto !important;
}

/* Fix for all textareas in form fields */
.form ._field textarea {
    display: block !important;
}

/* Specific fix for resizable textareas - highest specificity */
.form ._field ._value textarea.resizable-textarea,
textarea.resizable-textarea,
#reference_text {
    display: block !important;
    resize: vertical !important;
    overflow: auto !important;
    -webkit-appearance: textfield !important;
    appearance: textfield !important;
}

/* Override global flex display on all textareas */
div._value textarea {
    display: block !important;
}

/* Scrollbar styles for panels */
#left_panel::-webkit-scrollbar,
#right_panel::-webkit-scrollbar {
    width: 8px;
}

#left_panel::-webkit-scrollbar-track,
#right_panel::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#left_panel::-webkit-scrollbar-thumb,
#right_panel::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

#left_panel::-webkit-scrollbar-thumb:hover,
#right_panel::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Version selector */
#version_selector:hover {
    border-color: #999 !important;
}

#version_selector:focus {
    outline: none;
    border-color: #2196F3 !important;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

/* Input mode cards */
.input-mode-card {
    transition: all 0.3s ease;
}

.input-mode-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.input-mode-card.active {
    border-width: 2px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Parameter mode cards */
.param-mode-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

/* Parameter items */
.parameter_item {
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 10px;
    background: #f9f9f9;
}

.parameter_item:hover {
    border-color: #bbb !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* App items */
.app_item:hover {
    background: #f5f5f5;
}

.app_item.active {
    background: #e3f2fd;
}

.app_item img {
    width: 24px !important;
    height: 24px !important;
}

.app_item i.fa-fw {
    font-size: 24px;
}

/* File items */
.file_item {
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

.file_item:hover {
    background: #f9f9f9;
}

.file_item.selected {
    background: #e8f5e9;
    border-color: #4CAF50;
}

.file_item input[type="radio"] {
    width: 18px;
    height: 18px;
}

/* Selected file chips */
.selected_file_chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #e3f2fd;
    padding: 8px 12px;
    border-radius: 16px;
    margin: 4px;
    font-size: 13px;
}

.selected_file_chip .remove_btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    margin: 0;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    #split_container {
        flex-direction: column !important;
        min-height: calc(100vh - 150px);
        max-width: 100vw !important;
    }
    
    #left_panel {
        flex: 0 0 auto !important;
        width: 100% !important;
        max-width: 100% !important;
        border-right: none !important;
        border-bottom: 1px solid #ddd;
        max-height: none;
    }
    
    #divider {
        display: none !important;
    }
    
    #right_panel {
        flex: 0 0 auto !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: 400px;
    }
    
    .input-mode-card {
        padding: 15px !important;
    }
    
    .input-mode-card h4 {
        font-size: 14px !important;
    }
    
    .input-mode-card p {
        font-size: 12px !important;
    }
    
    #version_selector {
        max-width: 100% !important;
    }
}

@media (max-width: 480px) {
    .input-mode-container {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    #mode_card_text,
    #mode_card_files {
        margin-bottom: 0 !important;
    }
}
