.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
}

.popup-overlay.visible {
    display: flex;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0s 0s;
}

.popup-content {
    position: relative;
    background: white;
    padding: 20px;
    border-radius: 24px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    width: fit-content;
    max-height: 80%;
    max-width: 70%;
    overflow-y: auto;
    overflow-x: auto;
    min-height: 50%;
    min-width: 50%;
    overflow: auto;
    flex-direction: column;
    align-items: start;
    gap: 10px;
    transform: translateY(-10px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.popup-overlay.visible .popup-content {
    opacity: 1;
    transform: translateY(0);
}

.popup-content .close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 10px;
    height: 10px;
    padding: 15px;
    border-radius: 50%;
    background-color: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

.popup-content .close-btn .fas {
    font-size: 1rem;
    color: #696969;
    cursor: pointer;
    transition: color 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.popup-content .close-btn:hover .fas {
    color: #acabab;
    transform: rotate(90deg);
}

.popup-overlay.visible {
    display: flex;
}

.info-icon {
    margin-left: 8px;
    color: #696969;
    cursor: pointer;
    transition: all 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.info-icon i {
    font-size: 1rem;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.info-icon:hover {
    color: #acacac
        /* Hover color */
}

.apply-btn-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Styling for popup with labels */

#label-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    padding: 10px;
}

.label-section {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.popup-content .label-item.non-default {
    background: linear-gradient(to bottom, #f5f5f5, #eeeeee);
    border-radius: 24px;
}

.popup-content .label-item {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 10px;
    border: transparent;
    background: linear-gradient(to bottom, #EBEBEB, #b8b8b8);
    padding: 15px;
    border-radius: 24px;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.popup-content .label-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.popup-content .label-item .custom-input {
    width: 100%;
    padding: 8px;
    border: transparent;
    font-size: 0.8rem;
    box-sizing: border-box;
    outline: none;
    font-family: 'Inter', sans-serif;
    text-decoration: none;
    color: #696969;
    border-radius: 2px;
    border: 0.2px solid #dddddd;
}

.popup-content .label-item .custom-input:focus {
    box-shadow: inset 0 0 5px rgba(173, 173, 173, 0.5);
}

.popup-content .label-item .addRemove {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: end;
    min-width: 60px;
    height: 68px;
}

.popup-content .label-item.removing {
    opacity: 0;
    transform: translateY(-10px);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.remove-label {
    background-color: transparent;
    border: 0.2px solid transparent;
    border-radius: 50%;
    color: #797878;
    font-weight: 400;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.remove-label i {
    font-size: 1rem;
    transition: all 0.3s ease;
    color: #797878;
    font-weight: 100;
}

.table .remove-label i {
    font-size: 0.9rem;
}

.remove-label:hover i {
    color: #d9534f;
}


.dropdown-section {
    margin-bottom: 20px;
}

.quality-fields {
    margin-top: 20px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.quality-fields label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.fields-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 40px;
    gap: 12px;
    margin-bottom: 8px;
    padding: 0 4px;
}

.fields-header label {
    font-weight: 600;
    font-size: 0.875rem;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quality-fields input,
.quality-fields textarea {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.apply-btn-container {
    text-align: right;
    margin-top: 20px;
}


/* Style the dropdown container */
.dropdown-section {
    margin-bottom: 20px;
}

/* Style the label for the dropdown */
.dropdown-section label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

/* Style the select dropdown */
.custom-select {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    color: #333;
    background-color: #f9f9f9;
    border: 1px solid #ccc;
    border-radius: 5px;
    appearance: none; /* Remove default browser styling */
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Add hover and focus effects */
.custom-select:hover {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

.custom-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

/* Add a custom arrow for the dropdown */
.custom-select::after {
    content: "▼";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* Optional: Add a custom arrow container */
.dropdown-section {
    position: relative;
}

.dropdown-section .custom-select {
    padding-right: 30px; /* Add space for the custom arrow */
}

.choices__inner {
    border-radius: 8px;
    padding: 8px;
    border-color: #ccc;
}


/* Row Container */
.docintel-row,
.aiScan-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 40px;
    gap: 12px;
    margin-bottom: 12px;
    align-items: start;
}

/* Hide inline labels */
.docintel-row label,
.aiScan-row label {
    display: none;
}

.docintel-row input,
.aiScan-row input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    min-width: 0;
}

.docintel-row input:focus,
.aiScan-row input:focus {
    outline: none;
    border-color: #01043b;
    box-shadow: 0 0 0 3px rgba(1, 4, 59, 0.1);
}

.removeDocIntelRow {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    align-self: center;
}

/* Metadata container styling */
#fieldMetadata {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    color: #333;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Metadata list styling */
.metadata-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

/* Metadata list items */
.metadata-list li {
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Metadata labels */
.metadata-list li strong {
    font-weight: bold;
    color: #555;
}

/* Metadata values */
.metadata-value {
    font-weight: normal;
    color: #007bff; /* Blue color for emphasis */
}

/* Conditional styling for Yes/No values */
.metadata-value:contains("Yes") {
    color: #28a745; /* Green for Yes */
    font-weight: bold;
}

.metadata-value:contains("No") {
    color: #dc3545; /* Red for No */
    font-weight: bold;
}

/* Ensure consistent width for input fields */
.custom-input {
    width: 100%; /* Matches the width of other elements */
    padding: 10px; /* Add padding for better usability */
    border: 1px solid #ccc; /* Add a border for consistency */
    border-radius: 5px; /* Match the border radius of other elements */
    font-size: 14px; /* Ensure consistent font size */
    box-sizing: border-box; /* Prevent padding from affecting width */
}

/* Add focus styling for better user experience */
.custom-input:focus {
    border-color: #007bff; /* Highlight border on focus */
    outline: none; /* Remove default outline */
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5); /* Add a subtle shadow */
}


/* Models Container */
.models-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 15px;
  }
  
  /* Model Card */
  .model-card {
    background-color: #ffffff;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 20px;
    width: 300px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }
  
  .model-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
  }
  
  .model-card h5 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #007bff;
  }
  
  .model-card p {
    font-size: 14px;
    margin: 5px 0;
    color: #555;
    word-wrap: break-word; /* Break long words to wrap within the container */
    overflow-wrap: break-word; /* Ensure long words wrap */
    white-space: pre-wrap; /* Preserve whitespace and wrap text */
    overflow: hidden; /* Hide overflowing text */
    text-overflow: ellipsis; /* Add ellipsis for truncated text */
    max-width: 100%; /* Ensure it doesn't exceed the container width */
  }
  
  /* Metadata Section */
  .metadata-section {
    margin-top: 15px;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 10px;
  }
  
  .metadata-section h6 {
    font-size: 16px;
    margin-bottom: 8px;
    color: #333;
  }
  
  .metadata-section ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
  }
  
  .metadata-section ul li {
    font-size: 14px;
    color: #555;
    margin-bottom: 5px;
    word-wrap: break-word; /* Break long words to wrap within the container */
    overflow-wrap: break-word; /* Ensure long words wrap */
    white-space: pre-wrap; /* Preserve whitespace and wrap text */
    overflow: hidden; /* Hide overflowing text */
    text-overflow: ellipsis; /* Add ellipsis for truncated text */
    max-width: 100%; /* Ensure it doesn't exceed the container width */
  }
  
  .metadata-section ul li strong {
    color: #333;
  }

/* Multi-Select Dropdown Styling */
.custom-select {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    color: #333;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    appearance: none; /* Remove default browser styling */
    outline: none;
    height: auto;
}

.custom-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

.custom-select option {
    padding: 5px;
    font-size: 14px;
}

.button-wrapper {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    /* Optional: center vertically too */
    /* align-items: center;
       height: 100px; or any suitable height */
  }

  .delete-model-btn {
    background-color: #d9534f;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 5px;
    width: 100%
}

.delete-model-btn:hover {
    background-color: #be2822;
    
}

.deploy-model-btn {
    background-color: #28a745; /* Green for deploy */
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 5px;
    width: 100%;
}

.deploy-model-btn:hover {
    background-color: #218838;
}

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
    font-size: 16px;
    color: #555;
}

.model-card.deployed {
    border: 2px solid #4CAF50; /* Green border */
    background-color: #e8f5e9; /* Light green background */
    box-shadow: 0 0 10px rgba(0, 128, 0, 0.5); /* Green glow */
}

.model-card.archived {
    border: 2px solid #f44336; /* Red border */
    background-color: #ffebee; /* Light red background */
    box-shadow: 0 0 10px rgba(244, 67, 54, 0.5); /* Red glow */
}


.model-card.action {
    border: 2px solid #ff9800; /* Orange border */
    background-color: #fff3e0; /* Light orange background */
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.5); /* Orange glow */
}

.text-input-section {
    margin-bottom: 18px;
    width: 100%;
}

.custom-text-input {
    width: 100%;
    min-height: 48px;
    max-height: 200px;
    resize: vertical;
    font-size: 0.95rem;
    border-radius: 6px;
    border: 1px solid #ccc;
    padding: 8px 10px;
    box-sizing: border-box;
    margin-bottom: 0;
    background: #fafbfc;
    transition: border-color 0.3s, box-shadow 0.3s;
    line-height: 1.4;
}

.custom-text-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 3px rgba(0, 123, 255, 0.10);
    outline: none;
}

.submit-btn-container {
    margin-top: 12px;
    width: 100%;
    display: flex;
    justify-content: center;
}


/* Delete Button */
.delete-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    background: white;
    color: #999;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    margin-top: 0;
    flex-shrink: 0;
}

.delete-btn:hover {
    background: #fee;
    border-color: #fcc;
    color: #c33;
}