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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    margin: 0;
    font-size: 2em;
    font-weight: 600;
}

.header p {
    margin-top: 10px;
    opacity: 0.9;
}

.search-section {
    padding: 30px;
    border-bottom: 1px solid #e0e0e0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.filters-section {
    padding: 20px;
    background: #f9f9f9;
    border-radius: 6px;
    margin-bottom: 20px;
}

.filter-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.filter-group input[type="text"],
.filter-group input[type="number"],
.filter-group select {
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #667eea;
}

.filter-group input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.filter-group small {
    color: #666;
    font-size: 12px;
    margin-top: 4px;
}

.checkbox-wrapper {
    padding: 10px 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
}

.checkbox-label span {
    color: #555;
    font-size: 14px;
}

.tokens-filter {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.parameters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.param-group {
    display: flex;
    flex-direction: column;
}

.param-group label {
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.param-group small {
    color: #666;
    font-size: 12px;
    margin-top: 4px;
}

.param-group input {
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
}

.param-group input:focus {
    outline: none;
    border-color: #667eea;
}

.search-button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.search-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.search-button:active {
    transform: translateY(0);
}

.search-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.results-section {
    padding: 30px;
}

.results-section.hidden {
    display: none;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.results-header h2 {
    font-size: 1.5em;
    color: #333;
}

.results-count {
    background: #667eea;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

.error-message {
    background: #fee;
    border-left: 4px solid #f44;
    padding: 15px;
    border-radius: 4px;
    color: #c33;
    margin-bottom: 20px;
}

.result-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: all 0.2s;
}

.result-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.result-main {
    padding: 20px;
}

.result-header-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
}

.result-key-badge {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    word-break: break-all;
    flex: 1;
}

.result-score-badge {
    background: #4caf50;
    color: white;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
}

.result-text {
    color: #333;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 0;
}

.toggle-details-btn {
    width: 100%;
    padding: 12px;
    background: #f5f5f5;
    border: none;
    border-top: 1px solid #e0e0e0;
    color: #667eea;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.toggle-details-btn:hover {
    background: #ebebeb;
}

.toggle-icon {
    font-size: 12px;
}

.result-details {
    background: #f9f9f9;
    border-top: 1px solid #e0e0e0;
    padding: 20px;
}

.result-details.hidden {
    display: none;
}

.detail-section {
    margin-bottom: 20px;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section h4 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
}

.metadata-json {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    margin: 0;
    overflow-x: auto;
    color: #555;
    line-height: 1.6;
}

.metadata-json strong {
    font-weight: 700;
    color: #333;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    .parameters {
        grid-template-columns: 1fr;
    }

    .result-header-line {
        flex-direction: column;
        align-items: stretch;
    }

    .result-key-badge {
        text-align: center;
    }

    .result-score-badge {
        text-align: center;
    }
}

