/* Styling for Qualtrics Import UI */
html,
body {
    overflow-x: hidden !important;
}

#mainwindowsub {
    max-width: 100% !important;
}

#center {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

@media (min-width: 768px) {
    #center {
        max-width: calc(100% - 305px) !important;
    }
}

.qualtrics-import-container {
    margin-top: 15px;
    margin-bottom: 30px;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 20px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#previewContent {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.qualtrics-card {
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    margin-bottom: 20px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    min-width: 0;
}

.qualtrics-card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.qualtrics-card-body {
    padding: 20px;
}

.badge-status {
    font-size: 0.85rem;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    white-space: nowrap;
}

.badge-clean {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.badge-case-4 {
    background-color: #cce5ff;
    color: #004085;
    border: 1px solid #b8daff;
}

.badge-case-2 {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.badge-case-3 {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.badge-invalid {
    background-color: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

.badge-imported {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.badge-imported-case-4 {
    background-color: #e2d9f3;
    color: #381a74;
    border: 1px solid #d1c2ea;
}

.badge-manual-exclusion {
    background-color: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

#statusDropdownBtn {
    background-color: #ffffff !important;
    border: 1px solid #ced4da !important;
    color: #495057 !important;
    font-size: 0.875rem;
    padding: 5px 12px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.15s ease-in-out;
}

#statusDropdownBtn:hover,
#statusDropdownBtn:focus,
#statusDropdownBtn[aria-expanded="true"] {
    background-color: #f8f9fa !important;
    border-color: #adb5bd !important;
    color: #212529 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.status-filter-dropdown .dropdown-menu {
    min-width: 245px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
    z-index: 1050;
}

.status-option-item {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    margin-bottom: 2px;
    border-radius: 5px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.12s ease;
}

.status-option-item:hover {
    background-color: #f1f3f5;
}

.status-option-item input[type="checkbox"],
.status-option-item .status-checkbox {
    cursor: pointer;
    margin: 0 10px 0 0 !important;
    width: 15px;
    height: 15px;
    display: inline-block !important;
    position: static !important;
    vertical-align: middle;
}

.status-option-item .status-name {
    font-size: 0.86rem;
    font-weight: 500;
    color: #333333;
}

.btn-xs {
    font-size: 0.72rem;
    padding: 1px 6px;
    line-height: 1.3;
    border-radius: 3px;
}

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.filter-pill {
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    background-color: #e9ecef;
    color: #495057;
    border: 1px solid #ced4da;
    transition: all 0.2s;
}

.filter-pill:hover,
.filter-pill.active {
    background-color: #007bff;
    color: #ffffff;
    border-color: #007bff;
}

.filter-pill .badge {
    margin-left: 5px;
    background-color: #ffffff;
    color: #333333;
}

.filter-pill.active .badge {
    background-color: rgba(255, 255, 255, 0.9);
    color: #007bff;
}

.similarity-score {
    font-size: 0.8rem;
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.table-responsive {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

.table-preview-container {
    max-height: 600px;
    overflow-y: auto !important;
}

.table-preview {
    font-size: 0.85rem;
    width: 100%;
    min-width: 960px;
    margin-bottom: 0;
}

.table-preview thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: #f1f3f5;
    box-shadow: inset 0 -1px 0 #dee2e6;
}

.table-preview th {
    background-color: #f1f3f5;
    font-weight: 600;
    vertical-align: middle;
}

.table-preview td {
    padding: 6px 8px;
    vertical-align: middle;
}

.table-preview td:nth-last-child(2) {
    word-break: break-word;
    min-width: 140px;
}

.table-preview td:last-child {
    min-width: 44px;
    width: 44px;
    text-align: center;
    white-space: nowrap;
}

th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    white-space: nowrap;
    transition: background-color 0.15s ease-in-out;
}

th.sortable:hover {
    background-color: #e2e6ea;
}

th.sortable .sort-icon {
    font-size: 0.75rem;
    margin-left: 6px;
    opacity: 0.35;
    vertical-align: middle;
}

th.sortable.sorted-asc .sort-icon,
th.sortable.sorted-desc .sort-icon {
    opacity: 1;
}

.import-search-box .input-group-prepend .input-group-text {
    border-right: 0 !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    background-color: #ffffff !important;
    border-color: #ced4da;
    color: #6c757d;
}

.import-search-box input.form-control {
    border-left: 0 !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-color: #ced4da;
}

.import-search-box input.form-control:focus {
    box-shadow: none !important;
    border-color: #80bdff !important;
}

.import-search-box .input-group:focus-within .input-group-text {
    border-color: #80bdff !important;
}

.import-search-box .input-group-append .btn {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.empty-preview-state {
    background-color: #f8f9fa !important;
    padding: 48px 24px;
    border-radius: 0 0 6px 6px;
}

.empty-preview-state .empty-icon-wrapper {
    color: #6c757d;
}