::-webkit-scrollbar {
    -webkit-appearance: none;
    width: 7px;
    height: 14px;
}

::-webkit-scrollbar-thumb {
    border-radius: 2px;
    background-color: #9696c9;
    box-shadow: 0 0 1px rgba(255, 255, 255, .1);
}

.custom-date-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
}

.custom-textarea {
    display: flex;
    flex-direction: column;
    width: 75%;
}

.-mx-custom {
    margin-left: 0;
    margin-right: -2rem;
}

.own-chat-margin {
    margin-left: 15rem;
}

.not-own-chat-margin {
    margin-left: 1rem;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgb(244, 244, 244);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.overlay-image {
    max-width: 100%;
    max-height: 100%;
}

.custom-button {
    cursor: pointer;
    right: 0;
    border-radius: 0.5rem; /* same as rounded-lg */
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem; /* same as px-4 py-2 */
    border: 1px solid #d1d5db; /* same as border-gray-300 */
    background-color: #ffffff; /* same as bg-white */
    font-size: 0.875rem; /* same as text-sm */
    font-weight: 500; /* same as font-medium */
    color: #374151; /* same as text-gray-700 */
}

.custom-button:hover {
    background-color: #f9fafb; /* same as hover:bg-gray-50 */
}

.dropdown-container {
    position: absolute;
    z-index: 1000;
    background-color: white;
    border: 1px solid #ccc;
    padding: 5px;
    box-sizing: border-box;
    visibility: hidden;
    display: block;
}

.input-wrapper {
    position: relative;
    width: 100%;
}

.filter-input {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 5px;
    padding-right: 35px;
    padding-left: 5px;
    height: 30px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.arrow-button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    user-select: none;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.options-list {
    list-style: none;
    padding: 0;
    max-height: 150px;
    overflow-y: auto;
    display: none;
    margin: 5px 0 0;
    border-radius: 4px;
}

.option-item {
    padding: 5px;
    cursor: pointer;
}

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

.options-list::-webkit-scrollbar {
    width: 6px;
}

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

.options-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

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

.ocr-table {
    width: 100%;
    border-spacing: 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.ocr-table-header {
    background-color: #f8fafc;
    color: #4a5568;
    letter-spacing: 0.05em;
    text-align: left;
}

.ocr-table-header th {
    padding: 12px 16px;
    border-bottom: 2px solid #cbd5e0;
    border-right: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    background-color: #f8fafc;
    z-index: 1;
}

.ocr-table-header th:last-child {
    border-right: none;
}

.json-array-table td.sticky-col-left {
    position: sticky;
    left: 0;
    z-index: 2;
}

.ocr-table-body td {
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    vertical-align: top;
}

.ocr-table-body tr:nth-child(odd) {
}

.ocr-table-body tr:nth-child(even) {
}

.ocr-table-body td:last-child {
    border-right: none;
}

.ocr-table-body tr:last-child td {
    border-bottom: none;
}

@media (max-width: 640px) {
    .ocr-table {
        font-size: 14px;
    }

    .ocr-table-header th,
    .ocr-table-body td {
        padding: 8px 12px;
    }
}

.json-editor {
    max-height: 600px;
    overflow: auto;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 5px;
    background-color: #fafafa;
}

.json-display-container {
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 15px;
    font-family: Arial, sans-serif;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    z-index: 40;
    overflow: auto;
}

.json-title {
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.1em;
    color: #495057;
}

.json-table,
.json-object-table,
.json-array-table {
    border-collapse: collapse;
    margin-bottom: 10px;
    table-layout: auto;
    width: max-content;
    min-width: 250px;
    background-color: #fafafa;
}

.json-table th,
.json-object-table th,
.json-array-table th {
    border: 1px solid #ced4da;
    padding: 8px 12px;
    background-color: #f7f7f7;
    color: #333333;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
    font-weight: bold;
}

.json-table td,
.json-object-table td,
.json-array-table td {
    border: 1px solid #dee2e6;
    padding: 6px 10px;
    text-align: left;
    vertical-align: top;
    word-wrap: break-word;
    background-color: #ffffff;
    color: #333333;
}

.json-array-index,
.json-object-key {
    width: 180px;
    max-width: 180px;
    background-color: #f8f9fa;
    color: #212529;
    padding-right: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
    font-weight: 500;
}

.json-object-table.editable td {
    padding: 0;
}

.json-object-table.editable td input,
.json-object-table.editable td select,
.json-object-table.editable td textarea {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    border: 1px solid transparent;
    border-radius: 0;
    margin: 0;
    padding: 6px 10px;
    display: block;
    background-color: transparent;
    color: #333333;
    line-height: 1.4;
    font-family: inherit;
    font-size: inherit;
    outline: none;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.json-object-table.editable td input:focus,
.json-object-table.editable td select:focus,
.json-object-table.editable td textarea:focus {
    border-color: #80bdff;
    background-color: #ffffff;
    position: relative;
    z-index: 1;
}

.json-object-table.editable td textarea {
    resize: vertical;
    min-height: calc(1.4em + 12px + 2px);
}

.add-button,
.delete-button {
    background: none;
    border: none;
    padding: 0;
    padding-right: 0.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    font-weight: 900;
}

.add-button {
    color: green;
}

.delete-button {
    color: red;
}

.tooltip {
    position: fixed;
    background-color: white;
    color: black;
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s;
}

.pdf-loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.pdf-spinner {
    width: 80px;
    height: 100px;
    position: relative;
}

.pdf-document {
    width: 100%;
    height: 100%;
    background: #e74c3c;
    border-radius: 4px;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.pdf-document::after {
    content: "";
    position: absolute;
    left: 0;
    width: 100%;
    height: 60px;
    background: linear-gradient(
            to bottom,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.3) 40%,
            rgba(255, 255, 255, 0.6) 50%,
            rgba(255, 255, 255, 0.3) 60%,
            rgba(255, 255, 255, 0) 100%
    );
    top: -60px;
    animation: slideFade 2s linear infinite;
    pointer-events: none;
    filter: blur(4px);
}

@keyframes slideFade {
    0% {
        top: -60px;
    }
    100% {
        top: 100%;
    }
}

.pdf-corner {
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.pdf-label {
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-family: sans-serif;
    font-weight: bold;
    font-size: 14px;
    color: #fff;
}

.pdf-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    background-color: #fff;
    display: flex;
    justify-content: center;
    padding: 120px;
    align-items: stretch;
    border-radius: 12px;
}

.pdf-loading-overlay.hidden {
    display: none !important;
}

:root {
    --primary-color: rgba(39, 32, 171, 0.4);
    --secondary-color: #9c0e0e;
    --background-color: #FFFFFF;
    --text-color: #333333;
    --accent-color: #4CAF50;
    --label-color-transparent: rgb(156, 14, 14, 0.4);
}

.label {
    border: 2px solid var(--accent-color);
    background-color: rgba(76, 175, 80, 0.1);
    padding: 2px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 0.25rem;
}

.text-block {
    position: absolute;
    z-index: 10;
    background-color: rgba(108, 99, 255, 0.1);
    border: 1px solid rgba(108, 99, 255, 0.5);
    pointer-events: auto;
    border-radius: 0.25rem;
    pointer-events: auto;
    font-size: 4px;
    font-family: "Noto Sans", "Liberation Sans", sans-serif;
}

.selected-label {
    background-color: var(--label-color-transparent);
}

.selected-value {
    position: absolute;
    background-color: rgba(76, 175, 80, 0.1);
    border-color: rgba(76, 175, 80, 0.5);
}

.highlight {
    box-shadow: 0 0 10px 2px var(--primary-color);
    border-radius: 0.5rem;
}

.highlight-no-coordinates {
    box-shadow: 0 0 1px 1px rgba(238, 255, 0, 0.56);
    border-radius: 0.2rem;
}

.draggable-bar {
    position: absolute;
    height: 3px;
    background-color: var(--secondary-color);
    cursor: row-resize;
    z-index: 25;
    opacity: 0.7;
    transition: opacity 0.3s;
    pointer-events: auto;
}

.vertical-draggable-bar {
    position: absolute;
    width: 3px;
    background-color: var(--secondary-color);
    cursor: col-resize;
    z-index: 25;
    pointer-events: auto;
    transition: left 0.2s ease-out;
    height: 100%;
}

.draggable-bar:hover,
.vertical-draggable-bar:hover {
    opacity: 1;
}

#coordinatesDisplay {
    display: none;
    position: fixed;
    background-color: var(--primary-color);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 10px;
    pointer-events: none;
    z-index: 1000;
    transform: translate(-100%, -100%);
}

.table-header {
    background-color: var(--primary-color);
}

#textGroupingContainer {
    position: relative;
    width: 200px;
    height: 20px;
    background-color: #f0f0f0;
    border-radius: 10px;
}

#textGroupingHandle {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #ff0000;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
}

#textGroupingHandle:hover {
    transform: scale(1.1);
}

