input:-webkit-autofill {
  box-shadow: 0 0 0px 1000px white inset !important;
  -webkit-text-fill-color: #000 !important;
}
        body {
            background-color: #f8fafc;
        }
        .ts-control{
        border: none;
        font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
                 Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
                 "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    font-size: 16px;
        }

        .title-container {
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .title-icon {
            height: 40px;
            margin-left: 10px;
        }
        #previewPanel {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 80%;
            height: 80%;
            background: white;
            border-radius: 12px;
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
            z-index: 1001;
            display: flex;
            flex-direction: column;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
        }
        #previewPanel.active {
            opacity: 1;
            visibility: visible;
        }
        #previewPanel.fullscreen {
            width: 100%;
            height: 100%;
            border-radius: 0;
        }
        #overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 1000;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
        }
        #overlay.active {
            opacity: 1;
            visibility: visible;
        }
        #previewContent {
            flex: 1;
            position: relative;
            overflow: auto;
            background: #f8f9fa;
        }
        #previewFrame {
            width: 100%;
            height: 100%;
            border: none;
        }
        #imagePreview {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
            display: none;
        }
        .dropdown-content {
            display: none;
            position: absolute;
            background-color: white;
            min-width: 160px;
            box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
            z-index: 1;
            border-radius: 8px;
            overflow: hidden;
        }
        .dropdown:hover .dropdown-content {
            display: block;
        }
        /* PDF viewer container */
        #pdfContainer {
            display: none;
            flex: 1;
            overflow: auto;
            background-color: #525659;
            position: relative;
        }
        #pdfViewer {
            width: 100%;
            height: 100%;
            overflow: auto;
        }
        /* PDF search controls */
        #pdfSearchControls {
            display: none;
            padding: 8px 16px;
            background-color: #f1f5f9;
            border-top: 1px solid #e2e8f0;
        }
        .search-match {
            background-color: rgba(255, 255, 0, 0.3);
        }
        .search-match.selected {
            background-color: rgba(255, 165, 0, 0.5);
        }
        #searchInfo {
            margin-left: 10px;
            font-size: 14px;
            color: #4b5563;
        }
        /* Pagination styles */
        #pagination {
            margin-top: 1.5rem;
        }
        #pagination button {
            padding: 0.5rem 1rem;
            border: 1px solid #e2e8f0;
            border-radius: 0.375rem;
            background-color: white;
            color: #4b5563;
            transition: all 0.2s;
        }
        #pagination button:hover:not(:disabled) {
            background-color: #f3f4f6;
            color: #1e40af;
        }
        #pagination button:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        #pagination .current-page {
            font-weight: 600;
            color: #1e40af;
        }
        /* Page transition animations */
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }
        @keyframes fadeOut {
            from { opacity: 1; transform: translateY(0); }
            to { opacity: 0; transform: translateY(-20px); }
        }
        .page-transition-enter {
            animation: fadeIn 0.4s ease forwards;
        }
        .page-transition-exit {
            animation: fadeOut 0.3s ease forwards;
        }
        /* PDF search highlight styles */
        .textLayer .highlight {
            margin: -1px;
            padding: 1px;
            background-color: rgba(255, 255, 0, 0.4);
            border-radius: 4px;
        }
        .textLayer .highlight.selected {
            background-color: rgba(255, 165, 0, 0.6);
        }
        /* Enhanced search controls styling */
        .search-controls {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 12px 16px;
            background-color: #f1f5f9;
            border-bottom: 1px solid #e2e8f0;
        }
        .search-input-container {
            position: relative;
            flex-grow: 1;
            max-width: 300px;
        }
        .search-input-container input {
            width: 100%;
            padding: 8px 12px;
            padding-right: 32px;
            border: 1px solid #cbd5e1;
            border-radius: 6px;
            font-size: 14px;
        }
        .search-nav-button {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 36px;
            height: 36px;
            border-radius: 6px;
            background-color: #e2e8f0;
            color: #475569;
            cursor: pointer;
            transition: all 0.2s;
        }
        .search-nav-button:hover:not(:disabled) {
            background-color: #cbd5e1;
            color: #1e40af;
        }
        .search-nav-button:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        .search-info {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 14px;
            color: #475569;
        }
        .search-info .count {
            background-color: #e2e8f0;
            padding: 2px 8px;
            border-radius: 12px;
            font-weight: 500;
        }
        .search-info .page-info {
            color: #64748b;
        }
        .search-shortcut {
            position: absolute;
            right: 8px;
            top: 50%;
            transform: translateY(-50%);
            color: #94a3b8;
            font-size: 12px;
            pointer-events: none;
        }
        /* Image controls */
        .image-controls {
            display: none;
            position: absolute;
            bottom: 20px;
            right: 20px;
            background: rgba(255, 255, 255, 0.9);
            padding: 8px;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }
        .image-controls button {
            padding: 6px 12px;
            margin: 0 4px;
            border: none;
            border-radius: 4px;
            background: #e2e8f0;
            color: #475569;
            cursor: pointer;
        }
        .image-controls button:hover {
            background: #cbd5e1;
        }
        /* Search results styling */
        .matching-lines {
            margin-top: 12px;
            padding: 12px;
            /* background-color: #f8fafc; */
            border-radius: 8px;
            border: 1px solid #e2e8f0;
            max-height: 300px;
            overflow-y: auto;
        }

        .matching-line {
            display: flex;
            margin-bottom: 8px;
            font-family: 'Courier New', monospace;
            line-height: 1.5;
            padding: 4px 8px;
            border-radius: 4px;
            transition: background-color 0.2s;
        }

        .matching-line:hover {
            background-color: #f1f5f9;
        }

        .matching-line.active {
            background-color: #e2e8f0;
        }

        .line-info {
            min-width: 120px;
            padding-right: 12px;
            color: #64748b;
            text-align: right;
            user-select: none;
            font-size: 0.9em;
            display: flex;
            flex-direction: column;
            align-items: flex-end;
        }

        .page-number {
            color: #1e40af;
            font-weight: 500;
        }

        .line-number {
            color: #64748b;
        }

        .line-content {
            flex: 1;
            white-space: pre-wrap;
            word-break: break-word;
        }

        .line-content mark {
            background-color: #fef08a;
            padding: 2px 0;
            border-radius: 2px;
        }

        .no-matches {
            color: #64748b;
            font-style: italic;
            padding: 8px 0;
        }

        /* Page navigation controls */
        .page-nav-controls {
            position: absolute;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(255, 255, 255, 0.95);
            padding: 12px 20px;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            display: flex;
            align-items: center;
            gap: 16px;
            z-index: 1000;
        }

        .page-nav-input {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .page-nav-input input {
            width: 60px;
            padding: 4px 8px;
            border: 1px solid #e2e8f0;
            border-radius: 4px;
            text-align: center;
            font-size: 14px;
        }

        .page-nav-input label {
            color: #475569;
            font-size: 14px;
            font-weight: 500;
        }

        .page-nav-button {
            padding: 6px 12px;
            border: none;
            border-radius: 4px;
            background: #e2e8f0;
            color: #475569;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .page-nav-button:hover {
            background: #cbd5e1;
            color: #1e40af;
        }

        .page-nav-button:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .page-info {
            color: #64748b;
            font-size: 14px;
            padding: 0 8px;
        }

        /* Page navigation controls */
        .page-nav-controls {
            position: absolute;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(255, 255, 255, 0.95);
            padding: 12px 20px;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            display: flex;
            align-items: center;
            gap: 16px;
            z-index: 1000;
        }

        .occurrence-nav {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 0 12px;
            border-left: 1px solid #e2e8f0;
            border-right: 1px solid #e2e8f0;
        }

        .occurrence-count {
            background: #e2e8f0;
            padding: 2px 8px;
            border-radius: 12px;
            font-size: 14px;
            color: #475569;
        }

        .occurrence-nav-button {
            padding: 4px 8px;
            border: none;
            border-radius: 4px;
            background: #e2e8f0;
            color: #475569;
            cursor: pointer;
            transition: all 0.2s;
        }

        .occurrence-nav-button:hover:not(:disabled) {
            background: #cbd5e1;
            color: #1e40af;
        }

        .occurrence-nav-button:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .current-occurrence {
            font-size: 14px;
            color: #475569;
            min-width: 60px;
            text-align: center;
        }

        .preview-search-ui {
            position: absolute;
            top: 20px;
            right: 20px;
            display: none;
            flex-direction: column;
            gap: 8px;
            background: white;
            padding: 12px;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            z-index: 1000;
            max-height: 80vh;
            overflow-y: auto;
            min-width: 300px;
        }

        .preview-search-ui .search-input-container {
            position: relative;
            display: flex;
            align-items: center;
            padding-bottom: 8px;
            border-bottom: 1px solid #e2e8f0;
        }

        .preview-search-ui input {
            width: 200px;
            padding: 4px 8px;
            border: 1px solid #e2e8f0;
            border-radius: 4px;
            font-size: 14px;
            background-color: #f8fafc;
            cursor: default;
        }

        .preview-search-ui .search-count {
            margin-left: 8px;
            color: #64748b;
            font-size: 14px;
        }

        .preview-search-ui .matching-lines {
            max-height: 400px;
            overflow-y: auto;
            border: 1px solid #e2e8f0;
            border-radius: 4px;
            margin: 8px 0;
        }

        .preview-search-ui .page-matches {
            border-bottom: 1px solid #e2e8f0;
        }

        .preview-search-ui .page-matches:last-child {
            border-bottom: none;
        }

        .preview-search-ui .page-header {
            background-color: #f1f5f9;
            padding: 8px;
            font-weight: 600;
            color: #1e40af;
            border-bottom: 1px solid #e2e8f0;
        }

        .preview-search-ui .matching-line {
            padding: 8px;
            border-bottom: 1px solid #e2e8f0;
            cursor: pointer;
            transition: background-color 0.2s;
        }

        .preview-search-ui .matching-line:last-child {
            border-bottom: none;
        }

        .preview-search-ui .matching-line:hover {
            background-color: #f1f5f9;
        }

        .preview-search-ui .matching-line.active {
            background-color: #e2e8f0;
        }

        .preview-search-ui .line-info {
            display: flex;
            gap: 8px;
            margin-bottom: 4px;
            font-size: 12px;
            color: #64748b;
        }

        .preview-search-ui .line-content {
            font-size: 14px;
            color: #1e293b;
        }

        .preview-search-ui .occurrence-nav {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding-top: 8px;
            border-top: 1px solid #e2e8f0;
        }

        .preview-search-ui .occurrence-count {
            font-size: 14px;
            color: #475569;
            min-width: 60px;
            text-align: center;
        }

        .preview-search-ui .occurrence-nav-button {
            padding: 4px 8px;
            border: none;
            border-radius: 4px;
            background: #e2e8f0;
            color: #475569;
            cursor: pointer;
            transition: all 0.2s;
        }

        .preview-search-ui .occurrence-nav-button:hover:not(:disabled) {
            background: #cbd5e1;
            color: #1e40af;
        }

        .preview-search-ui .occurrence-nav-button:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .preview-search-ui .no-matches {
            padding: 8px;
            color: #64748b;
            font-style: italic;
            text-align: center;
        }

        .page-matches {
            margin-bottom: 16px;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            overflow: hidden;
        }

        .page-header {
            background-color: #f1f5f9;
            padding: 12px;
            font-weight: 600;
            color: #1e40af;
            border-bottom: 1px solid #e2e8f0;
            font-size: 16px;
        }

        .matching-line {
            padding: 12px;
            border-bottom: 1px solid #e2e8f0;
            background-color: white;
        }

        .matching-line:last-child {
            border-bottom: none;
        }

        .matching-line:hover {
            background-color: #f8fafc;
        }

        .matching-line.active {
            background-color: #e2e8f0;
        }

        .line-info {
            margin-bottom: 8px;
            color: #64748b;
            font-size: 14px;
        }

        .line-number {
            font-weight: 500;
            color: #1e40af;
        }

        .line-content {
            color: #1e293b;
            font-size: 14px;
            line-height: 1.5;
            white-space: pre-wrap;
            word-break: break-word;
        }

        .line-content mark {
            background-color: #fef08a;
            padding: 2px 0;
            border-radius: 2px;
        }

        /* Custom Tooltip Style */
        .custom-tooltip {
            position: absolute;
            background-color: #333; /* Dark background */
            color: #fff; /* White text */
            padding: 10px 15px; /* Increased padding for bigger size */
            border-radius: 6px; /* Slightly larger border radius */
            font-size: 16px; /* Bigger font size */
            z-index: 1002; /* Ensure it's above other content */
            pointer-events: none; /* Allow clicks to pass through to elements below */
            opacity: 0;
            transition: opacity 0.2s ease-in-out; /* Smooth fade transition */
            white-space: nowrap; /* Prevent text wrapping */
            box-shadow: 0 4px 8px rgba(0,0,0,0.4); /* More pronounced shadow */
             transform: translateX(-50%); /* Center tooltip based on its own width */
        }

         /* Arrow pointing down when tooltip is above */
        .custom-tooltip.tooltip-above::after {
            content: '';
            position: absolute;
            top: 100%; /* Position at the bottom of the tooltip */
            left: 50%; /* Position relative to the tooltip's horizontal center */
            transform: translateX(-50%); /* Center the arrow itself */
            border-width: 5px;
            border-style: solid;
            border-color: #2563eb transparent transparent transparent; /* Blue arrow pointing down */
        }

         /* Arrow pointing up when tooltip is below */
        .custom-tooltip.tooltip-below::before {
            content: '';
            position: absolute;
            top: -5px; /* Position above the tooltip */
            left: 50%; /* Position relative to the tooltip's horizontal center */
            transform: translateX(-50%); /* Center the arrow itself */
            border-width: 5px;
            border-style: solid;
            border-color: transparent transparent #2563eb transparent; /* Blue arrow pointing up */
        }

        /* Styles for the internal preview popup */
        .internal-preview-popup {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: white;
            display: none;
            flex-direction: column;
            z-index: 1;
            border-radius: 12px;
            overflow: hidden;
        }

        .internal-preview-popup.active {
            display: flex;
        }

        .internal-preview-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0.75rem 1rem;
            border-bottom: 1px solid #e2e8f0;
            background-color: #f8fafc;
        }

        .internal-preview-header h4 {
            font-size: 1rem;
            font-weight: 600;
            color: #334155;
        }

        .internal-preview-content-area {
            flex: 1;
            position: relative;
            overflow: auto;
            background: #f8f9fa;
        }

        .internal-preview-content-area iframe,
        .internal-preview-content-area img {
            display: none;
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
        }

        .internal-preview-content-area iframe {
             width: 100%;
             height: 100%;
             border: none;
        }

        /* Add CSS for the Toggle Switch */
        .switch {
            position: relative;
            display: inline-block;
            width: 60px;
            height: 34px;
        }

        .switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: #ccc;
            -webkit-transition: .4s;
            transition: .4s;
        }

        .slider:before {
            position: absolute;
            content: "";
            height: 26px;
            width: 26px;
            left: 4px;
            bottom: 4px;
            background-color: white;
            -webkit-transition: .4s;
            transition: .4s;
        }

        input:checked + .slider {
            background-color: #2196F3;
        }

        input:focus + .slider {
            box-shadow: 0 0 1px #2196F3;
        }

        input:checked + .slider:before {
            -webkit-transform: translateX(26px);
            -ms-transform: translateX(26px);
            transform: translateX(26px);
        }

        /* Rounded sliders */
        .slider.round {
            border-radius: 34px;
        }

        .slider.round:before {
            border-radius: 50%;
        }

        /* Style for the operator toggle container */
        .operator-toggle-container {
             /* Use flexbox properties in the HTML div */
             margin-top: 0.125rem;
             margin-bottom: 0.125rem;
        }

        /* Add styles for the condition boxes */
        .condition-row {
            align-items: center;
        }

        .condition-box {
            border: 1px solid #d1d5db; /* Gray 300 */
            border-radius: 0.375rem; /* Rounded-lg */
            padding: 0.5rem 0.75rem; /* py-2 px-3 */
            background-color: #fff; /* White background */
            box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* Shadow-sm */
            min-height: 42px; /* Approximate height of inputs */
            display: flex;
            align-items: center;
        }

        .condition-box select,
        .condition-box input[type="text"] {
            /* Styles moved to inline or handled by parent flex */
        }

        /* Adjust flex basis for equal width in a flex container */
        .condition-row > div:nth-child(1), /* Keyword dropdown container */
        .condition-row > div:nth-child(2), /* 'is' label container */
        .condition-row > div:nth-child(3)  /* Value input container */ {
             flex-basis: calc(100% / 3 - 1rem); /* Distribute space, accounting for gap */
             max-width: calc(100% / 3 - 1rem); /* Prevent growing beyond equal width */
        }

        /* Ensure the remove button aligns nicely */
        .condition-row .remove-condition-btn {
            margin-left: 0.5rem; /* Add space to the left of the remove button */
        }

        /* Make the dropdown match rounded-pill Tailwind filters */
.ts-wrapper.single {
    @apply appearance-none bg-white text-black text-sm px-4 py-2 pr-8 rounded-full border border-gray-200 focus:outline-none focus:ring-0 focus:border-gray-300 shadow-none !important;
    height: 42px !important;
    line-height: 1.5rem;
    display: flex;
    align-items: center;
}

/* Hide the growing text input */
.ts-control > input {
    height: 0;
    padding: 0;
    margin: 0;
    border: none;
    outline: none;
    box-shadow: none;
    background: transparent;
    font-size: 0; /* prevents visual jump */
    width: 0;
}

/* Align selected item like native select */
.ts-control .item {
    @apply text-sm text-black;
    padding-left: 0;
}
#uploaderFilter + div {
    width: 14rem;
}
/* Optional: Adjust dropdown options */
.ts-dropdown.single {
    @apply text-sm border border-gray-200 rounded shadow;
}