.search-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.search-modal {
    background-color: white;
    border: 1px solid #ccc;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Consolas', monospace;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.search-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    background-color: #f0f0f0;
}

.search-modal-header h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: normal;
}

.search-help-button {
    width: 24px;
    height: 24px;
    border-radius: 0;
    border: 1px solid #ccc;
    background-color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.search-help-panel {
    padding: 12px 20px;
    background-color: #f8f8f8;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

.search-help-panel h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1rem;
}

.search-help-panel p {
    margin: 8px 0;
}

.search-help-panel ul {
    margin: 8px 0;
    padding-left: 20px;
}

.search-help-panel li {
    margin-bottom: 4px;
}

.search-modal-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

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

.search-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.search-type-selector,
.search-query-input {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.search-type-selector label,
.search-query-input label {
    font-size: 0.9rem;
    font-weight: bold;
}

.search-type-selector select,
.search-query-input input {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 0;
    font-family: 'Consolas', monospace;
    min-width: 200px;
    background-color: white;
    height: 38px;
    -webkit-appearance: none;
    appearance: none;
    color: black;
    -webkit-text-fill-color: black;
    -webkit-tap-highlight-color: transparent;
}

.search-button {
    padding: 8px 16px;
    background-color: #ffb200;
    border: 1px solid #ffb200;
    color: white;
    border-radius: 0;
    cursor: pointer;
    font-family: 'Consolas', monospace;
    height: 38px;
}

.search-button:hover,
.search-button:focus,
.search-button:active,
.search-button:visited {
    background-color: #f0f0f0;
    text-decoration: none;
    color: #ffb200;
    -webkit-text-fill-color: #ffb200;
}

.search-button:disabled {
    background-color: #f0f0f0;
    cursor: not-allowed;
    text-decoration: none;
    color: #ffb200;
    -webkit-text-fill-color: #ffb200;
}

.search-button.cancel {
    padding: 8px 16px;
    background-color: #f4f4f4;
    border: 1px solid #ddd;
    cursor: pointer;
    font-family: 'Consolas', monospace;
    font-size: 0.9rem;
    color: black;
    -webkit-text-fill-color: black;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    height: auto;
}

.search-button.cancel:hover,
.search-button.cancel:focus,
.search-button.cancel:active,
.search-button.cancel:visited {
    background-color: #e8e8e8;
    color: black;
    -webkit-text-fill-color: black;
    text-decoration: none;
}

.search-error {
    background-color: #ffeeee;
    border: 1px solid #ffcccc;
    color: #cc0000;
    padding: 10px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.search-results h3 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1.1rem;
    padding-bottom: 4px;
    border-bottom: 1px solid #eee;
}

.search-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #666;
}

.search-no-results {
    padding: 20px;
    color: #666;
    text-align: center;
    border: 1px dashed #ccc;
    background-color: #f9f9f9;
    font-size: 0.9rem;
}

.search-result-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.search-result-item {
    border: 1px solid #ddd;
    background-color: #f9f9f9;
    margin-bottom: 12px;
}

.search-result-header {
    padding: 8px 12px;
    background-color: #f0f0f0;
    border-bottom: 1px solid #eee;
    font-family: 'Consolas', monospace;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-result-header strong {
    font-weight: bold;
    font-size: 0.95rem;
}

.search-result-content {
    padding: 12px;
}

.search-result-field {
    display: flex;
    margin-bottom: 10px;
    font-size: 0.9rem;
    align-items: baseline;
    flex-wrap: wrap;
    border-bottom: 1px dotted #eee;
    padding-bottom: 6px;
}

.search-result-field:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.search-result-key {
    font-weight: bold;
    margin-right: 12px;
    min-width: 90px;
    color: #333;
}

.search-result-value {
    font-family: 'Consolas', monospace;
    word-break: break-all;
}

/* Special formatting for different types of values */
.search-result-value.digest {
    color: #333;
}

.search-result-value.timestamp {
    color: #333;
}

.search-result-value.view {
    color: #333;
}

.search-result-value.signature {
    color: #0000ee;
    font-family: 'Consolas', monospace;
}

.search-result-json {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.9rem;
    overflow-x: auto;
    padding: 10px;
    background-color: #f5f5f5;
    border: 1px solid #eee;
    border-radius: 0;
}

.search-modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
}

.latency {
    margin-top: 16px;
    font-style: italic;
    color: #777;
    font-size: 12px;
    line-height: 1.4;
    text-align: center;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .search-modal {
        max-width: 95%;
    }

    .search-modal-header {
        padding: 12px 16px;
    }

    .search-modal-header h2 {
        font-size: 1rem;
    }

    .search-options {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .search-type-selector select,
    .search-query-input input {
        width: 100%;
        min-width: unset;
        height: 38px;
        font-size: 0.9rem;
    }

    .search-button {
        width: 100%;
        height: 38px;
        font-size: 0.9rem;
    }

    .search-modal-content {
        padding: 16px;
    }

    .search-help-panel {
        padding: 10px 16px;
        font-size: 0.8rem;
    }

    .search-results h3 {
        font-size: 1rem;
    }

    .search-result-key {
        min-width: auto;
        margin-bottom: 4px;
    }

    .search-result-field {
        flex-direction: column;
        align-items: flex-start;
        font-size: 0.8rem;
    }

    .latency {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .search-modal-header {
        padding: 10px 12px;
    }

    .search-modal-header h2 {
        font-size: 0.9rem;
    }

    .search-type-selector label,
    .search-query-input label {
        font-size: 0.85rem;
    }

    .search-type-selector select,
    .search-query-input input {
        padding: 6px 10px;
        font-size: 0.85rem;
    }

    .search-button {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    .search-modal-content {
        padding: 12px;
    }

    .search-help-panel {
        padding: 8px 12px;
        font-size: 0.75rem;
    }

    .search-result-header {
        padding: 6px 10px;
    }

    .search-result-content {
        padding: 10px;
    }

    .search-result-field {
        font-size: 0.75rem;
    }

    .search-modal-footer {
        padding: 12px;
    }

    .latency {
        font-size: 10px;
    }
}