#textGroupingHandle:active {
    transform: scale(0.9);
}

#scriptInput {
    width: 100%;
    margin-bottom: 20px;
}

pre {
    white-space: pre-wrap;
    word-wrap: break-word;
}

#ocrTextContainer {
    margin-top: 20px;
}

#ocrText {
    background-color: #f9f9f9;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.reference-column-popup {
    position: absolute;
    z-index: 1000;
    transform: translateY(-100%);
}

.fixed-vertical-length-popup {
    position: absolute;
    z-index: 1000;
    transform: translate(-100%, -100%);
}

.json-display-container {
    align-items: stretch;
    height: 100%;
    overflow-y: auto;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 10px;
    font-family: Arial, sans-serif;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    z-index: 40;
}

.resizing {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.json-table {
    border-collapse: collapse;
    margin-bottom: 10px;
}

.json-table th {
    border: 2px solid #ccc;
    padding: 8px;
    background-color: #f0f0f0;
    text-align: center;
    border-radius: 0.25rem;
}

.json-table td {
    border: 1px solid #ccc;
    padding: 8px;
    text-align: left;
    align-content: start;
}

.json-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.json-array-index,
.json-object-key {
    font-weight: bold;
    background-color: #f0f0f0;

    .direction-arrows {
        width: 100%;
        height: 100%;
        pointer-events: auto;
    }

    .direction-arrows svg path {
        pointer-events: auto;
    }

    .hovering-block {
        position: absolute;
        z-index: 30;
    }

    #deltaXDisplay {
        color: white;
        font-size: 12px;
        font-weight: bold;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        pointer-events: none;
        text-align: center;
    }
}