:root {
    --checkbox-width: 16px;
    --not-label-width: 100px;
    --field-label-width: 180px;
    --input-width: 300px;
    --gap-size: 8px;
    --indent-offset: calc(var(--checkbox-width) + var(--not-label-width) + var(--gap-size));
}

.corpus-search-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.request-container {
    width: auto;
    max-width: 1200px;
}

.request-buttons-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 10px;
    flex-wrap: wrap;
}

.search-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 180px;
}

.search-group {
    border: 1px solid #999;
    border-radius: var(--border-radius);
    padding: 10px;
    margin-bottom: 10px;
    position: relative;
    box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);
    background: #fff;
}

.search-group label {
    color: var(--grey-color);
    margin: 0px 5px;
}

.search-group:first-child .delete-group-btn {
    display: none;
}

.search-group-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: bold;
}

.delete-group-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.filter-row {
    margin-bottom: 8px;
}

.filter-row label {
    margin-left: 5px;
    margin-right: 5px;
}

.filter-row input[type="text"],
.filter-row select {
    margin-left: 5px;
    padding: 3px 5px;
}

.filter-row input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.filter-row .not-label {
    margin-right: 5px;
    cursor: pointer;
}

.operator-select {
    margin-bottom: 10px;
    padding: 5px;
}

.filter-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    gap: var(--gap-size);
    flex-wrap: wrap;
}

.filter-row input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
    width: var(--checkbox-width);
}

.filter-row .not-label {
    cursor: pointer;
    flex-shrink: 0;
    width: var(--not-label-width);
    word-wrap: break-word;
    word-break: break-word;
    line-height: 1.3;
}

.filter-row .field-label {
    cursor: default;
    flex-shrink: 0;
    width: var(--field-label-width);
    word-wrap: break-word;
    word-break: break-word;
    line-height: 1.3;
}

.filter-row input[type="text"],
.filter-row select {
    flex-shrink: 1;
    width: var(--input-width);
    box-sizing: border-box;
}

.filter-row input[type="checkbox"]:checked {
    filter: hue-rotate(0deg) brightness(0.9);
    accent-color: var(--secondary-color);
}

#results {
    scroll-margin-top: 60px;
    max-width: 1000px;
    width: 100%;
}

html {
    scroll-behavior: smooth;
}

.no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);
    margin-top: 20px;
    text-align: center;
    color: #6C757D;
    width: 100%;
}

.no-results svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
}

.no-results p {
    font-size: 18px;
    margin: 0;
}

.results-count {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    color: var(--grey-color);
}

.result-meta {
    color: #666;
    margin-bottom: 10px;
    font-size: 0.9em;
}

.count-number {
    color: var(--primary-color);
}

.search-result-item {
    width: 1000px;
    max-width: 100%;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f9f9f9;
    border-left: 3px solid #007bff;
    border-radius: var(--border-radius);
}

.result-header {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.sentence-context {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 15px;
    padding: 8px;
    background-color: white;
    border-radius: var(--border-radius);
    border: none;
}

.sentence-context pre {
    white-space: pre-wrap;
    word-wrap: break-word;
}

.sentence-context .prev-sentence,
.sentence-context .next-sentence {
    color: #666;
}

.sentence-context .current-sentence {
    font-weight: bold;
    margin: 5px 0;
    line-height: 1.6;
}

.highlight-wordform {
    background-color: var(--e-blue);
    border-radius: 3px;
    padding: 0 2px;
}

.highlight-pos {
    background-color: var(--e-green);
    border-radius: 3px;
    padding: 0 2px;
}

.highlight-error {
    text-decoration: underline;
    text-decoration-color: var(--red-color);
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
}

.loading-indicator {
    text-align: center;
    padding: 40px 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e0e0e0;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-indicator p {
    color: #666;
    font-size: 14px;
    margin: 0;
}

@media (max-width: 600px) {
    .filter-row .field-label {
        width: 100%;
    }

    .filter-row input[type="text"],
    .filter-row select {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 1020px) {
    .search-result-item {
        width: 100%;
    }
}