* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system,BlinkMacSystemFont,sans-serif;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    background: #f8f9fa;
}

.search-form,.filters-panel {
    background: #fff;
    padding: 25px;
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: end;
}

.filter-group {
    flex: 1;
    min-width: 250px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
}

.filter-label {
    font-weight: 600;
    margin-bottom: 10px;
    color: #495057;
    display: block;
}

.filter-select,.filter-input {
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 15px;
    width: 100%;
    transition: border-color 0.3s;
}

.filter-select:focus,.filter-input:focus {
    outline: none;
    border-color: #007cba;
}

.search-input {
    width: 100%;
    padding: 16px 20px;
    font-size: 18px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.search-input:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0,124,186,0.1);
}

.search-btn {
    background: linear-gradient(135deg,#007cba,#005a87);
    color: #fff;
    padding: 14px 28px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.search-btn:hover {
    transform: translateY(-1px);
}

.reset-btn {
    background: #6c757d;
    color: #fff;
    padding: 14px 20px;
    text-decoration: none;
    border-radius: 10px;
    display: inline-block;
    transition: background 0.2s;
}

.reset-btn:hover {
    background: #5a6268;
}

.debug-panel {
    background: #e8f4fd;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    border-left: 5px solid #007cba;
}

.debug-title {
    font-size: 1.2em;
    font-weight: 700;
    color: #007cba;
    margin-bottom: 15px;
}

.doc-list {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.doc-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.doc-path {
    font-size: 0.9em;
    color: #666;
    word-break: break-all;
}

.doc-status {
    background: #28a745;
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8em;
}

.debug-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 0.9em;
}

.debug-table th,.debug-table td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: left;
    vertical-align: top;
}

.debug-table th {
    background: #007cba;
    color: white;
    font-weight: 600;
}

.status-ok {
    background: #d4edda;
    color: #155724;
}

.status-error {
    background: #f8d7da;
    color: #721c24;
}

.result {
    margin: 25px 0;
    border: 1px solid #dee2e6;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.result-header {
    background: linear-gradient(135deg,#f8f9fa,#e9ecef);
    padding: 25px;
    border-bottom: 1px solid #dee2e6;
}

.result-title {
    margin: 0 0 12px;
    font-size: 1.4em;
    font-weight: 700;
    color: #1a1a1a;
}

.page-badge {
    color: #198754;
    background: #d1e7dd;
    padding: 8px 16px;
    border-radius: 25px;
    border: 2px solid #a3cfbb;
    text-decoration: none;
    display: inline-block;
    margin: 2px;
}

.result-snippet {
    padding: 30px;
    background: #fff;
    line-height: 1.8;
    font-size: 1em;
}

.highlight {
    background: #fff3cd;
    color: #856404;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 700;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 30px 0;
}

.page-link {
    background: #fff;
    padding: 10px 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    text-decoration: none;
    color: #495057;
}

.page-link:hover,.page-active {
    background: #007cba;
    color: #fff;
    border-color: #007cba;
}

.stats {
    background: #e8f4fd;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    border-left: 5px solid #28a745;
}

@media (max-width: 768px) {
    .filter-row {
        flex-direction:column;
    }

    .filter-group {
        min-width: 100% !important;
    }
}

.sort-btn {
    padding: 10px 20px;
    border: 2px solid #dee2e6;
    background: #fff;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
}

.sort-btn.active,.sort-btn:hover {
    background: #007cba;
    color: #fff;
    border-color: #007cba;
}

.badge {
    font-size: 0.9em;
    color: #495057;
    background: #e9ecef;
    padding: 8px 16px;
    border-radius: 25px;
    font-weight: 600;
}

.pdf-badge {
    font-size: 0.9em;
    color: #dc3545;
    background: #f8d7da;
    padding: 8px 16px;
    border-radius: 25px;
    font-weight: 600;
}

.cached-badge {
    font-size: 0.85em;
    color: #28a745;
    background: #d4edda;
    padding: 6px 12px;
    border-radius: 20px;
}

.unique-badge {
    font-size: 0.85em;
    color: #20c997;
    background: #d1ecf1;
    padding: 6px 12px;
    border-radius: 20px;
}

.result {
    margin: 25px 0;
    border: 1px solid #dee2e6;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.result:hover {
    box-shadow: 0 16px 40px rgba(0,0,0,0.15);
}

.result-header {
    background: linear-gradient(135deg,#f8f9fa,#e9ecef);
    padding: 25px;
    border-bottom: 1px solid #dee2e6;
}

.result-title {
    margin: 0 0 12px;
    font-size: 1.4em;
    font-weight: 700;
    color: #1a1a1a;
}

.result-path {
    color: #6c757d;
    font-size: 1em;
    word-break: break-all;
}

.result-type {
    font-size: 0.95em;
    color: #dc3545;
    background: #f8d7da;
    padding: 6px 14px;
    border-radius: 16px;
    margin-right: 12px;
    font-weight: 600;
}

.page-badge,.score-badge {
    font-size: 0.95em;
    color: #198754;
    background: #d1e7dd;
    padding: 6px 16px;
    border-radius: 25px;
    border: 2px solid #a3cfbb;
    margin-right: 12px;
}

.hits-badge {
    font-size: 0.9em;
    color: #fd7e14;
    background: #fff3cd;
    padding: 5px 12px;
    border-radius: 20px;
    margin-left: 8px;
}

.result-snippet {
    padding: 30px;
    background: #fff;
    line-height: 1.8;
    font-size: 1em;
}

.exacthighlight {
    background: #e3ffcd!important;
    color: green!important;
     padding: 4px 8px;
    border-radius: 6px;
    font-weight: 700;
    box-shadow: 0 4px 8px #8BC34A;
}

.highlight {
    background: #fff3cd!important;
    color: #856404!important;
    padding: 4px 0.1px;
    border-radius: 6px;
    font-weight: 700;
    box-shadow: 0 4px 8px rgba(255,193,7,0.4);
}

.no-results {
    text-align: center;
    padding: 80px 40px;
    color: #6c757d;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.stats {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 1em;
    color: #495057;
}

.score-control {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8f9fa;
    padding: 12px;
    border-radius: 10px;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 40px 0;
    padding: 20px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.page-btn {
    padding: 12px 18px;
    border: 2px solid #dee2e6;
    background: #fff;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: all 0.3s;
}

.page-btn:hover {
    background: #007cba;
    color: #fff;
    border-color: #007cba;
    transform: translateY(-2px);
}

.page-btn.active {
    background: #007cba;
    color: #fff;
    border-color: #007cba;
}

.page-btn:disabled {
    color: #6c757d;
    cursor: not-allowed;
    border-color: #dee2e6;
    background: #f8f9fa;
}

.page-info {
    font-size: 1em;
    color: #495057;
    font-weight: 500;
}

@media (max-width: 768px) {
    .inline-row {
        flex-direction:column;
    }

    .length-input {
        min-width: 100%;
    }

    .pagination {
        flex-direction: column;
        gap: 15px;
    }
}
